Thread (12 messages) flat view 12 messages, 4 authors, 3h ago

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

From: Nilay Shroff <hidden>
Date: 2026-09-06 11:03:35
Also in: cgroups, dm-devel, gfs2, linux-block, linux-doc, linux-fsdevel, linux-mm, linux-raid, lkml, nvdimm, virtualization

On 8/23/26 7:00 PM, Yu Kuai wrote:
quoted hunk ↗ jump to hunk
@@ -111,10 +104,15 @@ struct blkcg {
  	/*
  	 * List of updated percpu blkg_iostat_set's since the last flush.
  	 */
  	struct llist_head __percpu	*lhead;
  
+#ifdef CONFIG_BLK_CGROUP_PUNT_BIO
+	spinlock_t			async_bio_lock; /* protects async_bios */
+	struct bio_list			async_bios;
+	struct work_struct		async_bio_work;
+#endif
  #ifdef CONFIG_BLK_CGROUP_FC_APPID
  	char                            fc_app_id[FC_APPID_LEN];
  #endif
  #ifdef CONFIG_CGROUP_WRITEBACK
  	struct list_head		cgwb_list;
As I mentioned, Clang context annotations are now officially supported
in the block layer. Since you're touching this code, I suggest annotating
async_bios with __guarded_by(&async_bio_lock) as well.

This would allow the Clang thread-safety analyzer to verify that every
access to async_bios is properly protected by async_bio_lock.

Thanks,
--Nilay
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help