diff options
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -641,6 +641,26 @@ static void init_node_lock_keys(int q) | |||
641 | } | 641 | } |
642 | } | 642 | } |
643 | 643 | ||
644 | static void on_slab_lock_classes_node(struct kmem_cache *cachep, int q) | ||
645 | { | ||
646 | struct kmem_list3 *l3; | ||
647 | l3 = cachep->nodelists[q]; | ||
648 | if (!l3) | ||
649 | return; | ||
650 | |||
651 | slab_set_lock_classes(cachep, &on_slab_l3_key, | ||
652 | &on_slab_alc_key, q); | ||
653 | } | ||
654 | |||
655 | static inline void on_slab_lock_classes(struct kmem_cache *cachep) | ||
656 | { | ||
657 | int node; | ||
658 | |||
659 | VM_BUG_ON(OFF_SLAB(cachep)); | ||
660 | for_each_node(node) | ||
661 | on_slab_lock_classes_node(cachep, node); | ||
662 | } | ||
663 | |||
644 | static inline void init_lock_keys(void) | 664 | static inline void init_lock_keys(void) |
645 | { | 665 | { |
646 | int node; | 666 | int node; |
@@ -657,6 +677,14 @@ static inline void init_lock_keys(void) | |||
657 | { | 677 | { |
658 | } | 678 | } |
659 | 679 | ||
680 | static inline void on_slab_lock_classes(struct kmem_cache *cachep) | ||
681 | { | ||
682 | } | ||
683 | |||
684 | static inline void on_slab_lock_classes_node(struct kmem_cache *cachep, int node) | ||
685 | { | ||
686 | } | ||
687 | |||
660 | static void slab_set_debugobj_lock_classes_node(struct kmem_cache *cachep, int node) | 688 | static void slab_set_debugobj_lock_classes_node(struct kmem_cache *cachep, int node) |
661 | { | 689 | { |
662 | } | 690 | } |
@@ -1385,6 +1413,9 @@ static int __cpuinit cpuup_prepare(long cpu) | |||
1385 | free_alien_cache(alien); | 1413 | free_alien_cache(alien); |
1386 | if (cachep->flags & SLAB_DEBUG_OBJECTS) | 1414 | if (cachep->flags & SLAB_DEBUG_OBJECTS) |
1387 | slab_set_debugobj_lock_classes_node(cachep, node); | 1415 | slab_set_debugobj_lock_classes_node(cachep, node); |
1416 | else if (!OFF_SLAB(cachep) && | ||
1417 | !(cachep->flags & SLAB_DESTROY_BY_RCU)) | ||
1418 | on_slab_lock_classes_node(cachep, node); | ||
1388 | } | 1419 | } |
1389 | init_node_lock_keys(node); | 1420 | init_node_lock_keys(node); |
1390 | 1421 | ||
@@ -2489,7 +2520,8 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) | |||
2489 | WARN_ON_ONCE(flags & SLAB_DESTROY_BY_RCU); | 2520 | WARN_ON_ONCE(flags & SLAB_DESTROY_BY_RCU); |
2490 | 2521 | ||
2491 | slab_set_debugobj_lock_classes(cachep); | 2522 | slab_set_debugobj_lock_classes(cachep); |
2492 | } | 2523 | } else if (!OFF_SLAB(cachep) && !(flags & SLAB_DESTROY_BY_RCU)) |
2524 | on_slab_lock_classes(cachep); | ||
2493 | 2525 | ||
2494 | return 0; | 2526 | return 0; |
2495 | } | 2527 | } |