Thread (11 messages) flat view 11 messages, 4 authors, 5h ago

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

From: "yu kuai" <yukuai@fygo.io>
Date: 2026-09-06 11:41:44
Also in: dm-devel, gfs2, linux-bcache, linux-block, linux-doc, linux-fsdevel, linux-mm, linux-raid, lkml, nvdimm, virtualization

Hi,

在 2026/9/6 19:01, Nilay Shroff 写道:
On 8/23/26 7:00 PM, Yu Kuai wrote:
quoted
@@ -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.
Sounds reasonable, will do this in the next version.
Thanks,
--Nilay
-- 
Thanks,
Kuai
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help