Skip to contentSkip to conversation

slab: make kmem_cache_node's list_lock conditionally raw

PATCH In review Paul Gortmaker 2 participants 2 messages Oct 8, 2013 – Oct 11, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 slab: make kmem_cache_node's list_lock conditionally raw

The RT patch "mm-disable-slab-on-rt.patch" unconditionally converts kmem_cache_node's list_lock into a raw lock. As of mainline commit ca34956b804b7554fc4e88826773380d9d5122a8 ("slab: Common definition for kmem_cache_node") the definition is shared -- but slab.c still thinks the lock is non raw.

At the moment SLAB depends on !RT_FULL, however with the lock being raw for !RT_FULL, we can't build the SLAB + !RT_FULL combination because of the above. So only convert the lock if SLAB is not enabled.

---

[Should be squished into mm-disable-slab-on-rt.patch ]

 mm/slab.h | 4 ++++
 1 file changed, 4 insertions(+)
mm/slab.h +4 -0
index 2e6c8b7..fc3c097 100644
@@ -247,7 +247,11 @@ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x)
  * The slab lists for all objects.
  */
 struct kmem_cache_node {
+#ifdef CONFIG_SLAB
+	spinlock_t list_lock;
+#else
 	raw_spinlock_t list_lock;
+#endif
 
 #ifdef CONFIG_SLAB
 	struct list_head slabs_partial;	/* partial list first, better asm code */
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 6 lines · * Paul Gortmaker | 2013-10-08 14:55:09 [-0400]:

The RT patch "mm-disable-slab-on-rt.patch" unconditionally converts kmem_cache_node's list_lock into a raw lock. As of mainline commit ca34956b804b7554fc4e88826773380d9d5122a8 ("slab: Common definition for kmem_cache_node") the definition is shared -- but slab.c still thinks the lock is non raw.

Quoted 6 lines

At the moment SLAB depends on !RT_FULL, however with the lock being raw for !RT_FULL, we can't build the SLAB + !RT_FULL combination because of the above. So only convert the lock if SLAB is not enabled.

Thank you for the 5 patches, all applied.

Sebastian