Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319554
b: refs/heads/master
c: c17dda4
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Jun 1, 2012
1 parent a8f624e commit f4812b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 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: ec3ab083a7a004282ee374bdaeb0aa603521b8eb
refs/heads/master: c17dda40a6a4ed95f035db38b7ba4fab0d99da44
24 changes: 12 additions & 12 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,14 +1729,12 @@ void init_kmem_cache_cpus(struct kmem_cache *s)
/*
* Remove the cpu slab
*/
static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
static void deactivate_slab(struct kmem_cache *s, struct page *page, void *freelist)
{
enum slab_modes { M_NONE, M_PARTIAL, M_FULL, M_FREE };
struct page *page = c->page;
struct kmem_cache_node *n = get_node(s, page_to_nid(page));
int lock = 0;
enum slab_modes l = M_NONE, m = M_NONE;
void *freelist;
void *nextfree;
int tail = DEACTIVATE_TO_HEAD;
struct page new;
Expand All @@ -1747,11 +1745,6 @@ static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
tail = DEACTIVATE_TO_TAIL;
}

c->tid = next_tid(c->tid);
c->page = NULL;
freelist = c->freelist;
c->freelist = NULL;

/*
* Stage one: Free all available per cpu objects back
* to the page freelist while it is still frozen. Leave the
Expand Down Expand Up @@ -2009,7 +2002,11 @@ int put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
{
stat(s, CPUSLAB_FLUSH);
deactivate_slab(s, c);
deactivate_slab(s, c->page, c->freelist);

c->tid = next_tid(c->tid);
c->page = NULL;
c->freelist = NULL;
}

/*
Expand Down Expand Up @@ -2229,7 +2226,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,

if (unlikely(!node_match(c, node))) {
stat(s, ALLOC_NODE_MISMATCH);
deactivate_slab(s, c);
deactivate_slab(s, c->page, c->freelist);
c->page = NULL;
c->freelist = NULL;
goto new_slab;
}

Expand Down Expand Up @@ -2289,8 +2288,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
if (!alloc_debug_processing(s, c->page, freelist, addr))
goto new_slab; /* Slab failed checks. Next slab needed */

c->freelist = get_freepointer(s, freelist);
deactivate_slab(s, c);
deactivate_slab(s, c->page, get_freepointer(s, freelist));
c->page = NULL;
c->freelist = NULL;
local_irq_restore(flags);
return freelist;
}
Expand Down

0 comments on commit f4812b0

Please sign in to comment.