lkml.org 
[lkml]   [2011]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 15 Apr 2011 15:47:34 -0500
FromChristoph Lameter <>
Subject[slubllv3 04/21] 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>

---
mm/slub.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2011-04-15 12:52:17.000000000 -0500
+++ linux-2.6/mm/slub.c 2011-04-15 12:54:15.000000000 -0500
@@ -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);


\
 
 \ /
  Last update: 2011-04-15 22:55    [from the cache]
©2003-2010