diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-20 13:19:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-20 13:19:03 -0400 |
commit | 6496edfce95f943e1da43631c2f437509e56af7f (patch) | |
tree | 6b6e3b6bcc74c038b707a2facf45ee98fd61544e /lib | |
parent | b19a42e3cb9e73cad59e60ab7403e5afe7f4b262 (diff) | |
parent | e4afa120c98252e44390067c3a6cc775cde30659 (diff) |
Merge tag 'cpumask-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull final removal of deprecated cpus_* cpumask functions from Rusty Russell:
"This is the final removal (after several years!) of the obsolete
cpus_* functions, prompted by their mis-use in staging.
With these function removed, all cpu functions should only iterate to
nr_cpu_ids, so we finally only allocate that many bits when cpumasks
are allocated offstack"
* tag 'cpumask-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (25 commits)
cpumask: remove __first_cpu / __next_cpu
cpumask: resurrect CPU_MASK_CPU0
linux/cpumask.h: add typechecking to cpumask_test_cpu
cpumask: only allocate nr_cpumask_bits.
Fix weird uses of num_online_cpus().
cpumask: remove deprecated functions.
mips: fix obsolete cpumask_of_cpu usage.
x86: fix more deprecated cpu function usage.
ia64: remove deprecated cpus_ usage.
powerpc: fix deprecated CPU_MASK_CPU0 usage.
CPU_MASK_ALL/CPU_MASK_NONE: remove from deprecated region.
staging/lustre/o2iblnd: Don't use cpus_weight
staging/lustre/libcfs: replace deprecated cpus_ calls with cpumask_
staging/lustre/ptlrpc: Do not use deprecated cpus_* functions
blackfin: fix up obsolete cpu function usage.
parisc: fix up obsolete cpu function usage.
tile: fix up obsolete cpu function usage.
arm64: fix up obsolete cpu function usage.
mips: fix up obsolete cpu function usage.
x86: fix up obsolete cpu function usage.
...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig | 4 | ||||
-rw-r--r-- | lib/cpumask.c | 28 |
2 files changed, 0 insertions, 32 deletions
diff --git a/lib/Kconfig b/lib/Kconfig index f5440221d929..601965a948e8 100644 --- a/lib/Kconfig +++ b/lib/Kconfig | |||
@@ -396,10 +396,6 @@ config CPUMASK_OFFSTACK | |||
396 | them on the stack. This is a bit more expensive, but avoids | 396 | them on the stack. This is a bit more expensive, but avoids |
397 | stack overflow. | 397 | stack overflow. |
398 | 398 | ||
399 | config DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
400 | bool "Disable obsolete cpumask functions" if DEBUG_PER_CPU_MAPS | ||
401 | depends on BROKEN | ||
402 | |||
403 | config CPU_RMAP | 399 | config CPU_RMAP |
404 | bool | 400 | bool |
405 | depends on SMP | 401 | depends on SMP |
diff --git a/lib/cpumask.c b/lib/cpumask.c index 5ab1553fd076..830dd5dec40f 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c | |||
@@ -5,27 +5,6 @@ | |||
5 | #include <linux/export.h> | 5 | #include <linux/export.h> |
6 | #include <linux/bootmem.h> | 6 | #include <linux/bootmem.h> |
7 | 7 | ||
8 | int __first_cpu(const cpumask_t *srcp) | ||
9 | { | ||
10 | return min_t(int, NR_CPUS, find_first_bit(srcp->bits, NR_CPUS)); | ||
11 | } | ||
12 | EXPORT_SYMBOL(__first_cpu); | ||
13 | |||
14 | int __next_cpu(int n, const cpumask_t *srcp) | ||
15 | { | ||
16 | return min_t(int, NR_CPUS, find_next_bit(srcp->bits, NR_CPUS, n+1)); | ||
17 | } | ||
18 | EXPORT_SYMBOL(__next_cpu); | ||
19 | |||
20 | #if NR_CPUS > 64 | ||
21 | int __next_cpu_nr(int n, const cpumask_t *srcp) | ||
22 | { | ||
23 | return min_t(int, nr_cpu_ids, | ||
24 | find_next_bit(srcp->bits, nr_cpu_ids, n+1)); | ||
25 | } | ||
26 | EXPORT_SYMBOL(__next_cpu_nr); | ||
27 | #endif | ||
28 | |||
29 | /** | 8 | /** |
30 | * cpumask_next_and - get the next cpu in *src1p & *src2p | 9 | * cpumask_next_and - get the next cpu in *src1p & *src2p |
31 | * @n: the cpu prior to the place to search (ie. return will be > @n) | 10 | * @n: the cpu prior to the place to search (ie. return will be > @n) |
@@ -90,13 +69,6 @@ bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node) | |||
90 | dump_stack(); | 69 | dump_stack(); |
91 | } | 70 | } |
92 | #endif | 71 | #endif |
93 | /* FIXME: Bandaid to save us from old primitives which go to NR_CPUS. */ | ||
94 | if (*mask) { | ||
95 | unsigned char *ptr = (unsigned char *)cpumask_bits(*mask); | ||
96 | unsigned int tail; | ||
97 | tail = BITS_TO_LONGS(NR_CPUS - nr_cpumask_bits) * sizeof(long); | ||
98 | memset(ptr + cpumask_size() - tail, 0, tail); | ||
99 | } | ||
100 | 72 | ||
101 | return *mask != NULL; | 73 | return *mask != NULL; |
102 | } | 74 | } |