Messages in this thread Patch in this message | | | Date | Tue, 27 Jun 2006 11:05:46 -0700 (PDT) | From | Christoph Lameter <> | Subject | Re: [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/
| |