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