lkml.org 
[lkml]   [2006]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [ZVC 4/4] Inline counters for single processor configurations
Hmmm.. i386/x86_64 do not convert the adds to incs like ia64. Therefore 
one can decrease memory usage even further by using atomic_inc/dec
explicitly.

Index: linux-2.6.17-mm3/include/linux/vmstat.h
===================================================================
--- linux-2.6.17-mm3.orig/include/linux/vmstat.h 2006-06-27 03:53:05.000000000 -0700
+++ linux-2.6.17-mm3/include/linux/vmstat.h 2006-06-27 03:54:16.000000000 -0700
@@ -186,12 +186,14 @@

static inline void __inc_zone_page_state(struct page *page, enum zone_stat_item item)
{
- zone_page_state_add(1, page_zone(page), item);
+ atomic_long_inc(&page_zone(page)->vm_stat[item]);
+ atomic_long_inc(&vm_stat[item]);
}

static inline void __dec_zone_page_state(struct page *page, enum zone_stat_item item)
{
- zone_page_state_add(-1, page_zone(page), item);
+ atomic_long_dec(&page_zone(page)->vm_stat[item]);
+ atomic_long_dec(&vm_stat[item]);
}

/*
-
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: 2006-06-27 20:08    [W:0.029 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site