lkml.org 
[lkml]   [2007]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[26/37] compound pages: Use new compound vmstat functions in SLUB
Use the new dec/inc functions to simplify SLUB's accounting
of pages.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
mm/slub.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)

Index: linux-2.6.22-rc4-mm2/mm/slub.c
===================================================================
--- linux-2.6.22-rc4-mm2.orig/mm/slub.c 2007-06-18 18:42:45.000000000 -0700
+++ linux-2.6.22-rc4-mm2/mm/slub.c 2007-06-18 19:13:26.000000000 -0700
@@ -1052,7 +1052,6 @@ static inline void kmem_cache_open_debug
static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
{
struct page * page;
- int pages = 1 << s->order;

if (s->order)
flags |= __GFP_COMP;
@@ -1071,10 +1070,9 @@ static struct page *allocate_slab(struct
if (!page)
return NULL;

- mod_zone_page_state(page_zone(page),
+ inc_zone_page_state(page,
(s->flags & SLAB_RECLAIM_ACCOUNT) ?
- NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE,
- pages);
+ NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE);

return page;
}
@@ -1149,8 +1147,6 @@ static struct page *new_slab(struct kmem

static void __free_slab(struct kmem_cache *s, struct page *page)
{
- int pages = 1 << s->order;
-
if (unlikely(SlabDebug(page))) {
void *p;

@@ -1159,10 +1155,9 @@ static void __free_slab(struct kmem_cach
check_object(s, page, p, 0);
}

- mod_zone_page_state(page_zone(page),
+ dec_zone_page_state(page,
(s->flags & SLAB_RECLAIM_ACCOUNT) ?
- NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE,
- - pages);
+ NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE);

page->mapping = NULL;
__free_pages(page, s->order);
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-06-20 20:39    [W:0.487 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site