summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2011-04-15 21:48:15 +0200
committerPekka Enberg <penberg@kernel.org>2011-04-17 13:03:20 +0200
commitdc1fb7f43636754a4d06f7bdb8ea3269a7d71d6d (patch)
tree85d7cd2cc81d89805b9d3cc3c0ec89b5f6c357f9 /mm
parentslub: Eliminate repeated use of c->page through a new page variable (diff)
downloadlinux-dc1fb7f43636754a4d06f7bdb8ea3269a7d71d6d.tar.xz
linux-dc1fb7f43636754a4d06f7bdb8ea3269a7d71d6d.zip
slub: Move node determination out of hotpath
If the node does not change then there is no need to recalculate the node from the page struct. So move the node determination into the places where we acquire a new slab page. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/slub.c b/mm/slub.c
index ab44368ed692..301360bc00c6 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1828,7 +1828,6 @@ load_freelist:
c->freelist = get_freepointer(s, object);
page->inuse = page->objects;
page->freelist = NULL;
- c->node = page_to_nid(page);
unlock_out:
slab_unlock(page);
@@ -1845,8 +1844,10 @@ another_slab:
new_slab:
page = get_partial(s, gfpflags, node);
if (page) {
- c->page = page;
stat(s, ALLOC_FROM_PARTIAL);
+load_from_page:
+ c->node = page_to_nid(page);
+ c->page = page;
goto load_freelist;
}
@@ -1867,8 +1868,8 @@ new_slab:
slab_lock(page);
__SetPageSlubFrozen(page);
- c->page = page;
- goto load_freelist;
+
+ goto load_from_page;
}
if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
slab_out_of_memory(s, gfpflags, node);