Skip to content

Commit 94ef030

Browse files
Sebastian Andrzej Siewiortehcaster
authored andcommitted
mm: slub: make object_map_lock a raw_spinlock_t
The variable object_map is protected by object_map_lock. The lock is always acquired in debug code and within already atomic context Make object_map_lock a raw_spinlock_t. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 5a836bf commit 94ef030

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mm/slub.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ static inline bool cmpxchg_double_slab(struct kmem_cache *s, struct page *page,
452452

453453
#ifdef CONFIG_SLUB_DEBUG
454454
static unsigned long object_map[BITS_TO_LONGS(MAX_OBJS_PER_PAGE)];
455-
static DEFINE_SPINLOCK(object_map_lock);
455+
static DEFINE_RAW_SPINLOCK(object_map_lock);
456456

457457
static void __fill_map(unsigned long *obj_map, struct kmem_cache *s,
458458
struct page *page)
@@ -497,7 +497,7 @@ static unsigned long *get_map(struct kmem_cache *s, struct page *page)
497497
{
498498
VM_BUG_ON(!irqs_disabled());
499499

500-
spin_lock(&object_map_lock);
500+
raw_spin_lock(&object_map_lock);
501501

502502
__fill_map(object_map, s, page);
503503

@@ -507,7 +507,7 @@ static unsigned long *get_map(struct kmem_cache *s, struct page *page)
507507
static void put_map(unsigned long *map) __releases(&object_map_lock)
508508
{
509509
VM_BUG_ON(map != object_map);
510-
spin_unlock(&object_map_lock);
510+
raw_spin_unlock(&object_map_lock);
511511
}
512512

513513
static inline unsigned int size_from_object(struct kmem_cache *s)

0 commit comments

Comments
 (0)