Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933653AbdCKDr4 (ORCPT ); Fri, 10 Mar 2017 22:47:56 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:3861 "EHLO dggrg02-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755175AbdCKDrr (ORCPT ); Fri, 10 Mar 2017 22:47:47 -0500 Message-ID: <58C3731B.1050200@huawei.com> Date: Sat, 11 Mar 2017 11:46:35 +0800 From: zhouchengming User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Jens Axboe CC: , , Subject: Re: [PATCH v2] don't forget to call pd_online_fn when activate policy References: <1489026008-161611-1-git-send-email-zhouchengming1@huawei.com> <54047101-8ad6-a4fd-dda6-25c2551a3a3c@kernel.dk> In-Reply-To: <54047101-8ad6-a4fd-dda6-25c2551a3a3c@kernel.dk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.236.183] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0206.58C3732D.00CF,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a5caee0be1efbc6c6e1755409019b5d7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1087 Lines: 31 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..