[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ead047aa-d9dc-4b2f-869f-610b309b5092@vivo.com>
Date: Thu, 11 Jul 2024 20:48:03 +0800
From: YangYang <yang.yang@...o.com>
To: Bart Van Assche <bvanassche@....org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Jens Axboe <axboe@...nel.dk>,
Ming Lei <ming.lei@...hat.com>, Omar Sandoval <osandov@...com>,
linux-kernel@...r.kernel.org, linux-block@...r.kernel.org
Subject: Re: [PATCH v6] sbitmap: fix io hung due to race on
sbitmap_word::cleared
On 2024/7/11 3:54, Bart Van Assche wrote:
> On 7/9/24 11:56 PM, Yang Yang wrote:
>> + /**
>> + * @swap_lock: Held while swapping word <-> cleared
>> + */
>> + spinlock_t swap_lock;
>
> Why is only swapping 'word' with 'cleared' protected by the spinlock?
> If all 'cleared' changes would be protected by this spinlock then
> that would allow to eliminate the expensive xchg() call from
> sbitmap_deferred_clear().
The spinlock was initially introduced in ea86ea2cdced ("sbitmap:
ammortize cost of clearing bits").
I think if all 'cleared' changes are protected by the spinlock, the
overhead of clearing tags would definitely increase.
Thanks.
>
> Thanks,
>
> Bart.
Powered by blists - more mailing lists