Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319567
b: refs/heads/master
c: 43d7786
h: refs/heads/master
i:
  319565: 2a1579d
  319563: 31ee43d
  319559: 6b44df2
  319551: e58ddfe
v: v3
  • Loading branch information
Joonsoo Kim authored and Pekka Enberg committed Jun 20, 2012
1 parent 242581d commit 368bc4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d24ac77f71ded6a013bacb09f359eac0b0f29a80
refs/heads/master: 43d77867a4f333de4e4189114c480dd365133c09
48 changes: 14 additions & 34 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,18 +1879,24 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, void *freel
*/
static void unfreeze_partials(struct kmem_cache *s)
{
struct kmem_cache_node *n = NULL;
struct kmem_cache_node *n = NULL, *n2 = NULL;
struct kmem_cache_cpu *c = this_cpu_ptr(s->cpu_slab);
struct page *page, *discard_page = NULL;

while ((page = c->partial)) {
enum slab_modes { M_PARTIAL, M_FREE };
enum slab_modes l, m;
struct page new;
struct page old;

c->partial = page->next;
l = M_FREE;

n2 = get_node(s, page_to_nid(page));
if (n != n2) {
if (n)
spin_unlock(&n->list_lock);

n = n2;
spin_lock(&n->list_lock);
}

do {

Expand All @@ -1903,43 +1909,17 @@ static void unfreeze_partials(struct kmem_cache *s)

new.frozen = 0;

if (!new.inuse && (!n || n->nr_partial > s->min_partial))
m = M_FREE;
else {
struct kmem_cache_node *n2 = get_node(s,
page_to_nid(page));

m = M_PARTIAL;
if (n != n2) {
if (n)
spin_unlock(&n->list_lock);

n = n2;
spin_lock(&n->list_lock);
}
}

if (l != m) {
if (l == M_PARTIAL) {
remove_partial(n, page);
stat(s, FREE_REMOVE_PARTIAL);
} else {
add_partial(n, page,
DEACTIVATE_TO_TAIL);
stat(s, FREE_ADD_PARTIAL);
}

l = m;
}

} while (!__cmpxchg_double_slab(s, page,
old.freelist, old.counters,
new.freelist, new.counters,
"unfreezing slab"));

if (m == M_FREE) {
if (unlikely(!new.inuse && n->nr_partial > s->min_partial)) {
page->next = discard_page;
discard_page = page;
} else {
add_partial(n, page, DEACTIVATE_TO_TAIL);
stat(s, FREE_ADD_PARTIAL);
}
}

Expand Down

0 comments on commit 368bc4d

Please sign in to comment.