aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2011-04-15 15:48:15 -0400
committerPekka Enberg <penberg@kernel.org>2011-04-17 07:03:20 -0400
commitdc1fb7f43636754a4d06f7bdb8ea3269a7d71d6d (patch)
tree85d7cd2cc81d89805b9d3cc3c0ec89b5f6c357f9 /mm/slub.c
parent01ad8a7bc226ddbbf90e4c15167d9e31a8d02930 (diff)
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/slub.c')
-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:
1828 c->freelist = get_freepointer(s, object); 1828 c->freelist = get_freepointer(s, object);
1829 page->inuse = page->objects; 1829 page->inuse = page->objects;
1830 page->freelist = NULL; 1830 page->freelist = NULL;
1831 c->node = page_to_nid(page);
1832 1831
1833unlock_out: 1832unlock_out:
1834 slab_unlock(page); 1833 slab_unlock(page);
@@ -1845,8 +1844,10 @@ another_slab:
1845new_slab: 1844new_slab:
1846 page = get_partial(s, gfpflags, node); 1845 page = get_partial(s, gfpflags, node);
1847 if (page) { 1846 if (page) {
1848 c->page = page;
1849 stat(s, ALLOC_FROM_PARTIAL); 1847 stat(s, ALLOC_FROM_PARTIAL);
1848load_from_page:
1849 c->node = page_to_nid(page);
1850 c->page = page;
1850 goto load_freelist; 1851 goto load_freelist;
1851 } 1852 }
1852 1853
@@ -1867,8 +1868,8 @@ new_slab:
1867 1868
1868 slab_lock(page); 1869 slab_lock(page);
1869 __SetPageSlubFrozen(page); 1870 __SetPageSlubFrozen(page);
1870 c->page = page; 1871
1871 goto load_freelist; 1872 goto load_from_page;
1872 } 1873 }
1873 if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit()) 1874 if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
1874 slab_out_of_memory(s, gfpflags, node); 1875 slab_out_of_memory(s, gfpflags, node);