[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29e50fff-fa7f-4b92-bfe9-7665c934b7dc@acm.org>
Date: Wed, 10 Jul 2024 12:54:01 -0700
From: Bart Van Assche <bvanassche@....org>
To: Yang Yang <yang.yang@...o.com>, 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 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().
Thanks,
Bart.
Powered by blists - more mailing lists