[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87cz9odgcf.fsf@suse.de>
Date: Mon, 14 Nov 2022 22:52:32 -0500
From: Gabriel Krisman Bertazi <krisman@...e.de>
To: Jan Kara <jack@...e.cz>
Cc: axboe@...nel.dk, linux-kernel@...r.kernel.org,
linux-block@...r.kernel.org, Hugh Dickins <hughd@...gle.com>,
Keith Busch <kbusch@...nel.org>,
Liu Song <liusong@...ux.alibaba.com>
Subject: Re: [PATCH] sbitmap: Use single per-bitmap counting to wake up
queued tags
Jan Kara <jack@...e.cz> writes:
> Now this may be also problematic - when we were checking the number of woken
> waiters in the older version of the patch (for others: internal version of
> the patch) this was fine but now it may happen that the 'ws' we have
> selected has no waiters anymore. And in that case we need to find another
> waitqueue because otherwise we'd be loosing too many wakeups and we could
> deadlock. So I think this rather needs to be something like:
>
> do {
> if (atomic_read(&sbq->completion_cnt) - wakeups < wake_batch)
> return;
> } while (!atomic_try_cmpxchg(&sbq->wakeup_cnt,
> &wakeups, wakeups + wake_batch));
>
> do {
> ws = sbq_wake_ptr(sbq);
> if (!ws)
> return;
Jan,
Does this really solve it? There is no guarantee there will be another
waiter in the queues when we check here. So, once again we could not
wake up anyone and return it this if leg. If that is the case, don't we
end up overshooting wakeups and end up again with less completions than
required to wake up an incoming io?
--
Gabriel Krisman Bertazi
Powered by blists - more mailing lists