• Joe Perches's avatar
    checkpatch: check for uncommented waitqueue_active() · cb426e99
    Joe Perches authored
    Linus sayeth:
    
    : Pretty much every single time people use this "if
    : (waitqueue_active())" model, it tends to be a bug, because it means
    : that there is zero serialization with people who are just about to go
    : to sleep. It's fundamentally racy against all the "wait_event()" loops
    : that carefully do memory barriers between testing conditions and going
    : to sleep, because the memory barriers now don't exist on the waking
    : side.
    :
    : So I'm making a new rule: if you use waitqueue_active(), I want an
    : explanation for why it's not racy with the waiter. A big comment about
    : the memory ordering, or about higher-level locks that are held by the
    : caller, or something.
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    cb426e99
checkpatch.pl 160 KB