lkml.org 
[lkml]   [2020]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch v2 3/3] net: Restrict receive packets queuing to housekeeping CPUs
On Mon, Jun 22, 2020 at 07:45:10PM -0400, Nitesh Narayan Lal wrote:
> @@ -756,6 +757,13 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue,
> return err;
> }
>
> + hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
> + cpumask_and(mask, mask, housekeeping_cpumask(hk_flags));
> + if (cpumask_weight(mask) == 0) {

We have cpumask_empty() for that, which is a much more efficient way of
testing the same.

> + free_cpumask_var(mask);
> + return -EINVAL;
> + }
> +
> map = kzalloc(max_t(unsigned int,
> RPS_MAP_SIZE(cpumask_weight(mask)), L1_CACHE_BYTES),
> GFP_KERNEL);
> --
> 2.18.4
>

\
 
 \ /
  Last update: 2020-06-23 11:25    [W:0.083 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site