Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32529
b: refs/heads/master
c: f1aaee5
h: refs/heads/master
i:
  32527: bbcc438
v: v3
  • Loading branch information
Arjan van de Ven authored and Linus Torvalds committed Jul 13, 2006
1 parent 155f621 commit 2927f5c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 873623dfabaa6ebbdc1ce16c1766a3c0ec5d9923
refs/heads/master: f1aaee53f2877a7afa55e8245c241ff60a86367d
32 changes: 32 additions & 0 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,37 @@ static struct kmem_cache cache_cache = {
#endif
};

#ifdef CONFIG_LOCKDEP

/*
* Slab sometimes uses the kmalloc slabs to store the slab headers
* for other slabs "off slab".
* The locking for this is tricky in that it nests within the locks
* of all other slabs in a few places; to deal with this special
* locking we put on-slab caches into a separate lock-class.
*/
static struct lock_class_key on_slab_key;

static inline void init_lock_keys(struct cache_sizes *s)
{
int q;

for (q = 0; q < MAX_NUMNODES; q++) {
if (!s->cs_cachep->nodelists[q] || OFF_SLAB(s->cs_cachep))
continue;
lockdep_set_class(&s->cs_cachep->nodelists[q]->list_lock,
&on_slab_key);
}
}

#else
static inline void init_lock_keys(struct cache_sizes *s)
{
}
#endif



/* Guard access to the cache-chain. */
static DEFINE_MUTEX(cache_chain_mutex);
static struct list_head cache_chain;
Expand Down Expand Up @@ -1391,6 +1422,7 @@ void __init kmem_cache_init(void)
ARCH_KMALLOC_FLAGS|SLAB_PANIC,
NULL, NULL);
}
init_lock_keys(sizes);

sizes->cs_dmacachep = kmem_cache_create(names->name_dma,
sizes->cs_size,
Expand Down

0 comments on commit 2927f5c

Please sign in to comment.