Re: [PATCH V2 3/5] genirq/affinity: move actual irq vector spread into one helper

2018-03-08 Thread Ming Lei
On Tue, Mar 06, 2018 at 12:28:32AM +0800, kbuild test robot wrote:
> Hi Ming,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on tip/irq/core]
> [also build test WARNING on v4.16-rc4 next-20180305]
> [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/Ming-Lei/genirq-affinity-irq-vector-spread-among-online-CPUs-as-far-as-possible/20180305-184912
> config: i386-randconfig-a1-201809 (attached as .config)
> compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386 
> 
> All warnings (new ones prefixed by >>):
> 
>kernel/irq/affinity.c: In function 'irq_create_affinity_masks':
> >> kernel/irq/affinity.c:201:50: warning: passing argument 3 of 
> >> 'irq_build_affinity_masks' from incompatible pointer type
>  curvec += irq_build_affinity_masks(nvecs, affd, node_to_cpumask,
>  ^
>kernel/irq/affinity.c:97:12: note: expected 'const struct cpumask (*)[1]' 
> but argument is of type 'struct cpumask (*)[1]'
> static int irq_build_affinity_masks(int nvecs, const struct irq_affinity 
> *affd,

Looks this warning can only be triggered on ARCH=i386 with gcc-4.X.

Can't reproduce it when building on other ARCHs, and can't reproduce
it with gcc-6 too.


Thanks,
Ming


Re: [PATCH V2 3/5] genirq/affinity: move actual irq vector spread into one helper

2018-03-08 Thread Ming Lei
On Tue, Mar 06, 2018 at 12:28:32AM +0800, kbuild test robot wrote:
> Hi Ming,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on tip/irq/core]
> [also build test WARNING on v4.16-rc4 next-20180305]
> [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/Ming-Lei/genirq-affinity-irq-vector-spread-among-online-CPUs-as-far-as-possible/20180305-184912
> config: i386-randconfig-a1-201809 (attached as .config)
> compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386 
> 
> All warnings (new ones prefixed by >>):
> 
>kernel/irq/affinity.c: In function 'irq_create_affinity_masks':
> >> kernel/irq/affinity.c:201:50: warning: passing argument 3 of 
> >> 'irq_build_affinity_masks' from incompatible pointer type
>  curvec += irq_build_affinity_masks(nvecs, affd, node_to_cpumask,
>  ^
>kernel/irq/affinity.c:97:12: note: expected 'const struct cpumask (*)[1]' 
> but argument is of type 'struct cpumask (*)[1]'
> static int irq_build_affinity_masks(int nvecs, const struct irq_affinity 
> *affd,

Looks this warning can only be triggered on ARCH=i386 with gcc-4.X.

Can't reproduce it when building on other ARCHs, and can't reproduce
it with gcc-6 too.


Thanks,
Ming


Re: [PATCH V2 3/5] genirq/affinity: move actual irq vector spread into one helper

2018-03-07 Thread Christoph Hellwig
Can you fix this up and resend?

On Tue, Mar 06, 2018 at 12:28:32AM +0800, kbuild test robot wrote:
> Hi Ming,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on tip/irq/core]
> [also build test WARNING on v4.16-rc4 next-20180305]
> [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/Ming-Lei/genirq-affinity-irq-vector-spread-among-online-CPUs-as-far-as-possible/20180305-184912
> config: i386-randconfig-a1-201809 (attached as .config)
> compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386 
> 
> All warnings (new ones prefixed by >>):
> 
>kernel/irq/affinity.c: In function 'irq_create_affinity_masks':
> >> kernel/irq/affinity.c:201:50: warning: passing argument 3 of 
> >> 'irq_build_affinity_masks' from incompatible pointer type
>  curvec += irq_build_affinity_masks(nvecs, affd, node_to_cpumask,
>  ^
>kernel/irq/affinity.c:97:12: note: expected 'const struct cpumask (*)[1]' 
> but argument is of type 'struct cpumask (*)[1]'
> static int irq_build_affinity_masks(int nvecs, const struct irq_affinity 
> *affd,
>^
> 
> vim +/irq_build_affinity_masks +201 kernel/irq/affinity.c
> 
>161
>162/**
>163 * irq_create_affinity_masks - Create affinity masks for 
> multiqueue spreading
>164 * @nvecs:  The total number of vectors
>165 * @affd:   Description of the affinity requirements
>166 *
>167 * Returns the masks pointer or NULL if allocation failed.
>168 */
>169struct cpumask *
>170irq_create_affinity_masks(int nvecs, const struct irq_affinity 
> *affd)
>171{
>172int curvec;
>173struct cpumask *masks;
>174cpumask_var_t nmsk, *node_to_cpumask;
>175
>176/*
>177 * If there aren't any vectors left after applying the 
> pre/post
>178 * vectors don't bother with assigning affinity.
>179 */
>180if (nvecs == affd->pre_vectors + affd->post_vectors)
>181return NULL;
>182
>183if (!zalloc_cpumask_var(, GFP_KERNEL))
>184return NULL;
>185
>186masks = kcalloc(nvecs, sizeof(*masks), GFP_KERNEL);
>187if (!masks)
>188goto out;
>189
>190node_to_cpumask = alloc_node_to_cpumask();
>191if (!node_to_cpumask)
>192goto out;
>193
>194/* Fill out vectors at the beginning that don't need 
> affinity */
>195for (curvec = 0; curvec < affd->pre_vectors; curvec++)
>196cpumask_copy(masks + curvec, 
> irq_default_affinity);
>197
>198/* Stabilize the cpumasks */
>199get_online_cpus();
>200build_node_to_cpumask(node_to_cpumask);
>  > 201curvec += irq_build_affinity_masks(nvecs, affd, 
> node_to_cpumask,
>202   cpu_possible_mask, 
> nmsk, masks);
>203put_online_cpus();
>204
>205/* Fill out vectors at the end that don't need affinity 
> */
>206for (; curvec < nvecs; curvec++)
>207cpumask_copy(masks + curvec, 
> irq_default_affinity);
>208free_node_to_cpumask(node_to_cpumask);
>209out:
>210free_cpumask_var(nmsk);
>211return masks;
>212}
>213
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation


---end quoted text---


Re: [PATCH V2 3/5] genirq/affinity: move actual irq vector spread into one helper

2018-03-07 Thread Christoph Hellwig
Can you fix this up and resend?

On Tue, Mar 06, 2018 at 12:28:32AM +0800, kbuild test robot wrote:
> Hi Ming,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on tip/irq/core]
> [also build test WARNING on v4.16-rc4 next-20180305]
> [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/Ming-Lei/genirq-affinity-irq-vector-spread-among-online-CPUs-as-far-as-possible/20180305-184912
> config: i386-randconfig-a1-201809 (attached as .config)
> compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386 
> 
> All warnings (new ones prefixed by >>):
> 
>kernel/irq/affinity.c: In function 'irq_create_affinity_masks':
> >> kernel/irq/affinity.c:201:50: warning: passing argument 3 of 
> >> 'irq_build_affinity_masks' from incompatible pointer type
>  curvec += irq_build_affinity_masks(nvecs, affd, node_to_cpumask,
>  ^
>kernel/irq/affinity.c:97:12: note: expected 'const struct cpumask (*)[1]' 
> but argument is of type 'struct cpumask (*)[1]'
> static int irq_build_affinity_masks(int nvecs, const struct irq_affinity 
> *affd,
>^
> 
> vim +/irq_build_affinity_masks +201 kernel/irq/affinity.c
> 
>161
>162/**
>163 * irq_create_affinity_masks - Create affinity masks for 
> multiqueue spreading
>164 * @nvecs:  The total number of vectors
>165 * @affd:   Description of the affinity requirements
>166 *
>167 * Returns the masks pointer or NULL if allocation failed.
>168 */
>169struct cpumask *
>170irq_create_affinity_masks(int nvecs, const struct irq_affinity 
> *affd)
>171{
>172int curvec;
>173struct cpumask *masks;
>174cpumask_var_t nmsk, *node_to_cpumask;
>175
>176/*
>177 * If there aren't any vectors left after applying the 
> pre/post
>178 * vectors don't bother with assigning affinity.
>179 */
>180if (nvecs == affd->pre_vectors + affd->post_vectors)
>181return NULL;
>182
>183if (!zalloc_cpumask_var(, GFP_KERNEL))
>184return NULL;
>185
>186masks = kcalloc(nvecs, sizeof(*masks), GFP_KERNEL);
>187if (!masks)
>188goto out;
>189
>190node_to_cpumask = alloc_node_to_cpumask();
>191if (!node_to_cpumask)
>192goto out;
>193
>194/* Fill out vectors at the beginning that don't need 
> affinity */
>195for (curvec = 0; curvec < affd->pre_vectors; curvec++)
>196cpumask_copy(masks + curvec, 
> irq_default_affinity);
>197
>198/* Stabilize the cpumasks */
>199get_online_cpus();
>200build_node_to_cpumask(node_to_cpumask);
>  > 201curvec += irq_build_affinity_masks(nvecs, affd, 
> node_to_cpumask,
>202   cpu_possible_mask, 
> nmsk, masks);
>203put_online_cpus();
>204
>205/* Fill out vectors at the end that don't need affinity 
> */
>206for (; curvec < nvecs; curvec++)
>207cpumask_copy(masks + curvec, 
> irq_default_affinity);
>208free_node_to_cpumask(node_to_cpumask);
>209out:
>210free_cpumask_var(nmsk);
>211return masks;
>212}
>213
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation


---end quoted text---


Re: [PATCH V2 3/5] genirq/affinity: move actual irq vector spread into one helper

2018-03-05 Thread kbuild test robot
Hi Ming,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/irq/core]
[also build test WARNING on v4.16-rc4 next-20180305]
[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/Ming-Lei/genirq-affinity-irq-vector-spread-among-online-CPUs-as-far-as-possible/20180305-184912
config: i386-randconfig-a1-201809 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   kernel/irq/affinity.c: In function 'irq_create_affinity_masks':
>> kernel/irq/affinity.c:201:50: warning: passing argument 3 of 
>> 'irq_build_affinity_masks' from incompatible pointer type
 curvec += irq_build_affinity_masks(nvecs, affd, node_to_cpumask,
 ^
   kernel/irq/affinity.c:97:12: note: expected 'const struct cpumask (*)[1]' 
but argument is of type 'struct cpumask (*)[1]'
static int irq_build_affinity_masks(int nvecs, const struct irq_affinity 
*affd,
   ^

vim +/irq_build_affinity_masks +201 kernel/irq/affinity.c

   161  
   162  /**
   163   * irq_create_affinity_masks - Create affinity masks for multiqueue 
spreading
   164   * @nvecs:  The total number of vectors
   165   * @affd:   Description of the affinity requirements
   166   *
   167   * Returns the masks pointer or NULL if allocation failed.
   168   */
   169  struct cpumask *
   170  irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
   171  {
   172  int curvec;
   173  struct cpumask *masks;
   174  cpumask_var_t nmsk, *node_to_cpumask;
   175  
   176  /*
   177   * If there aren't any vectors left after applying the pre/post
   178   * vectors don't bother with assigning affinity.
   179   */
   180  if (nvecs == affd->pre_vectors + affd->post_vectors)
   181  return NULL;
   182  
   183  if (!zalloc_cpumask_var(, GFP_KERNEL))
   184  return NULL;
   185  
   186  masks = kcalloc(nvecs, sizeof(*masks), GFP_KERNEL);
   187  if (!masks)
   188  goto out;
   189  
   190  node_to_cpumask = alloc_node_to_cpumask();
   191  if (!node_to_cpumask)
   192  goto out;
   193  
   194  /* Fill out vectors at the beginning that don't need affinity */
   195  for (curvec = 0; curvec < affd->pre_vectors; curvec++)
   196  cpumask_copy(masks + curvec, irq_default_affinity);
   197  
   198  /* Stabilize the cpumasks */
   199  get_online_cpus();
   200  build_node_to_cpumask(node_to_cpumask);
 > 201  curvec += irq_build_affinity_masks(nvecs, affd, node_to_cpumask,
   202 cpu_possible_mask, nmsk, 
masks);
   203  put_online_cpus();
   204  
   205  /* Fill out vectors at the end that don't need affinity */
   206  for (; curvec < nvecs; curvec++)
   207  cpumask_copy(masks + curvec, irq_default_affinity);
   208  free_node_to_cpumask(node_to_cpumask);
   209  out:
   210  free_cpumask_var(nmsk);
   211  return masks;
   212  }
   213  

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


.config.gz
Description: application/gzip


Re: [PATCH V2 3/5] genirq/affinity: move actual irq vector spread into one helper

2018-03-05 Thread kbuild test robot
Hi Ming,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/irq/core]
[also build test WARNING on v4.16-rc4 next-20180305]
[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/Ming-Lei/genirq-affinity-irq-vector-spread-among-online-CPUs-as-far-as-possible/20180305-184912
config: i386-randconfig-a1-201809 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   kernel/irq/affinity.c: In function 'irq_create_affinity_masks':
>> kernel/irq/affinity.c:201:50: warning: passing argument 3 of 
>> 'irq_build_affinity_masks' from incompatible pointer type
 curvec += irq_build_affinity_masks(nvecs, affd, node_to_cpumask,
 ^
   kernel/irq/affinity.c:97:12: note: expected 'const struct cpumask (*)[1]' 
but argument is of type 'struct cpumask (*)[1]'
static int irq_build_affinity_masks(int nvecs, const struct irq_affinity 
*affd,
   ^

vim +/irq_build_affinity_masks +201 kernel/irq/affinity.c

   161  
   162  /**
   163   * irq_create_affinity_masks - Create affinity masks for multiqueue 
spreading
   164   * @nvecs:  The total number of vectors
   165   * @affd:   Description of the affinity requirements
   166   *
   167   * Returns the masks pointer or NULL if allocation failed.
   168   */
   169  struct cpumask *
   170  irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
   171  {
   172  int curvec;
   173  struct cpumask *masks;
   174  cpumask_var_t nmsk, *node_to_cpumask;
   175  
   176  /*
   177   * If there aren't any vectors left after applying the pre/post
   178   * vectors don't bother with assigning affinity.
   179   */
   180  if (nvecs == affd->pre_vectors + affd->post_vectors)
   181  return NULL;
   182  
   183  if (!zalloc_cpumask_var(, GFP_KERNEL))
   184  return NULL;
   185  
   186  masks = kcalloc(nvecs, sizeof(*masks), GFP_KERNEL);
   187  if (!masks)
   188  goto out;
   189  
   190  node_to_cpumask = alloc_node_to_cpumask();
   191  if (!node_to_cpumask)
   192  goto out;
   193  
   194  /* Fill out vectors at the beginning that don't need affinity */
   195  for (curvec = 0; curvec < affd->pre_vectors; curvec++)
   196  cpumask_copy(masks + curvec, irq_default_affinity);
   197  
   198  /* Stabilize the cpumasks */
   199  get_online_cpus();
   200  build_node_to_cpumask(node_to_cpumask);
 > 201  curvec += irq_build_affinity_masks(nvecs, affd, node_to_cpumask,
   202 cpu_possible_mask, nmsk, 
masks);
   203  put_online_cpus();
   204  
   205  /* Fill out vectors at the end that don't need affinity */
   206  for (; curvec < nvecs; curvec++)
   207  cpumask_copy(masks + curvec, irq_default_affinity);
   208  free_node_to_cpumask(node_to_cpumask);
   209  out:
   210  free_cpumask_var(nmsk);
   211  return masks;
   212  }
   213  

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


.config.gz
Description: application/gzip