lkml.org 
[lkml]   [2017]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/2] sched/wait: assert the wait_queue_head lock is held in __wake_up_common
    Date
    Better ensure we actually hold the lock using lockdep than just commenting
    on it. Due to the various exported _locked interfaces it is far too easy
    to get the locking wrong.

    Signed-off-by: Christoph Hellwig <hch@lst.de>
    ---
    kernel/sched/wait.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
    index 98feab7933c7..347c06c8222e 100644
    --- a/kernel/sched/wait.c
    +++ b/kernel/sched/wait.c
    @@ -76,6 +76,8 @@ static int __wake_up_common(struct wait_queue_head *wq_head, unsigned int mode,
    wait_queue_entry_t *curr, *next;
    int cnt = 0;

    + lockdep_assert_held(&wq_head->lock);
    +
    if (bookmark && (bookmark->flags & WQ_FLAG_BOOKMARK)) {
    curr = list_next_entry(bookmark, entry);

    --
    2.14.2
    \
     
     \ /
      Last update: 2017-11-30 15:21    [W:3.017 / U:0.616 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site