cpumask: replace cpumask_next_* with cpumask_first_* where appropriate
cpumask_first() is a more effective analogue of 'next' version if n == -1 (which means start == 0). This patch replaces 'next' with 'first' where things look trivial. There's no cpumask_first_zero() function, so create it. Signed-off-by: Yury Norov <yury.norov@gmail.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
This commit is contained in:
@@ -2101,7 +2101,7 @@ static void virtnet_set_affinity(struct virtnet_info *vi)
|
||||
stragglers = num_cpu >= vi->curr_queue_pairs ?
|
||||
num_cpu % vi->curr_queue_pairs :
|
||||
0;
|
||||
cpu = cpumask_next(-1, cpu_online_mask);
|
||||
cpu = cpumask_first(cpu_online_mask);
|
||||
|
||||
for (i = 0; i < vi->curr_queue_pairs; i++) {
|
||||
group_size = stride + (i < stragglers ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user