mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
percpu: make percpu symbols under kernel/ and mm/ unique
This patch updates percpu related symbols under kernel/ and mm/ such that percpu symbols are unique and don't clash with local symbols. This serves two purposes of decreasing the possibility of global percpu symbol collision and allowing dropping per_cpu__ prefix from percpu symbols. * kernel/lockdep.c: s/lock_stats/cpu_lock_stats/ * kernel/sched.c: s/init_rq_rt/init_rt_rq_var/ (any better idea?) s/sched_group_cpus/sched_groups/ * kernel/softirq.c: s/ksoftirqd/run_ksoftirqd/a * kernel/softlockup.c: s/(*)_timestamp/softlockup_\1_ts/ s/watchdog_task/softlockup_watchdog/ s/timestamp/ts/ for local variables * kernel/time/timer_stats: s/lookup_lock/tstats_lookup_lock/ * mm/slab.c: s/reap_work/slab_reap_work/ s/reap_node/slab_reap_node/ * mm/vmstat.c: local variable changed to avoid collision with vmstat_work Partly based on Rusty Russell's "alloc_percpu: rename percpu vars which cause name clashes" patch. Signed-off-by: Tejun Heo <[email protected]> Acked-by: (slab/vmstat) Christoph Lameter <[email protected]> Reviewed-by: Christoph Lameter <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Nick Piggin <[email protected]>
This commit is contained in:
parent
0f5e4816db
commit
1871e52c76
7 changed files with 57 additions and 56 deletions
18
mm/slab.c
18
mm/slab.c
|
|
@ -685,7 +685,7 @@ int slab_is_available(void)
|
|||
return g_cpucache_up >= EARLY;
|
||||
}
|
||||
|
||||
static DEFINE_PER_CPU(struct delayed_work, reap_work);
|
||||
static DEFINE_PER_CPU(struct delayed_work, slab_reap_work);
|
||||
|
||||
static inline struct array_cache *cpu_cache_get(struct kmem_cache *cachep)
|
||||
{
|
||||
|
|
@ -826,7 +826,7 @@ __setup("noaliencache", noaliencache_setup);
|
|||
* objects freed on different nodes from which they were allocated) and the
|
||||
* flushing of remote pcps by calling drain_node_pages.
|
||||
*/
|
||||
static DEFINE_PER_CPU(unsigned long, reap_node);
|
||||
static DEFINE_PER_CPU(unsigned long, slab_reap_node);
|
||||
|
||||
static void init_reap_node(int cpu)
|
||||
{
|
||||
|
|
@ -836,17 +836,17 @@ static void init_reap_node(int cpu)
|
|||
if (node == MAX_NUMNODES)
|
||||
node = first_node(node_online_map);
|
||||
|
||||
per_cpu(reap_node, cpu) = node;
|
||||
per_cpu(slab_reap_node, cpu) = node;
|
||||
}
|
||||
|
||||
static void next_reap_node(void)
|
||||
{
|
||||
int node = __get_cpu_var(reap_node);
|
||||
int node = __get_cpu_var(slab_reap_node);
|
||||
|
||||
node = next_node(node, node_online_map);
|
||||
if (unlikely(node >= MAX_NUMNODES))
|
||||
node = first_node(node_online_map);
|
||||
__get_cpu_var(reap_node) = node;
|
||||
__get_cpu_var(slab_reap_node) = node;
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
@ -863,7 +863,7 @@ static void next_reap_node(void)
|
|||
*/
|
||||
static void __cpuinit start_cpu_timer(int cpu)
|
||||
{
|
||||
struct delayed_work *reap_work = &per_cpu(reap_work, cpu);
|
||||
struct delayed_work *reap_work = &per_cpu(slab_reap_work, cpu);
|
||||
|
||||
/*
|
||||
* When this gets called from do_initcalls via cpucache_init(),
|
||||
|
|
@ -1027,7 +1027,7 @@ static void __drain_alien_cache(struct kmem_cache *cachep,
|
|||
*/
|
||||
static void reap_alien(struct kmem_cache *cachep, struct kmem_list3 *l3)
|
||||
{
|
||||
int node = __get_cpu_var(reap_node);
|
||||
int node = __get_cpu_var(slab_reap_node);
|
||||
|
||||
if (l3->alien) {
|
||||
struct array_cache *ac = l3->alien[node];
|
||||
|
|
@ -1286,9 +1286,9 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb,
|
|||
* anything expensive but will only modify reap_work
|
||||
* and reschedule the timer.
|
||||
*/
|
||||
cancel_rearming_delayed_work(&per_cpu(reap_work, cpu));
|
||||
cancel_rearming_delayed_work(&per_cpu(slab_reap_work, cpu));
|
||||
/* Now the cache_reaper is guaranteed to be not running. */
|
||||
per_cpu(reap_work, cpu).work.func = NULL;
|
||||
per_cpu(slab_reap_work, cpu).work.func = NULL;
|
||||
break;
|
||||
case CPU_DOWN_FAILED:
|
||||
case CPU_DOWN_FAILED_FROZEN:
|
||||
|
|
|
|||
Loading…
Reference in a new issue