lkml.org 
[lkml]   [2002]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [patch] v2.5.22 - add wait queue function callback support
    On Mon, Jun 17, 2002 at 10:28:12PM +0200, Dave Jones wrote:
    > On Mon, Jun 17, 2002 at 04:14:34PM -0400, Benjamin LaHaise wrote:
    > > +#define add_wait_queue_cond(q, wait, cond) \
    > > + ({ \
    > > + unsigned long flags; \
    > > + int _raced = 0; \
    > > + wq_write_lock_irqsave(&(q)->lock, flags); \
    >
    > I thought we killed off wq_write_lock_irqsave 1-2 kernels ago ?

    Ah, I didn't notice that as I've not reached the point of merging
    everything into a working build -- I'd like to get some feedback
    and comments on the mergable units as they become available, since
    I'm rewriting a few portions to fix problems that experience with
    the code revealed. Anyways, the patch below changes add_wait_queue_cond
    to use spin_locks directly.

    -ben

    diff -urN wq-func-v2.5.22.diff/include/linux/wait.h wq-func-v2.5.22-b.diff/include/linux/wait.h
    --- wq-func-v2.5.22.diff/include/linux/wait.h Mon Jun 17 15:53:25 2002
    +++ wq-func-v2.5.22-b.diff/include/linux/wait.h Mon Jun 17 16:46:23 2002
    @@ -106,7 +106,7 @@
    ({ \
    unsigned long flags; \
    int _raced = 0; \
    - wq_write_lock_irqsave(&(q)->lock, flags); \
    + spin_lock_irqsave(&(q)->lock, flags); \
    (wait)->flags = 0; \
    __add_wait_queue((q), (wait)); \
    rmb(); \
    @@ -114,7 +114,7 @@
    _raced = 1; \
    __remove_wait_queue((q), (wait)); \
    } \
    - wq_write_unlock_irqrestore(&(q)->lock, flags); \
    + spin_lock_irqrestore(&(q)->lock, flags); \
    _raced; \
    })

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 13:26    [W:0.023 / U:6.620 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site