Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'bitmap-6.0-rc2' of https://github.com/norov/linux

Pull bitmap updates from Yury Norov:
"cpumask: UP optimisation fixes follow-up

As an older version of the UP optimisation fixes was merged, not all
review feedback has been implemented.

This implements the feedback received on the merged version [1], and
the respin [2], for changes related to <linux/cpumask.h> and
lib/cpumask.c"

Link: https://lore.kernel.org/lkml/cover.1656777646.git.sander@svanheule.net/ [1]
Link: https://lore.kernel.org/lkml/cover.1659077534.git.sander@svanheule.net/ [2]

It spent for more than a week with no issues.

* tag 'bitmap-6.0-rc2' of https://github.com/norov/linux:
lib/cpumask: drop always-true preprocessor guard
lib/cpumask: add inline cpumask_next_wrap() for UP
cpumask: align signatures of UP implementations

+25 -6
+23 -3
include/linux/cpumask.h
··· 202 202 return 0; 203 203 } 204 204 205 - static inline int cpumask_any_and_distribute(const struct cpumask *src1p, 206 - const struct cpumask *src2p) { 205 + static inline unsigned int cpumask_any_and_distribute(const struct cpumask *src1p, 206 + const struct cpumask *src2p) 207 + { 207 208 return cpumask_first_and(src1p, src2p); 208 209 } 209 210 210 - static inline int cpumask_any_distribute(const struct cpumask *srcp) 211 + static inline unsigned int cpumask_any_distribute(const struct cpumask *srcp) 211 212 { 212 213 return cpumask_first(srcp); 213 214 } ··· 262 261 (cpu) = cpumask_next_zero((cpu), (mask)), \ 263 262 (cpu) < nr_cpu_ids;) 264 263 264 + #if NR_CPUS == 1 265 + static inline 266 + unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap) 267 + { 268 + cpumask_check(start); 269 + if (n != -1) 270 + cpumask_check(n); 271 + 272 + /* 273 + * Return the first available CPU when wrapping, or when starting before cpu0, 274 + * since there is only one valid option. 275 + */ 276 + if (wrap && n >= 0) 277 + return nr_cpumask_bits; 278 + 279 + return cpumask_first(mask); 280 + } 281 + #else 265 282 unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap); 283 + #endif 266 284 267 285 /** 268 286 * for_each_cpu_wrap - iterate over every cpu in a mask, starting at a specified location
+2 -1
lib/Makefile
··· 34 34 is_single_threaded.o plist.o decompress.o kobject_uevent.o \ 35 35 earlycpio.o seq_buf.o siphash.o dec_and_lock.o \ 36 36 nmi_backtrace.o win_minmax.o memcat_p.o \ 37 - buildid.o cpumask.o 37 + buildid.o 38 38 39 39 lib-$(CONFIG_PRINTK) += dump_stack.o 40 + lib-$(CONFIG_SMP) += cpumask.o 40 41 41 42 lib-y += kobject.o klist.o 42 43 obj-y += lockref.o
-2
lib/cpumask.c
··· 109 109 } 110 110 #endif 111 111 112 - #if NR_CPUS > 1 113 112 /** 114 113 * cpumask_local_spread - select the i'th cpu with local numa cpu's first 115 114 * @i: index number ··· 196 197 return next; 197 198 } 198 199 EXPORT_SYMBOL(cpumask_any_distribute); 199 - #endif /* NR_CPUS */