Thread (11 messages) flat view 11 messages, 4 authors, 2d ago

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-block, linux-doc, linux-fsdevel, linux-mm, linux-raid, lkml, llvm

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help