File tree Expand file tree Collapse file tree 6 files changed +22
-6
lines changed Expand file tree Collapse file tree 6 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -2967,7 +2967,7 @@ static bool blk_mq_hctx_has_requests(struct blk_mq_hw_ctx *hctx)
2967
2967
static inline bool blk_mq_last_cpu_in_hctx (unsigned int cpu ,
2968
2968
struct blk_mq_hw_ctx * hctx )
2969
2969
{
2970
- if (cpumask_next_and ( -1 , hctx -> cpumask , cpu_online_mask ) != cpu )
2970
+ if (cpumask_first_and ( hctx -> cpumask , cpu_online_mask ) != cpu )
2971
2971
return false;
2972
2972
if (cpumask_next_and (cpu , hctx -> cpumask , cpu_online_mask ) < nr_cpu_ids )
2973
2973
return false;
Original file line number Diff line number Diff line change @@ -2101,7 +2101,7 @@ static void virtnet_set_affinity(struct virtnet_info *vi)
2101
2101
stragglers = num_cpu >= vi -> curr_queue_pairs ?
2102
2102
num_cpu % vi -> curr_queue_pairs :
2103
2103
0 ;
2104
- cpu = cpumask_next ( -1 , cpu_online_mask );
2104
+ cpu = cpumask_first ( cpu_online_mask );
2105
2105
2106
2106
for (i = 0 ; i < vi -> curr_queue_pairs ; i ++ ) {
2107
2107
group_size = stride + (i < stragglers ? 1 : 0 );
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ static int bman_portal_probe(struct platform_device *pdev)
155
155
}
156
156
157
157
spin_lock (& bman_lock );
158
- cpu = cpumask_next_zero ( -1 , & portal_cpus );
158
+ cpu = cpumask_first_zero ( & portal_cpus );
159
159
if (cpu >= nr_cpu_ids ) {
160
160
__bman_portals_probed = 1 ;
161
161
/* unassigned portal, skip init */
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ static int qman_portal_probe(struct platform_device *pdev)
248
248
pcfg -> pools = qm_get_pools_sdqcr ();
249
249
250
250
spin_lock (& qman_lock );
251
- cpu = cpumask_next_zero ( -1 , & portal_cpus );
251
+ cpu = cpumask_first_zero ( & portal_cpus );
252
252
if (cpu >= nr_cpu_ids ) {
253
253
__qman_portals_probed = 1 ;
254
254
/* unassigned portal, skip init */
Original file line number Diff line number Diff line change @@ -123,6 +123,11 @@ static inline unsigned int cpumask_first(const struct cpumask *srcp)
123
123
return 0 ;
124
124
}
125
125
126
+ static inline unsigned int cpumask_first_zero (const struct cpumask * srcp )
127
+ {
128
+ return 0 ;
129
+ }
130
+
126
131
static inline unsigned int cpumask_first_and (const struct cpumask * srcp1 ,
127
132
const struct cpumask * srcp2 )
128
133
{
@@ -201,6 +206,17 @@ static inline unsigned int cpumask_first(const struct cpumask *srcp)
201
206
return find_first_bit (cpumask_bits (srcp ), nr_cpumask_bits );
202
207
}
203
208
209
+ /**
210
+ * cpumask_first_zero - get the first unset cpu in a cpumask
211
+ * @srcp: the cpumask pointer
212
+ *
213
+ * Returns >= nr_cpu_ids if all cpus are set.
214
+ */
215
+ static inline unsigned int cpumask_first_zero (const struct cpumask * srcp )
216
+ {
217
+ return find_first_zero_bit (cpumask_bits (srcp ), nr_cpumask_bits );
218
+ }
219
+
204
220
/**
205
221
* cpumask_first_and - return the first cpu from *srcp1 & *srcp2
206
222
* @src1p: the first input
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ static void clocksource_verify_choose_cpus(void)
257
257
return ;
258
258
259
259
/* Make sure to select at least one CPU other than the current CPU. */
260
- cpu = cpumask_next ( -1 , cpu_online_mask );
260
+ cpu = cpumask_first ( cpu_online_mask );
261
261
if (cpu == smp_processor_id ())
262
262
cpu = cpumask_next (cpu , cpu_online_mask );
263
263
if (WARN_ON_ONCE (cpu >= nr_cpu_ids ))
@@ -279,7 +279,7 @@ static void clocksource_verify_choose_cpus(void)
279
279
cpu = prandom_u32 () % nr_cpu_ids ;
280
280
cpu = cpumask_next (cpu - 1 , cpu_online_mask );
281
281
if (cpu >= nr_cpu_ids )
282
- cpu = cpumask_next ( -1 , cpu_online_mask );
282
+ cpu = cpumask_first ( cpu_online_mask );
283
283
if (!WARN_ON_ONCE (cpu >= nr_cpu_ids ))
284
284
cpumask_set_cpu (cpu , & cpus_chosen );
285
285
}
You can’t perform that action at this time.
0 commit comments