aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 4fac7bbb029a..509e96f411fc 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2001,7 +2001,7 @@ static DEFINE_PER_CPU(struct kmem_cache_cpu,
2001 kmem_cache_cpu)[NR_KMEM_CACHE_CPU]; 2001 kmem_cache_cpu)[NR_KMEM_CACHE_CPU];
2002 2002
2003static DEFINE_PER_CPU(struct kmem_cache_cpu *, kmem_cache_cpu_free); 2003static DEFINE_PER_CPU(struct kmem_cache_cpu *, kmem_cache_cpu_free);
2004static cpumask_t kmem_cach_cpu_free_init_once = CPU_MASK_NONE; 2004static DECLARE_BITMAP(kmem_cach_cpu_free_init_once, CONFIG_NR_CPUS);
2005 2005
2006static struct kmem_cache_cpu *alloc_kmem_cache_cpu(struct kmem_cache *s, 2006static struct kmem_cache_cpu *alloc_kmem_cache_cpu(struct kmem_cache *s,
2007 int cpu, gfp_t flags) 2007 int cpu, gfp_t flags)
@@ -2076,13 +2076,13 @@ static void init_alloc_cpu_cpu(int cpu)
2076{ 2076{
2077 int i; 2077 int i;
2078 2078
2079 if (cpu_isset(cpu, kmem_cach_cpu_free_init_once)) 2079 if (cpumask_test_cpu(cpu, to_cpumask(kmem_cach_cpu_free_init_once)))
2080 return; 2080 return;
2081 2081
2082 for (i = NR_KMEM_CACHE_CPU - 1; i >= 0; i--) 2082 for (i = NR_KMEM_CACHE_CPU - 1; i >= 0; i--)
2083 free_kmem_cache_cpu(&per_cpu(kmem_cache_cpu, cpu)[i], cpu); 2083 free_kmem_cache_cpu(&per_cpu(kmem_cache_cpu, cpu)[i], cpu);
2084 2084
2085 cpu_set(cpu, kmem_cach_cpu_free_init_once); 2085 cpumask_set_cpu(cpu, to_cpumask(kmem_cach_cpu_free_init_once));
2086} 2086}
2087 2087
2088static void __init init_alloc_cpu(void) 2088static void __init init_alloc_cpu(void)
@@ -3518,7 +3518,7 @@ struct location {
3518 long max_time; 3518 long max_time;
3519 long min_pid; 3519 long min_pid;
3520 long max_pid; 3520 long max_pid;
3521 cpumask_t cpus; 3521 DECLARE_BITMAP(cpus, NR_CPUS);
3522 nodemask_t nodes; 3522 nodemask_t nodes;
3523}; 3523};
3524 3524
@@ -3593,7 +3593,8 @@ static int add_location(struct loc_track *t, struct kmem_cache *s,
3593 if (track->pid > l->max_pid) 3593 if (track->pid > l->max_pid)
3594 l->max_pid = track->pid; 3594 l->max_pid = track->pid;
3595 3595
3596 cpu_set(track->cpu, l->cpus); 3596 cpumask_set_cpu(track->cpu,
3597 to_cpumask(l->cpus));
3597 } 3598 }
3598 node_set(page_to_nid(virt_to_page(track)), l->nodes); 3599 node_set(page_to_nid(virt_to_page(track)), l->nodes);
3599 return 1; 3600 return 1;
@@ -3623,8 +3624,8 @@ static int add_location(struct loc_track *t, struct kmem_cache *s,
3623 l->max_time = age; 3624 l->max_time = age;
3624 l->min_pid = track->pid; 3625 l->min_pid = track->pid;
3625 l->max_pid = track->pid; 3626 l->max_pid = track->pid;
3626 cpus_clear(l->cpus); 3627 cpumask_clear(to_cpumask(l->cpus));
3627 cpu_set(track->cpu, l->cpus); 3628 cpumask_set_cpu(track->cpu, to_cpumask(l->cpus));
3628 nodes_clear(l->nodes); 3629 nodes_clear(l->nodes);
3629 node_set(page_to_nid(virt_to_page(track)), l->nodes); 3630 node_set(page_to_nid(virt_to_page(track)), l->nodes);
3630 return 1; 3631 return 1;
@@ -3705,11 +3706,12 @@ static int list_locations(struct kmem_cache *s, char *buf,
3705 len += sprintf(buf + len, " pid=%ld", 3706 len += sprintf(buf + len, " pid=%ld",
3706 l->min_pid); 3707 l->min_pid);
3707 3708
3708 if (num_online_cpus() > 1 && !cpus_empty(l->cpus) && 3709 if (num_online_cpus() > 1 &&
3710 !cpumask_empty(to_cpumask(l->cpus)) &&
3709 len < PAGE_SIZE - 60) { 3711 len < PAGE_SIZE - 60) {
3710 len += sprintf(buf + len, " cpus="); 3712 len += sprintf(buf + len, " cpus=");
3711 len += cpulist_scnprintf(buf + len, PAGE_SIZE - len - 50, 3713 len += cpulist_scnprintf(buf + len, PAGE_SIZE - len - 50,
3712 l->cpus); 3714 to_cpumask(l->cpus));
3713 } 3715 }
3714 3716
3715 if (num_online_nodes() > 1 && !nodes_empty(l->nodes) && 3717 if (num_online_nodes() > 1 && !nodes_empty(l->nodes) &&