Skip to content
  • Josef Bacik's avatar
    a6d81d30
    wait: add wq_has_single_sleeper helper · a6d81d30
    Josef Bacik authored
    
    
    rq-qos sits in the io path so we want to take locks as sparingly as
    possible.  To accomplish this we try not to take the waitqueue head lock
    unless we are sure we need to go to sleep, and we have an optimization
    to make sure that we don't starve out existing waiters.  Since we check
    if there are existing waiters locklessly we need to be able to update
    our view of the waitqueue list after we've added ourselves to the
    waitqueue.  Accomplish this by adding this helper to see if there is
    more than just ourselves on the list.
    
    Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    a6d81d30
    wait: add wq_has_single_sleeper helper
    Josef Bacik authored
    
    
    rq-qos sits in the io path so we want to take locks as sparingly as
    possible.  To accomplish this we try not to take the waitqueue head lock
    unless we are sure we need to go to sleep, and we have an optimization
    to make sure that we don't starve out existing waiters.  Since we check
    if there are existing waiters locklessly we need to be able to update
    our view of the waitqueue list after we've added ourselves to the
    waitqueue.  Accomplish this by adding this helper to see if there is
    more than just ourselves on the list.
    
    Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Loading