Re: [PATCH v2 3/3] blk-cgroup: move async bio punt state to blkcg

From
Christoph Hellwig <hch@lst.de>
Date
2026-09-15 06:50:49
Also in
cgroups, dm-devel, gfs2, linux-bcache, linux-block, linux-doc, linux-fsdevel, linux-mm, lkml, llvm
Reply to
Nilay Shroff, 2026-09-13
On Sun, Sep 13, 2026 at 06:59:25PM +0530, Nilay Shroff wrote:
quoted
+	/* as long as there are pending bios, @blkcg can't go away */
+	{
+		guard(spinlock)(&blkcg->async_bio_lock);
+		bio_list_merge_init(&bios, &blkcg->async_bios);
+	}
Instead of using guard(spinlock)(...) here, I think we could use the
simpler spin_lock()/spin_unlock() helpers. IMO, they are easier
to read and reason about for these short critical sections.
Yes, guard() is a complete mess that makes code unreadable, please
don't use it.  scope_guard is a bit better, but given that it doesn't
mix with goto based unwdinding it still is too dangerous to actually
use.
Thread (11 messages) 11 messages, 4 authors, last reply 2026-09-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help