Commit 35926ff5fba8245bd1c6ac04155048f6f89232b1

Authored by Linus Torvalds
1 parent b612a05537

Revert "cpusets: randomize node rotor used in cpuset_mem_spread_node()"

This reverts commit 0ac0c0d0f837c499afd02a802f9cf52d3027fa3b, which
caused cross-architecture build problems for all the wrong reasons.
IA64 already added its own version of __node_random(), but the fact is,
there is nothing architectural about the function, and the original
commit was just badly done. Revert it, since no fix is forthcoming.

Requested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 5 changed files with 1 additions and 31 deletions Side-by-side Diff

... ... @@ -2,7 +2,6 @@
2 2 #include <linux/topology.h>
3 3 #include <linux/module.h>
4 4 #include <linux/bootmem.h>
5   -#include <linux/random.h>
6 5  
7 6 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
8 7 # define DBG(x...) printk(KERN_DEBUG x)
... ... @@ -66,20 +65,4 @@
66 65 }
67 66 EXPORT_SYMBOL(cpumask_of_node);
68 67 #endif
69   -
70   -/*
71   - * Return the bit number of a random bit set in the nodemask.
72   - * (returns -1 if nodemask is empty)
73   - */
74   -int __node_random(const nodemask_t *maskp)
75   -{
76   - int w, bit = -1;
77   -
78   - w = nodes_weight(*maskp);
79   - if (w)
80   - bit = bitmap_ord_to_pos(maskp->bits,
81   - get_random_int() % w, MAX_NUMNODES);
82   - return bit;
83   -}
84   -EXPORT_SYMBOL(__node_random);
include/linux/bitmap.h
... ... @@ -141,7 +141,6 @@
141 141 extern void bitmap_release_region(unsigned long *bitmap, int pos, int order);
142 142 extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
143 143 extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits);
144   -extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits);
145 144  
146 145 #define BITMAP_LAST_WORD_MASK(nbits) \
147 146 ( \
include/linux/nodemask.h
... ... @@ -66,8 +66,6 @@
66 66 * int num_online_nodes() Number of online Nodes
67 67 * int num_possible_nodes() Number of all possible Nodes
68 68 *
69   - * int node_random(mask) Random node with set bit in mask
70   - *
71 69 * int node_online(node) Is some node online?
72 70 * int node_possible(node) Is some node possible?
73 71 *
... ... @@ -432,10 +430,6 @@
432 430 node_clear_state(nid, N_ONLINE);
433 431 nr_online_nodes = num_node_state(N_ONLINE);
434 432 }
435   -
436   -#define node_random(mask) __node_random(&(mask))
437   -extern int __node_random(const nodemask_t *maskp);
438   -
439 433 #else
440 434  
441 435 static inline int node_state(int node, enum node_states state)
... ... @@ -466,8 +460,6 @@
466 460  
467 461 #define node_set_online(node) node_set_state((node), N_ONLINE)
468 462 #define node_set_offline(node) node_clear_state((node), N_ONLINE)
469   -
470   -static inline int node_random(const nodemask_t mask) { return 0; }
471 463 #endif
472 464  
473 465 #define node_online_map node_states[N_ONLINE]
... ... @@ -1086,10 +1086,6 @@
1086 1086 }
1087 1087 mpol_fix_fork_child_flag(p);
1088 1088 #endif
1089   -#ifdef CONFIG_CPUSETS
1090   - p->cpuset_mem_spread_rotor = node_random(p->mems_allowed);
1091   - p->cpuset_slab_spread_rotor = node_random(p->mems_allowed);
1092   -#endif
1093 1089 #ifdef CONFIG_TRACE_IRQFLAGS
1094 1090 p->irq_events = 0;
1095 1091 #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
... ... @@ -672,7 +672,7 @@
672 672 *
673 673 * The bit positions 0 through @bits are valid positions in @buf.
674 674 */
675   -int bitmap_ord_to_pos(const unsigned long *buf, int ord, int bits)
  675 +static int bitmap_ord_to_pos(const unsigned long *buf, int ord, int bits)
676 676 {
677 677 int pos = 0;
678 678