diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -1970,7 +1970,7 @@ static DEFINE_PER_CPU(struct kmem_cache_cpu, | |||
1970 | kmem_cache_cpu)[NR_KMEM_CACHE_CPU]; | 1970 | kmem_cache_cpu)[NR_KMEM_CACHE_CPU]; |
1971 | 1971 | ||
1972 | static DEFINE_PER_CPU(struct kmem_cache_cpu *, kmem_cache_cpu_free); | 1972 | static DEFINE_PER_CPU(struct kmem_cache_cpu *, kmem_cache_cpu_free); |
1973 | static cpumask_t kmem_cach_cpu_free_init_once = CPU_MASK_NONE; | 1973 | static DECLARE_BITMAP(kmem_cach_cpu_free_init_once, CONFIG_NR_CPUS); |
1974 | 1974 | ||
1975 | static struct kmem_cache_cpu *alloc_kmem_cache_cpu(struct kmem_cache *s, | 1975 | static struct kmem_cache_cpu *alloc_kmem_cache_cpu(struct kmem_cache *s, |
1976 | int cpu, gfp_t flags) | 1976 | int cpu, gfp_t flags) |
@@ -2045,13 +2045,13 @@ static void init_alloc_cpu_cpu(int cpu) | |||
2045 | { | 2045 | { |
2046 | int i; | 2046 | int i; |
2047 | 2047 | ||
2048 | if (cpu_isset(cpu, kmem_cach_cpu_free_init_once)) | 2048 | if (cpumask_test_cpu(cpu, to_cpumask(kmem_cach_cpu_free_init_once))) |
2049 | return; | 2049 | return; |
2050 | 2050 | ||
2051 | for (i = NR_KMEM_CACHE_CPU - 1; i >= 0; i--) | 2051 | for (i = NR_KMEM_CACHE_CPU - 1; i >= 0; i--) |
2052 | free_kmem_cache_cpu(&per_cpu(kmem_cache_cpu, cpu)[i], cpu); | 2052 | free_kmem_cache_cpu(&per_cpu(kmem_cache_cpu, cpu)[i], cpu); |
2053 | 2053 | ||
2054 | cpu_set(cpu, kmem_cach_cpu_free_init_once); | 2054 | cpumask_set_cpu(cpu, to_cpumask(kmem_cach_cpu_free_init_once)); |
2055 | } | 2055 | } |
2056 | 2056 | ||
2057 | static void __init init_alloc_cpu(void) | 2057 | static void __init init_alloc_cpu(void) |
@@ -3451,7 +3451,7 @@ struct location { | |||
3451 | long max_time; | 3451 | long max_time; |
3452 | long min_pid; | 3452 | long min_pid; |
3453 | long max_pid; | 3453 | long max_pid; |
3454 | cpumask_t cpus; | 3454 | DECLARE_BITMAP(cpus, NR_CPUS); |
3455 | nodemask_t nodes; | 3455 | nodemask_t nodes; |
3456 | }; | 3456 | }; |
3457 | 3457 | ||
@@ -3526,7 +3526,8 @@ static int add_location(struct loc_track *t, struct kmem_cache *s, | |||
3526 | if (track->pid > l->max_pid) | 3526 | if (track->pid > l->max_pid) |
3527 | l->max_pid = track->pid; | 3527 | l->max_pid = track->pid; |
3528 | 3528 | ||
3529 | cpu_set(track->cpu, l->cpus); | 3529 | cpumask_set_cpu(track->cpu, |
3530 | to_cpumask(l->cpus)); | ||
3530 | } | 3531 | } |
3531 | node_set(page_to_nid(virt_to_page(track)), l->nodes); | 3532 | node_set(page_to_nid(virt_to_page(track)), l->nodes); |
3532 | return 1; | 3533 | return 1; |
@@ -3556,8 +3557,8 @@ static int add_location(struct loc_track *t, struct kmem_cache *s, | |||
3556 | l->max_time = age; | 3557 | l->max_time = age; |
3557 | l->min_pid = track->pid; | 3558 | l->min_pid = track->pid; |
3558 | l->max_pid = track->pid; | 3559 | l->max_pid = track->pid; |
3559 | cpus_clear(l->cpus); | 3560 | cpumask_clear(to_cpumask(l->cpus)); |
3560 | cpu_set(track->cpu, l->cpus); | 3561 | cpumask_set_cpu(track->cpu, to_cpumask(l->cpus)); |
3561 | nodes_clear(l->nodes); | 3562 | nodes_clear(l->nodes); |
3562 | node_set(page_to_nid(virt_to_page(track)), l->nodes); | 3563 | node_set(page_to_nid(virt_to_page(track)), l->nodes); |
3563 | return 1; | 3564 | return 1; |
@@ -3638,11 +3639,12 @@ static int list_locations(struct kmem_cache *s, char *buf, | |||
3638 | len += sprintf(buf + len, " pid=%ld", | 3639 | len += sprintf(buf + len, " pid=%ld", |
3639 | l->min_pid); | 3640 | l->min_pid); |
3640 | 3641 | ||
3641 | if (num_online_cpus() > 1 && !cpus_empty(l->cpus) && | 3642 | if (num_online_cpus() > 1 && |
3643 | !cpumask_empty(to_cpumask(l->cpus)) && | ||
3642 | len < PAGE_SIZE - 60) { | 3644 | len < PAGE_SIZE - 60) { |
3643 | len += sprintf(buf + len, " cpus="); | 3645 | len += sprintf(buf + len, " cpus="); |
3644 | len += cpulist_scnprintf(buf + len, PAGE_SIZE - len - 50, | 3646 | len += cpulist_scnprintf(buf + len, PAGE_SIZE - len - 50, |
3645 | &l->cpus); | 3647 | to_cpumask(l->cpus)); |
3646 | } | 3648 | } |
3647 | 3649 | ||
3648 | if (num_online_nodes() > 1 && !nodes_empty(l->nodes) && | 3650 | if (num_online_nodes() > 1 && !nodes_empty(l->nodes) && |