Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933701AbdCKD74 (ORCPT ); Fri, 10 Mar 2017 22:59:56 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:36281 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932614AbdCKD7r (ORCPT ); Fri, 10 Mar 2017 22:59:47 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v2] don't forget to call pd_online_fn when activate policy From: Jens Axboe X-Mailer: iPhone Mail (14E5269a) In-Reply-To: <58C3731B.1050200@huawei.com> Date: Fri, 10 Mar 2017 20:59:42 -0700 Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, miaoxie@huawei.com Message-Id: References: <1489026008-161611-1-git-send-email-zhouchengming1@huawei.com> <54047101-8ad6-a4fd-dda6-25c2551a3a3c@kernel.dk> <58C3731B.1050200@huawei.com> To: zhouchengming Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v2B40CE4024004 Content-Length: 1430 Lines: 38 > On Mar 10, 2017, at 8:46 PM, zhouchengming wrote: > >> On 2017/3/10 23:12, Jens Axboe wrote: >>> On 03/08/2017 07:20 PM, Zhou Chengming wrote: >>> When we activate policy on the request_queue, we will create policy_date >>> for all the existing blkgs of the request_queue, so we should call >>> pd_init_fn() and pd_online_fn() on these newly created policy_data. >>> >>> Signed-off-by: Zhou Chengming >>> --- >>> block/blk-cgroup.c | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c >>> index 8ba0af7..0dd9e76 100644 >>> --- a/block/blk-cgroup.c >>> +++ b/block/blk-cgroup.c >>> @@ -1254,6 +1254,12 @@ int blkcg_activate_policy(struct request_queue *q, >>> pd->plid = pol->plid; >>> if (pol->pd_init_fn) >>> pol->pd_init_fn(pd); >>> + >>> + if (pol->pd_online_fn) { >>> + spin_lock(blkg->blkcg->lock); >>> + pol->pd_online_fn(pd); >>> + spin_unlock(blkg->blkcg->lock); >>> + } >> >> You didn't even compile this, did you? >> > > Sorry for my carelessness. It's a very minor change, so I didn't compile... > I will send a patch-v3 that I have compiled. Sorry again.. I don't care how trivial it seems. You always ALWAYS compile and test. Always. Don't ever send untested patches again, and not even compiling is unforgivable.