Linux block layer
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jiufei Xue <jiufei.xue@linux.alibaba.com>
Cc: axboe@kernel.dk, cgroups@vger.kernel.org,
	linux-block@vger.kernel.org, joseph.qi@linux.alibaba.com
Subject: Re: [PATCH] iocost: treat as root level when parents are activated
Date: Tue, 12 Nov 2019 07:31:59 -0800	[thread overview]
Message-ID: <20191112153159.GD4163745@devbig004.ftw2.facebook.com> (raw)
In-Reply-To: <7be6fb71-7e08-e369-cbbe-678129cc62ff@linux.alibaba.com>

Hello,

On Tue, Nov 12, 2019 at 09:38:57AM +0800, Jiufei Xue wrote:
> > Hmm... I'm not sure this description makes sense.
> > 
> Should I change the description to something like this?
> "we should treat the leaf nodes as root while the parent are already activated".

Hmm... this is addressing an obvious bug.  The intention of the code
was checking whether all the ancestors and self have already been
activated but it just failed to do so, so I think the patch
description should reflect that.

> > But there's an obvious bug there as it's checking the same active_list
> > over and over again.  Shouldn't it be sth like the following instead?
> > 
> > 	if (!list_empty(&iocg->active_list))
> > 		goto succeed_unlock;
> 
> iocg has already checked before, do you mean we should check it again
> after ioc->lock?

Yes, that part of the code is correct.  It needs to check it again as
someone could have changed it since the previous lockless
opportunistic checking.

Thanks.

-- 
tejun

      reply	other threads:[~2019-11-12 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11  7:37 [PATCH] iocost: treat as root level when parents are activated Jiufei Xue
2019-11-11 16:25 ` Tejun Heo
2019-11-12  1:38   ` Jiufei Xue
2019-11-12 15:31     ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191112153159.GD4163745@devbig004.ftw2.facebook.com \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=jiufei.xue@linux.alibaba.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox