Thread (11 messages) 11 messages, 4 authors, 2023-08-12

Re: [PATCH -next v3] block: remove init_mutex and open-code blk_iolatency_try_init

From: Yu Kuai <hidden>
Date: 2023-08-11 08:53:52
Also in: cgroups
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds


在 2023/08/11 16:23, Michal Koutný 写道:
On Fri, Aug 11, 2023 at 09:44:55AM +0800, Yu Kuai [off-list ref] wrote:
quoted
Now that this problem doesn't exist, I think it's ok just to remove this
comment.
Why doesn't the problem exist now?
IIUC, it does but it's prevented thanks to outer synchronization via
rq_qos_mutex. Hence the comment clarifies why is the lockdep_assert
placed here.
Yes, it'm implemented in the upper layer that rq_qos_add() and
blkcg_activate_policy() should be atmoic, and currently there is no
comments for that.

Perhaps it's better to add some comments like following in rq_qos_add()
instead?
diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
index 167be74df4ee..8e8c597ea01b 100644
--- a/block/blk-rq-qos.c
+++ b/block/blk-rq-qos.c
@@ -302,6 +302,11 @@ int rq_qos_add(struct rq_qos *rqos, struct gendisk 
*disk, enum rq_qos_id id,
  {
         struct request_queue *q = disk->queue;

+       /*
+        * If rq_qos is used with cgroup policy, and cgroup policy can be
+        * initialized through cgroupfs, 'rq_qos_mutex' should be held
+        * untill blkcg_activate_policy() is done after this function 
return.
+        */
         lockdep_assert_held(&q->rq_qos_mutex);

         rqos->disk = disk;
Michal
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help