linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] don't forget to call pd_online_fn when activate policy
@ 2017-03-09  2:20 Zhou Chengming
  2017-03-10 12:44 ` kbuild test robot
  2017-03-10 15:12 ` Jens Axboe
  0 siblings, 2 replies; 5+ messages in thread
From: Zhou Chengming @ 2017-03-09  2:20 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, miaoxie, zhouchengming1

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 <zhouchengming1@huawei.com>
---
 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);
+		}
 	}
 
 	__set_bit(pol->plid, q->blkcg_pols);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] don't forget to call pd_online_fn when activate policy
  2017-03-09  2:20 [PATCH v2] don't forget to call pd_online_fn when activate policy Zhou Chengming
@ 2017-03-10 12:44 ` kbuild test robot
  2017-03-10 15:12 ` Jens Axboe
  1 sibling, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2017-03-10 12:44 UTC (permalink / raw)
  To: Zhou Chengming
  Cc: kbuild-all, axboe, linux-block, linux-kernel, miaoxie, zhouchengming1

[-- Attachment #1: Type: text/plain, Size: 2636 bytes --]

Hi Zhou,

[auto build test ERROR on block/for-next]
[also build test ERROR on v4.11-rc1 next-20170309]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Zhou-Chengming/don-t-forget-to-call-pd_online_fn-when-activate-policy/20170310-140301
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: x86_64-rhel-7.2 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   block/blk-cgroup.c: In function 'blkcg_activate_policy':
>> block/blk-cgroup.c:1261:14: error: incompatible type for argument 1 of 'spin_lock'
       spin_lock(blkg->blkcg->lock);
                 ^~~~
   In file included from include/linux/rcupdate.h:38:0,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:4,
                    from include/linux/sched.h:13,
                    from include/linux/ioprio.h:4,
                    from block/blk-cgroup.c:17:
   include/linux/spinlock.h:297:29: note: expected 'spinlock_t * {aka struct spinlock *}' but argument is of type 'spinlock_t {aka struct spinlock}'
    static __always_inline void spin_lock(spinlock_t *lock)
                                ^~~~~~~~~
>> block/blk-cgroup.c:1263:16: error: incompatible type for argument 1 of 'spin_unlock'
       spin_unlock(blkg->blkcg->lock);
                   ^~~~
   In file included from include/linux/rcupdate.h:38:0,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:4,
                    from include/linux/sched.h:13,
                    from include/linux/ioprio.h:4,
                    from block/blk-cgroup.c:17:
   include/linux/spinlock.h:337:29: note: expected 'spinlock_t * {aka struct spinlock *}' but argument is of type 'spinlock_t {aka struct spinlock}'
    static __always_inline void spin_unlock(spinlock_t *lock)
                                ^~~~~~~~~~~

vim +/spin_lock +1261 block/blk-cgroup.c

  1255			pd->blkg = blkg;
  1256			pd->plid = pol->plid;
  1257			if (pol->pd_init_fn)
  1258				pol->pd_init_fn(pd);
  1259	
  1260			if (pol->pd_online_fn) {
> 1261				spin_lock(blkg->blkcg->lock);
  1262				pol->pd_online_fn(pd);
> 1263				spin_unlock(blkg->blkcg->lock);
  1264			}
  1265		}
  1266	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38803 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] don't forget to call pd_online_fn when activate policy
  2017-03-09  2:20 [PATCH v2] don't forget to call pd_online_fn when activate policy Zhou Chengming
  2017-03-10 12:44 ` kbuild test robot
@ 2017-03-10 15:12 ` Jens Axboe
  2017-03-11  3:46   ` zhouchengming
  1 sibling, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2017-03-10 15:12 UTC (permalink / raw)
  To: Zhou Chengming; +Cc: linux-block, linux-kernel, miaoxie

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 <zhouchengming1@huawei.com>
> ---
>  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?

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] don't forget to call pd_online_fn when activate policy
  2017-03-10 15:12 ` Jens Axboe
@ 2017-03-11  3:46   ` zhouchengming
  2017-03-11  3:59     ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: zhouchengming @ 2017-03-11  3:46 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, miaoxie

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<zhouchengming1@huawei.com>
>> ---
>>   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..

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] don't forget to call pd_online_fn when activate policy
  2017-03-11  3:46   ` zhouchengming
@ 2017-03-11  3:59     ` Jens Axboe
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2017-03-11  3:59 UTC (permalink / raw)
  To: zhouchengming; +Cc: linux-block, linux-kernel, miaoxie


> On Mar 10, 2017, at 8:46 PM, zhouchengming <zhouchengming1@huawei.com> wro=
te:
>=20
>> 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.
>>>=20
>>> Signed-off-by: Zhou Chengming<zhouchengming1@huawei.com>
>>> ---
>>>  block/blk-cgroup.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>=20
>>> 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 =3D 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);
>>> +        }
>>=20
>> You didn't even compile this, did you?
>>=20
>=20
> 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. Alway=
s. Don't ever send untested patches again, and not even compiling is unforgi=
vable.=20

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-11  3:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09  2:20 [PATCH v2] don't forget to call pd_online_fn when activate policy Zhou Chengming
2017-03-10 12:44 ` kbuild test robot
2017-03-10 15:12 ` Jens Axboe
2017-03-11  3:46   ` zhouchengming
2017-03-11  3:59     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).