Event counters [1/3]: Basic counter functionality
Subsystems (14)
RFC 1/1 Event counters [1/3]: Basic counter functionality
Light weight counter functions
The remaining counters in page_state after the zoned VM counter patch has been applied are all just for show in /proc/vmstat. They have no essential function for the VM and therefore we can make these counters lightweight by ignoring races and also allow an off switch for embedded systems that allows a building of a linux kernels without these counters.
The implementation of these counters is through inline code that typically results in a simple increment of a global memory locations.
Also
- Rename page_state to event_state
- Make event state an array indexed by the event item.
init/Kconfig +9 -0
@@ -411,6 +411,15 @@ config SLAB SLOB is more space efficient but does not scale well and is more susceptible to fragmentation. +config EVENT_COUNTERS + default y + bool "Enable event counters for /proc/vmstat" if EMBEDDED + help + Event counters are only needed to display statistics. They + have no function for the kernel itself. This option allows + the disabling of the event counters. /proc/vmstat will only + contain essential counters. + config SERIAL_PCI depends PCI && SERIAL_8250 default y
include/linux/page-flags.h +58 -108
178 lines not on this page · raw message
mm/page_alloc.c +35 -54
147 lines not on this page · raw message
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
RFC 1/1 Event counters [2/3]: Convert inc_page_state -> count_event
Convert inc/add page_state to count_event(s)
Convert the page_state operations to count_event() and count_zone_event()
mm/page_alloc.c +4 -4
@@ -443,7 +443,7 @@ static void __free_pages_ok(struct pagekernel_map_pages (page,1 << order,0 );local_irq_save (flags); -__mod_page_state (pgfree,1 << order); +count_events (PGFREE ,1 << order);free_one_page (page_zone (page), page, order);local_irq_restore (flags); }
@@ -473,7 +473,7 @@ void fastcall __init __free_pages_bootmearch_free_page (page, order); -mod_page_state (pgfree,1 << order); +count_events (PGFREE ,1 << order);list_add (&page->lru, &list);kernel_map_pages (page,1 << order,0 );
@@ -1030,7 +1030,7 @@ static void fastcall free_hot_cold_page( pcp = &zone_pcp (zone,get_cpu ())->pcp[cold];local_irq_save (flags); -__inc_page_state (pgfree); +count_event (PGFREE );list_add (&page->lru, &pcp->list); pcp->count++;if (pcp->count >= pcp->high) {
@@ -1097,7 +1097,7 @@ again: goto failed; } -__mod_page_state_zone (zone, pgalloc,1 << order); +count_zone_events (PGALLOC , zone,1 << order);zone_statistics (zonelist, zone, cpu);local_irq_restore (flags);put_cpu ();
mm/vmscan.c +11 -12
@@ -227,7 +227,7 @@ int shrink_slab(unsigned long scanned, g (nr_before - shrink_ret)); }shrinker_stat_add (shrinker, nr_req, this_scan); -mod_page_state (slabs_scanned, this_scan); +count_events (SLABS_SCANNED , this_scan); total_scan -= this_scan;cond_resched ();
@@ -567,7 +567,7 @@ keep:list_splice (&ret_pages, page_list);if (pagevec_count (&freed_pvec))__pagevec_release_nonlru (&freed_pvec); -mod_page_state (pgactivate, pgactivate); +count_events (PGACTIVATE , pgactivate); sc->nr_reclaimed += reclaimed;return reclaimed; }
@@ -888,11 +888,11 @@ static void shrink_cache(struct zone *zolocal_irq_disable ();if (current_is_kswapd ()) { -__mod_page_state_zone (zone, pgscan_kswapd, nr_scan); -__mod_page_state (kswapd_steal, nr_freed); +count_zone_events (PGSCAN_KSWAPD , zone, nr_scan); +count_events (KSWAPD_STEAL , nr_freed); }else -__mod_page_state_zone (zone, pgscan_direct, nr_scan); -__mod_page_state_zone (zone, pgsteal, nr_freed); +count_zone_events (PGSCAN_DIRECT , zone, nr_scan); +count_events (PGACTIVATE , nr_freed);spin_lock (&zone->lru_lock);/*
@@ -1056,11 +1056,10 @@ refill_inactive_zone(struct zone *zone, } } zone->nr_active += pgmoved; -spin_unlock (&zone->lru_lock); +spin_unlock_irq (&zone->lru_lock); -__mod_page_state_zone (zone, pgrefill, pgscanned); -__mod_page_state (pgdeactivate, pgdeactivate); -local_irq_enable (); +count_zone_events (PGREFILL , zone, pgscanned); +count_events (PGDEACTIVATE , pgdeactivate);pagevec_release (&pvec); }
@@ -1182,7 +1181,7 @@ int try_to_free_pages(struct zone **zone sc.gfp_mask = gfp_mask; sc.may_writepage =0 ; -inc_page_state (allocstall); +count_event (ALLOCSTALL );for (i =0 ; zones[i] !=NULL ; i++) {struct zone *zone = zones[i];
@@ -1285,7 +1284,7 @@ loop_again: sc.may_writepage =0 ; sc.nr_mapped =global_page_state (NR_MAPPED ); -inc_page_state (pageoutrun); +count_event (PAGEOUTRUN );for (i =0 ; i < pgdat->nr_zones; i++) {struct zone *zone = pgdat->node_zones + i;
block/ll_rw_blk.c +2 -2
@@ -3007,9 +3007,9 @@ void submit_bio(int rw, struct bio *bio)BIO_BUG_ON (!bio->bi_io_vec); bio->bi_rw |= rw;if (rw &WRITE ) -mod_page_state (pgpgout, count); +count_events (PGPGOUT , count);else -mod_page_state (pgpgin, count); +count_events (PGPGIN , count);if (unlikely (block_dump)) {char b[BDEVNAME_SIZE ];
mm/page_io.c +2 -2
@@ -101,7 +101,7 @@ int swap_writepage(struct page *page, st }if (wbc->sync_mode ==WB_SYNC_ALL ) rw |= (1 <<BIO_RW_SYNC ); -inc_page_state (pswpout); +count_event (PSWPOUT );set_page_writeback (page);unlock_page (page);submit_bio (rw, bio);
@@ -123,7 +123,7 @@ int swap_readpage(struct file *file, str ret = -ENOMEM ; goto out; } -inc_page_state (pswpin); +count_event (PSWPIN );submit_bio (READ , bio); out:return ret;
mm/memory.c +2 -2
@@ -1887,7 +1887,7 @@ static int do_swap_page(struct mm_struct/* Had to read the page from swap area: Major fault */ ret =VM_FAULT_MAJOR ; -inc_page_state (pgmajfault); +count_event (PGMAJFAULT );grab_swap_token (); }
@@ -2247,7 +2247,7 @@ int __handle_mm_fault(struct mm_struct *__set_current_state (TASK_RUNNING ); -inc_page_state (pgfault); +count_event (PGFAULT );if (unlikely (is_vm_hugetlb_page (vma)))return hugetlb_fault (mm, vma, address, write_access);
fs/inode.c +2 -2
@@ -462,9 +462,9 @@ static void prune_icache(int nr_to_scan)up (&iprune_sem);if (current_is_kswapd ()) -mod_page_state (kswapd_inodesteal, reap); +count_events (KSWAPD_INODESTEAL , reap);else -mod_page_state (pginodesteal, reap); +count_events (PGINODESTEAL , reap); }/*
mm/shmem.c +1 -1
@@ -996,7 +996,7 @@ repeat:spin_unlock (&info->lock);/* here we actually do the io */ if (type && *type ==VM_FAULT_MINOR ) { -inc_page_state (pgmajfault); +count_event (PGMAJFAULT ); *type =VM_FAULT_MAJOR ; } swappage =shmem_swapin (info, swap, idx);
mm/swap.c +2 -2
@@ -85,7 +85,7 @@ int rotate_reclaimable_page(struct pageif (PageLRU (page) && !PageActive (page)) {list_del (&page->lru);list_add_tail (&page->lru, &zone->inactive_list); -inc_page_state (pgrotated); +count_event (PGROTATED ); }if (!test_clear_page_writeback (page))BUG ();
@@ -105,7 +105,7 @@ void fastcall activate_page(struct pagedel_page_from_inactive_list (zone, page);SetPageActive (page);add_page_to_active_list (zone, page); -inc_page_state (pgactivate); +count_event (PGACTIVATE ); }spin_unlock_irq (&zone->lru_lock); }
mm/filemap.c +2 -2
@@ -1283,7 +1283,7 @@ retry_find:*/ if (!did_readaround) { majmin =VM_FAULT_MAJOR ; -inc_page_state (pgmajfault); +count_event (PGMAJFAULT ); } did_readaround =1 ; ra_pages =max_sane_readahead (file->f_ra.ra_pages);
@@ -1354,7 +1354,7 @@ no_cached_page: page_not_uptodate:if (!did_readaround) { majmin =VM_FAULT_MAJOR ; -inc_page_state (pgmajfault); +count_event (PGMAJFAULT ); }lock_page (page);
fs/ncpfs/mmap.c +1 -1
@@ -93,7 +93,7 @@ static struct page* ncp_file_mmap_nopage*/ if (type) *type =VM_FAULT_MAJOR ; -inc_page_state (pgmajfault); +count_event (PGMAJFAULT );return page; }
drivers/parisc/led.c +2 -4
@@ -410,14 +410,12 @@ static __inline__ int led_get_net_activistatic __inline__int led_get_diskio_activity (void ) {static unsigned long last_pgpgin, last_pgpgout; -struct page_state pgstat;int changed; -get_full_page_state (&pgstat);/* get no of sectors in & out */ -/* Just use a very simple calculation here. Do not care about overflow, since we only want to know if there was activity or not. */ - changed = (pgstat.pgpgin != last_pgpgin) || (pgstat.pgpgout != last_pgpgout); + changed = (get_global_events (PGPGIN ) != last_pgpgin) || + (get_global_events (PGPGOUT ) != last_pgpgout); last_pgpgin = pgstat.pgpgin; last_pgpgout = pgstat.pgpgout;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
RFC 1/1 Event counters [3/3]: Convert NUMA counters to event counters
In reply to Christoph LameterUse event counters instead of numa statistics
I am not sure if this is such a bright idea. But one could remove the NUMA statistics and use event counters. This patch reduces the number of numa counters to two. One for counting allocations that were not able to follow memory policy (NUMA_MISS) and one for general off node allocations (NUMA_OFF_NODE).
This would greatly simplify numa counters handling. node/numastat would no longer be available (maybe one could improvise one with the stats of the processors on the node?)
Big question: Do we really need these detailed NUMA statistics that are only reported via numa stats and never used in the VM?
include/linux/mmzone.h +0 -8
@@ -79,14 +79,6 @@ struct per_cpu_pageset {s8 vm_stat_diff[NR_STAT_ITEMS ];#endif -#ifdef CONFIG_NUMA -unsigned long numa_hit;/* allocated in intended node */ -unsigned long numa_miss;/* allocated in non intended node */ -unsigned long numa_foreign;/* was intended here, hit elsewhere */ -unsigned long interleave_hit;/* interleaver prefered this zone */ -unsigned long local_node;/* allocation from local node */ -unsigned long other_node;/* allocation from other node */ -#endif }____cacheline_aligned_in_smp ;#ifdef CONFIG_NUMA
include/linux/page-flags.h +3 -0
@@ -103,6 +103,9 @@ enum event_item { PGPGIN, PGPGOUT, PSWPIFOR_ALL_ZONES (PGSCAN_DIRECT ),PGINODESTEAL ,SLABS_SCANNED ,KSWAPD_STEAL ,KSWAPD_INODESTEAL ,PAGEOUTRUN ,ALLOCSTALL ,PGROTATED , +#ifdef CONFIG_NUMA +NUMA_MISS ,NUMA_OFF_NODE , +#endifNR_EVENT_ITEMS };
mm/mempolicy.c +1 -7
@@ -1072,15 +1072,9 @@ static struct page *alloc_page_interleav unsigned nid) {struct zonelist *zl; -struct page *page; zl =NODE_DATA (nid)->node_zonelists +gfp_zone (gfp); - page =__alloc_pages (gfp, order, zl); -if (page &&page_zone (page) == zl->zones[0 ]) { -zone_pcp (zl->zones[0 ],get_cpu ())->interleave_hit++; -put_cpu (); - } -return page; +return __alloc_pages (gfp, order, zl); }/**
mm/page_alloc.c +12 -31
71 lines not on this page · raw message
drivers/base/node.c +0 -42
60 lines not on this page · raw message
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [RFC] Event counters [3/3]: Convert NUMA counters to event counters
Quoted 2 lines · Christoph Lameter
no longer be available (maybe one could improvise one with the stats of the processors on the node?)
Here is such an alternate patch. It creates a per cpu vmstat in /sys/devices/system/cpu/cpu<nr>/vmstat (omitting the zoned counters which are per zone and therefore node specific).
This allows one to observe VM related events occurring on a specific processor
It also preserves /sys/devices/system/node/node<nr>/numa_stats which will contain the summed up event counters for all the processors on the node.
This will preserve the existing numa_miss and numa_other fields and add lots of other information that may be useful.
There is a global numa_miss and numa_other field available in /proc/vmstat with both these patches. The fields may be helpful to check for fast checks if allocation requests are properly satisfied.
include/linux/mmzone.h +0 -8
@@ -79,14 +79,6 @@ struct per_cpu_pageset {s8 vm_stat_diff[NR_STAT_ITEMS ];#endif -#ifdef CONFIG_NUMA -unsigned long numa_hit;/* allocated in intended node */ -unsigned long numa_miss;/* allocated in non intended node */ -unsigned long numa_foreign;/* was intended here, hit elsewhere */ -unsigned long interleave_hit;/* interleaver prefered this zone */ -unsigned long local_node;/* allocation from local node */ -unsigned long other_node;/* allocation from other node */ -#endif }____cacheline_aligned_in_smp ;#ifdef CONFIG_NUMA
include/linux/page-flags.h +5 -0
@@ -103,6 +103,9 @@ enum event_item { PGPGIN, PGPGOUT, PSWPIFOR_ALL_ZONES (PGSCAN_DIRECT ),PGINODESTEAL ,SLABS_SCANNED ,KSWAPD_STEAL ,KSWAPD_INODESTEAL ,PAGEOUTRUN ,ALLOCSTALL ,PGROTATED , +#ifdef CONFIG_NUMA +NUMA_MISS ,NUMA_OFF_NODE , +#endifNR_EVENT_ITEMS };
@@ -131,6 +134,8 @@ static inline void count_events(enum eve __get_cpu_var(event_states).event[item] += delta; } +extern char *vmstat_text[]; +#else /* Disable counters */ #define get_cpu_events (e) 0L
mm/mempolicy.c +1 -7
@@ -1072,15 +1072,9 @@ static struct page *alloc_page_interleav unsigned nid) {struct zonelist *zl; -struct page *page; zl =NODE_DATA (nid)->node_zonelists +gfp_zone (gfp); - page =__alloc_pages (gfp, order, zl); -if (page &&page_zone (page) == zl->zones[0 ]) { -zone_pcp (zl->zones[0 ],get_cpu ())->interleave_hit++; -put_cpu (); - } -return page; +return __alloc_pages (gfp, order, zl); }/**
mm/page_alloc.c +13 -32
79 lines not on this page · raw message
drivers/base/node.c +10 -35
51 lines not on this page · raw message
drivers/base/cpu.c +22 -0
@@ -8,6 +8,7 @@#include <linux/cpu.h> #include <linux/topology.h> #include <linux/device.h> +#include <linux/page-flags.h> #include "base.h"
@@ -83,6 +84,26 @@ static inline void register_cpu_control( }#endif /* CONFIG_HOTPLUG_CPU */ +static ssize_t cpu_read_vmstat (struct sys_device * dev,char * buf) +{ +int i; +char *p = buf; +cpumask_t mask; + struct cpu *cpu = container_of(dev, struct cpu, sysdev); +unsigned long v[NR_EVENT_ITEMS ]; + +cpus_clear (mask); +cpu_set (cpu->sysdev.id, mask); +sum_events (v, &mask); + +for (i =0 ; i <NR_EVENT_ITEMS ; i++) + p +=sprintf (p,"%s %ld\n" , + vmstat_text[NR_STAT_ITEMS + i], v[i]); +return p - buf; +} +static SYSDEV_ATTR(vmstat, S_IRUGO, cpu_read_vmstat, NULL); + +#ifdef CONFIG_KEXEC #include <linux/kexec.h>
@@ -138,6 +159,7 @@ int __devinit register_cpu(struct cpu *cif (!error) error =sysdev_create_file (&cpu->sysdev, &attr_crash_notes);#endif +sysdev_create_file (&cpu->sysdev, &attr_vmstat);return error; }
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Hi Christoph,
Quoted 22 lines · Christoph Lameter
Light weight counter functions
The remaining counters in
page_stateafter the zoned VM counter patch has been applied are all just for show in/proc/vmstat. They have no essential function for the VM and therefore we can make these counters lightweight by ignoring races and also allow an off switch for embedded systems that allows a building of a linux kernels without these counters.The implementation of these counters is through inline code that typically results in a simple increment of a global memory locations.
Also
- Renamepage_statetoevent_state
- Make event state an array indexed by the event item.Signed-off-by Christoph Lameter <[email protected]>Index: linux-2.6.15-rc5-mm3/init/Kconfig
===================================================================
init/Kconfig config SLAB · line 414
Quoted 4 lines
init/Kconfig +1
-0@@ -411,6 +411,15 @@ config SLAB SLOB is more space efficient but does not scale well and is more susceptible to fragmentation. +config EVENT_COUNTERS
Please rename to VM_EVENT_COUNTERS or a better name.
Quoted 26 lines
init/Kconfig +8
-0+ default y + bool "Enable event counters for /proc/vmstat" if EMBEDDED + help + Event counters are only needed to display statistics. They + have no function for the kernel itself. This option allows + the disabling of the event counters. /proc/vmstat will only + contain essential counters. + config SERIAL_PCI depends PCI && SERIAL_8250 default yIndex:
linux-2.6.15-rc5-mm3/include/linux/page-flags.h
===================================================================include/linux/page-flags.h +2
-3@@ -77,120 +77,70 @@#define PG_nosave_free 18/* Free, should not be written */ #define PG_uncached 19/* Page has been mapped as uncached */ +#ifdef CONFIG_EVENT_COUNTERS /* -* Global page accounting. One instance per CPU. Only unsigned longs are -* allowed. +* Light weight per cpu counter implementation. * -* - Fields can be modified with xxx_page_state and xxx_page_state_zone at
include/linux/page-flags.h line 86
Quoted 10 lines
include/linux/page-flags.h +3
-7-* any time safely (which protects the instance from modification by -* interrupt. -* - The __xxx_page_state variants can be used safely when interrupts are -* disabled. -* - The __xxx_page_state variants can be used if the field is only -* modified from process context, or only modified from interrupt context. -* In this case, the field should be commented here. +* Note that these can race. We do not bother to enable preemption +* or care about interrupt races. All we care about is to have some +* approximate count of events.
What about this addition to the documentation above, to make it a little more verbose:
The possible race scenario is restricted to kernel preemption, and could happen as follows:
thread A thread B
a) movl xyz(%ebp), %eax movl xyz(%ebp), %eax b) incl %eax incl %eax c) movl %eax, xyz(%ebp) movl %eax, xyz(%ebp)
Thread A can be preempted in b), and thread B succesfully increments the counter, writing it back to memory. Now thread A resumes execution, with its stale copy of the counter, and overwrites the current counter.
Resulting in increments lost.
However that should be relatively rare condition.
Quoted 115 lines
include/linux/page-flags.h +18
-93+* +* Counters should only be incremented and no critical kernel component +* should rely on the counter values. +* +* Counters are handled completely inline. On many platforms the code +* generated will simply be the increment of a global address. */ -struct page_state { -/* -* The below are zeroed by get_page_state(). Use get_full_page_state() -* to add up all these. -*/ -unsigned long pgpgin;/* Disk reads */ -unsigned long pgpgout;/* Disk writes */ -unsigned long pswpin;/* swap reads */ -unsigned long pswpout;/* swap writes */ - -unsigned long pgalloc_high;/* page allocations */ -unsigned long pgalloc_normal; -unsigned long pgalloc_dma32; -unsigned long pgalloc_dma; - -unsigned long pgfree;/* page freeings */ -unsigned long pgactivate;/* pages moved inactive->active */ -unsigned long pgdeactivate;/* pages moved active->inactive */ - -unsigned long pgfault;/* faults (major+minor) */ -unsigned long pgmajfault;/* faults (major only) */ - -unsigned long pgrefill_high;/* inspected in refill_inactive_zone */ -unsigned long pgrefill_normal; -unsigned long pgrefill_dma32; -unsigned long pgrefill_dma; - -unsigned long pgsteal_high;/* total highmem pages reclaimed */ -unsigned long pgsteal_normal; -unsigned long pgsteal_dma32; -unsigned long pgsteal_dma; - -unsigned long pgscan_kswapd_high;/* total highmem pages scanned */ -unsigned long pgscan_kswapd_normal; -unsigned long pgscan_kswapd_dma32; -unsigned long pgscan_kswapd_dma; - -unsigned long pgscan_direct_high;/* total highmem pages scanned */ -unsigned long pgscan_direct_normal; -unsigned long pgscan_direct_dma32; -unsigned long pgscan_direct_dma; - -unsigned long pginodesteal;/* pages reclaimed via inode freeing */ -unsigned long slabs_scanned;/* slab objects scanned */ -unsigned long kswapd_steal;/* pages reclaimed by kswapd */ -unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */ -unsigned long pageoutrun;/* kswapd's calls to page reclaim */ -unsigned long allocstall;/* direct reclaim calls */ +#define FOR_ALL_ZONES (x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH -unsigned long pgrotated;/* pages rotated to tail of the LRU */ +enum event_item {PGPGIN ,PGPGOUT ,PSWPIN ,PSWPOUT , + FOR_ALL_ZONES(PGALLOC), +PGFREE ,PGACTIVATE ,PGDEACTIVATE , +PGFAULT ,PGMAJFAULT , + FOR_ALL_ZONES(PGREFILL), + FOR_ALL_ZONES(PGSTEAL), + FOR_ALL_ZONES(PGSCAN_KSWAPD), + FOR_ALL_ZONES(PGSCAN_DIRECT), +PGINODESTEAL ,SLABS_SCANNED ,KSWAPD_STEAL ,KSWAPD_INODESTEAL , +PAGEOUTRUN ,ALLOCSTALL ,PGROTATED , +NR_EVENT_ITEMS }; -extern void get_full_page_state (struct page_state *ret); -extern unsigned long read_page_state_offset (unsigned long offset); -extern void mod_page_state_offset (unsigned long offset,unsigned long delta); -extern void __mod_page_state_offset (unsigned long offset,unsigned long delta); - -#define read_page_state (member) \ - read_page_state_offset(offsetof(struct page_state, member)) - -#define mod_page_state (member, delta) \ - mod_page_state_offset(offsetof(struct page_state, member), (delta)) - -#define __mod_page_state (member, delta) \ - __mod_page_state_offset(offsetof(struct page_state, member), (delta)) - -#define inc_page_state (member) mod_page_state(member, 1UL) -#define dec_page_state (member) mod_page_state(member, 0UL - 1) -#define add_page_state (member,delta) mod_page_state(member, (delta)) -#define sub_page_state (member,delta) mod_page_state(member, 0UL - (delta)) - -#define __inc_page_state (member) __mod_page_state(member, 1UL) -#define __dec_page_state (member) __mod_page_state(member, 0UL - 1) -#define __add_page_state (member,delta) __mod_page_state(member, (delta)) -#define __sub_page_state (member,delta) __mod_page_state(member, 0UL - (delta)) - -#define page_state (member) (*__page_state(offsetof(struct page_state, member))) - -#define state_zone_offset (zone, member) \ -({ \ - unsigned offset; \ - if (is_highmem(zone)) \ - offset = offsetof(struct page_state, member##_high); \ - else if (is_normal(zone)) \ - offset = offsetof(struct page_state, member##_normal); \ - else if (is_dma32(zone)) \ - offset = offsetof(struct page_state, member##_dma32); \ - else \ - offset = offsetof(struct page_state, member##_dma); \ - offset; \ -}) - -#define __mod_page_state_zone (zone, member, delta) \ - do { \ - __mod_page_state_offset(state_zone_offset(zone, member), (delta)); \ - } while (0)
include/linux/page-flags.h line 113
Quoted 10 lines
include/linux/page-flags.h +5
-5- -#define mod_page_state_zone (zone, member, delta) \ - do { \ - mod_page_state_offset(state_zone_offset(zone, member), (delta)); \ - } while (0) +struct event_state { +unsigned long event[NR_EVENT_ITEMS ]; +}; + +DECLARE_PER_CPU(struct event_state, event_states);
Might be interesting to mark this structure as __cacheline_aligned_in_smp to avoid unrelated data sitting in the same line?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 11 lines · Marcelo Tosatti
What about this addition to the documentation above, to make it a little more verbose:
The possible race scenario is restricted to kernel preemption, and could happen as follows:
thread A thread B
a) movl xyz(%ebp), %eax movl xyz(%ebp), %eax b) incl %eax incl %eax c) movl %eax, xyz(%ebp) movl %eax, xyz(%ebp)
Quoted 8 lines
Thread A can be preempted in b), and thread B succesfully increments the counter, writing it back to memory. Now thread A resumes execution, with its stale copy of the counter, and overwrites the current counter.
Resulting in increments lost.
However that should be relatively rare condition.
Hi Guys,
I've been waiting for some mm/ patches to clear from -mm before commenting too much... however I see that this patch is actually against -mm itself, with my __mod_page_state stuff in it... that makes the page state accounting much lighter weight AND is not racy.
So I'm not exactly sure why such a patch as this is wanted now? Are there any more xxx_page_state hotspots? (I admit to only looking at page faults, page allocator, and page reclaim).
Thanks,
Nick
Signature · 8 lines
SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Hi Nick!
Quoted 23 lines · Nick Piggin
Quoted 12 lines · Marcelo Tosatti
What about this addition to the documentation above, to make it a little more verbose:
The possible race scenario is restricted to kernel preemption, and could happen as follows:
thread A thread B
a) movl xyz(%ebp), %eax movl xyz(%ebp), %eax b) incl %eax incl %eax c) movl %eax, xyz(%ebp) movl %eax, xyz(%ebp)Quoted 8 lines
Thread A can be preempted in b), and thread B succesfully increments the counter, writing it back to memory. Now thread A resumes execution, with its stale copy of the counter, and overwrites the current counter.
Resulting in increments lost.
However that should be relatively rare condition.
Quoted 6 lines
Hi Guys,
I've been waiting for some
mm/patches to clear from -mm before commenting too much... however I see that this patch is actually against -mm itself, with my__mod_page_statestuff in it... that makes the page state accounting much lighter weight AND is not racy.
It is racy with reference to preempt (please refer to the race condition described above):
mm/rmap.c 2005-12-13 22:25:01.000000000 -0800 renamed from mm/rmap.c~mm-page_state-opt 2005-12-13 22:25:01.000000000 -0800 +5 -1
@@ -451,7 +451,11 @@ static void __page_set_anon_rmap(struct page->index = linear_page_index(vma, address); - inc_page_state(nr_mapped); + /* + * nr_mapped state can be updated without turning off + * interrupts because it is not modified via interrupt. + */ + __inc_page_state(nr_mapped); }
And since "nr_mapped" is not a counter for debugging purposes only, you can't be lazy with reference to its consistency.
I would argue that you need a preempt save version for this important counters, surrounded by preempt_disable/preempt_enable (which vanish if one selects !CONFIG_PREEMPT).
As Christoph notes, debugging counter consistency can be lazy, not even requiring correct preempt locking (hum, this is debatable, needs careful verification).
Quoted 3 lines
So I'm not exactly sure why such a patch as this is wanted now? Are there any more
xxx_page_statehotspots? (I admit to only looking at page faults, page allocator, and page reclaim).
A consolidation of the good parts of both would be interesting.
I don't see much point in Christoph's naming change to "event_counter", why are you doing that?
And follows an addition to your's mm-page_state-opt-docs.patch. Still need to verify "nr_dirty" and "nr_unstable".
Happy new year!
include/linux/page-flags.h +4 -0
@@ -83,10 +83,14 @@struct page_state {unsigned long nr_dirty;/* Dirty writeable pages */ unsigned long nr_writeback;/* Pages under writeback */ +/* also modified from IRQ context */ unsigned long nr_unstable;/* NFS unstable pages */ unsigned long nr_page_table_pages;/* Pages used for pagetables */ +/* only modified from process context */ unsigned long nr_mapped;/* mapped into pagetables */ +/* only modified from process context */ unsigned long nr_slab;/* In slab */ +/* also modified from IRQ context */ #define GET_PAGE_STATE_LAST nr_slab/*
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 54 lines · Marcelo Tosatti
Hi Nick!
Quoted 23 lines · Nick Piggin
Quoted 12 lines · Marcelo Tosatti
What about this addition to the documentation above, to make it a little more verbose:
The possible race scenario is restricted to kernel preemption, and could happen as follows:
thread A thread B
a) movl xyz(%ebp), %eax movl xyz(%ebp), %eax b) incl %eax incl %eax c) movl %eax, xyz(%ebp) movl %eax, xyz(%ebp)Quoted 8 lines
Thread A can be preempted in b), and thread B succesfully increments the counter, writing it back to memory. Now thread A resumes execution, with its stale copy of the counter, and overwrites the current counter.
Resulting in increments lost.
However that should be relatively rare condition.
Quoted 6 lines
Hi Guys,
I've been waiting for some
mm/patches to clear from -mm before commenting too much... however I see that this patch is actually against -mm itself, with my__mod_page_statestuff in it... that makes the page state accounting much lighter weight AND is not racy.It is racy with reference to preempt (please refer to the race condition described above):
diff -puN
mm/rmap.c~mm-page_state-optmm/rmap.cmm/rmap.c 2005-12-13 22:25:01.000000000 -0800 renamed from mm/rmap.c~mm-page_state-opt 2005-12-13 22:25:01.000000000 -0800 +5
-1@@ -451,7 +451,11 @@ static void __page_set_anon_rmap(struct page->index = linear_page_index(vma, address); - inc_page_state(nr_mapped); + /* + * nr_mapped state can be updated without turning off + * interrupts because it is not modified via interrupt. + */ + __inc_page_state(nr_mapped); }And since "
nr_mapped" is not a counter for debugging purposes only, you can't be lazy with reference to its consistency.
Quoted 3 lines
I would argue that you need a preempt save version for this important counters, surrounded by preempt_disable/preempt_enable (which vanish if one selects !CONFIG_PREEMPT).
Nick,
The following patch:
- Moves the lightweight "inc/dec" versions of mod_page_state variants to three underscores, making those the default for locations where enough locks are held.
- Make the two-underscore version disable and enable preemption, which is required to avoid preempt-related races which can result in missed updates.
- Extends the lightweight version usage in page reclaim, pte allocation, and a few other codepaths.
How does it look?
fs/buffer.c | 2 +- fs/inode.c | 4 ++-- include/linux/page-flags.h | 17 +++++++++++++++++ mm/memory.c | 7 +++++-- mm/page-writeback.c | 2 +- mm/page_alloc.c | 14 +++++++++++--- mm/rmap.c | 3 ++- mm/swap.c | 4 ++-- mm/vmscan.c | 8 ++++---- 9 files changed, 45 insertions(+), 16 deletions(-)
fs/buffer.c renamed from tmp/2.6.15-rc5-mm3.orig/fs/buffer.c +1 -1
@@ -857,7 +857,7 @@ int __set_page_dirty_buffers(struct pagewrite_lock_irq (&mapping->tree_lock);if (page->mapping) {/* Race with truncate? */ if (mapping_cap_account_dirty (mapping)) -inc_page_state (nr_dirty); +___inc_page_state (nr_dirty);radix_tree_tag_set (&mapping->page_tree,page_index (page),PAGECACHE_TAG_DIRTY );
fs/inode.c renamed from tmp/2.6.15-rc5-mm3.orig/fs/inode.c +2 -2
@@ -462,9 +462,9 @@ static void prune_icache(int nr_to_scan)up (&iprune_sem);if (current_is_kswapd ()) -mod_page_state (kswapd_inodesteal, reap); +__mod_page_state (kswapd_inodesteal, reap);else -mod_page_state (pginodesteal, reap); +__mod_page_state (pginodesteal, reap); }/*
include/linux/page-flags.h renamed from tmp/2.6.15-rc5-mm3.orig/include/linux/page-flags.h +17 -0
@@ -157,6 +157,7 @@ extern void get_page_state_node(struct pextern void get_full_page_state (struct page_state *ret);extern unsigned long read_page_state_offset (unsigned long offset);extern void mod_page_state_offset (unsigned long offset,unsigned long delta); +extern void ___mod_page_state_offset (unsigned long offset,unsigned long delta);extern void __mod_page_state_offset (unsigned long offset,unsigned long delta);#define read_page_state (member) \
@@ -168,16 +169,27 @@ extern void __mod_page_state_offset(unsi#define __mod_page_state (member, delta) \ __mod_page_state_offset(offsetof(struct page_state, member), (delta)) +#define ___mod_page_state (member, delta) \ + ___mod_page_state_offset(offsetof(struct page_state, member), (delta)) + +/* preempt/IRQ safe */ #define inc_page_state (member) mod_page_state(member, 1UL)#define dec_page_state (member) mod_page_state(member, 0UL - 1)#define add_page_state (member,delta) mod_page_state(member, (delta))#define sub_page_state (member,delta) mod_page_state(member, 0UL - (delta)) +/* only preempt safe */ #define __inc_page_state (member) __mod_page_state(member, 1UL)#define __dec_page_state (member) __mod_page_state(member, 0UL - 1)#define __add_page_state (member,delta) __mod_page_state(member, (delta))#define __sub_page_state (member,delta) __mod_page_state(member, 0UL - (delta)) +/* preempt/IRQ unsafe (plain inc/dec operations) */ +#define ___inc_page_state (member) ___mod_page_state(member, 1UL) +#define ___dec_page_state (member) ___mod_page_state(member, 0UL - 1) +#define ___add_page_state (member,delta) ___mod_page_state(member, (delta)) +#define ___sub_page_state (member,delta) ___mod_page_state(member, 0UL - (delta)) +#define page_state (member) (*__page_state(offsetof(struct page_state, member)))#define state_zone_offset (zone, member) \
@@ -194,6 +206,11 @@ extern void __mod_page_state_offset(unsi offset; \ }) +#define ___mod_page_state_zone (zone, member, delta) \ + do { \ + ___mod_page_state_offset(state_zone_offset(zone, member), (delta)); \ + } while (0) +#define __mod_page_state_zone (zone, member, delta) \ do { \ __mod_page_state_offset(state_zone_offset(zone, member), (delta)); \
mm/memory.c renamed from tmp/2.6.15-rc5-mm3.orig/mm/memory.c +5 -2
@@ -116,7 +116,7 @@ static void free_pte_range(struct mmu_gapmd_clear (pmd);pte_lock_deinit (page);pte_free_tlb (tlb, page); -dec_page_state (nr_page_table_pages); +__dec_page_state (nr_page_table_pages); tlb->mm->nr_ptes--; }
@@ -302,7 +302,10 @@ int __pte_alloc(struct mm_struct *mm, pmpte_free (new); }else { mm->nr_ptes++; -inc_page_state (nr_page_table_pages); +/* nr_page_table_pages is never touched by interrupt +* context, so its not necessary to disable them. +*/ +__inc_page_state (nr_page_table_pages);pmd_populate (mm, pmd, new); }spin_unlock (&mm->page_table_lock);
mm/page_alloc.c renamed from tmp/2.6.15-rc5-mm3.orig/mm/page_alloc.c +11 -3
@@ -443,7 +443,7 @@ static void __free_pages_ok(struct pagekernel_map_pages (page,1 << order,0 );local_irq_save (flags); -__mod_page_state (pgfree,1 << order); +___mod_page_state (pgfree,1 << order);free_one_page (page_zone (page), page, order);local_irq_restore (flags); }
@@ -753,7 +753,7 @@ static void fastcall free_hot_cold_page( pcp = &zone_pcp (zone,get_cpu ())->pcp[cold];local_irq_save (flags); -__inc_page_state (pgfree); +___inc_page_state (pgfree);list_add (&page->lru, &pcp->list); pcp->count++;if (pcp->count >= pcp->high) {
@@ -820,7 +820,7 @@ again: goto failed; } -__mod_page_state_zone (zone, pgalloc,1 << order); +___mod_page_state_zone (zone, pgalloc,1 << order);zone_statistics (zonelist, zone, cpu);local_irq_restore (flags);put_cpu ();
@@ -1375,8 +1375,16 @@ unsigned long read_page_state_offset(unsreturn ret; } +void __mod_page_state_offset (unsigned long offset,unsigned long delta) { +preempt_disable (); +___mod_page_state_offset (offset, delta); +preempt_enable (); +} + +void ___mod_page_state_offset (unsigned long offset,unsigned long delta) +{void *ptr; ptr = &__get_cpu_var (page_states);
mm/page-writeback.c renamed from tmp/2.6.15-rc5-mm3.orig/mm/page-writeback.c +1 -1
@@ -632,7 +632,7 @@ int __set_page_dirty_nobuffers(struct paif (mapping2) {/* Race with truncate? */ BUG_ON (mapping2 != mapping);if (mapping_cap_account_dirty (mapping)) -inc_page_state (nr_dirty); +___inc_page_state (nr_dirty);radix_tree_tag_set (&mapping->page_tree,page_index (page),PAGECACHE_TAG_DIRTY ); }
mm/rmap.c renamed from tmp/2.6.15-rc5-mm3.orig/mm/rmap.c +2 -1
@@ -453,7 +453,8 @@ static void __page_set_anon_rmap(struct/* * nr_mapped state can be updated without turning off -* interrupts because it is not modified via interrupt. +* interrupts because it is not modified via interrupt. +* But it must be guarded against preemption. */ __inc_page_state (nr_mapped); }
mm/swap.c renamed from tmp/2.6.15-rc5-mm3.orig/mm/swap.c +2 -2
@@ -85,7 +85,7 @@ int rotate_reclaimable_page(struct pageif (PageLRU (page) && !PageActive (page)) {list_del (&page->lru);list_add_tail (&page->lru, &zone->inactive_list); -inc_page_state (pgrotated); +___inc_page_state (pgrotated); }if (!test_clear_page_writeback (page))BUG ();
@@ -105,7 +105,7 @@ void fastcall activate_page(struct pagedel_page_from_inactive_list (zone, page);SetPageActive (page);add_page_to_active_list (zone, page); -inc_page_state (pgactivate); +___inc_page_state (pgactivate); }spin_unlock_irq (&zone->lru_lock); }
mm/vmscan.c renamed from tmp/2.6.15-rc5-mm3.orig/mm/vmscan.c +4 -4
@@ -1058,8 +1058,8 @@ refill_inactive_zone(struct zone *zone, zone->nr_active += pgmoved;spin_unlock (&zone->lru_lock); -__mod_page_state_zone (zone, pgrefill, pgscanned); -__mod_page_state (pgdeactivate, pgdeactivate); +___mod_page_state_zone (zone, pgrefill, pgscanned); +___mod_page_state (pgdeactivate, pgdeactivate);local_irq_enable ();pagevec_release (&pvec);
@@ -1182,7 +1182,7 @@ int try_to_free_pages(struct zone **zone sc.gfp_mask = gfp_mask; sc.may_writepage =0 ; -inc_page_state (allocstall); +__inc_page_state (allocstall);for (i =0 ; zones[i] !=NULL ; i++) {struct zone *zone = zones[i];
@@ -1285,7 +1285,7 @@ loop_again: sc.may_writepage =0 ; sc.nr_mapped =read_page_state (nr_mapped); -inc_page_state (pageoutrun); +__inc_page_state (pageoutrun);for (i =0 ; i < pgdat->nr_zones; i++) {struct zone *zone = pgdat->node_zones + i;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 8 lines · Marcelo Tosatti
Nick,
The following patch:
- Moves the lightweight "inc/dec" versions of
mod_page_statevariants to three underscores, making those the default for locations where enough locks are held.
I guess I was hoping to try to keep it simple, and just have two variants, the __ version would require the caller to do the locking. In cases like eg. allocstall, they should happen infrequently enough that the extra complexity is probably not worth worrying about.
I don't think I commented about the preempt race though (and requirement to have preempt off from process context), which obviously can be a problem as you say (though I think things are currently safe?).
Quoted 7 lines
- Make the two-underscore version disable and enable preemption, which is required to avoid preempt-related races which can result in missed updates.
- Extends the lightweight version usage in page reclaim, pte allocation, and a few other codepaths.
I guess nr_dirty looks OK in the places it can be put under tree_lock.
nr_page_table_pages is OK because ptl should be held to prevent preempt.
pgrotated and pgactivate should be good because of lru_lock.
Thanks for going through these!
Signature · 11 lines
SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 6 lines · Nick Piggin
Quoted 4 lines · Marcelo Tosatti
Nick,
The following patch:
Quoted 7 lines
Quoted 4 lines
- Moves the lightweight "inc/dec" versions of
mod_page_statevariants to three underscores, making those the default for locations where enough locks are held.I guess I was hoping to try to keep it simple, and just have two variants, the __ version would require the caller to do the locking.
I see - one point is that the two/three underscore versions make it clear that preempt is required, though, but it might be a bit over-complicated as you say.
Well, its up to you - please rearrange the patch as you wish and merge up?
Quoted 2 lines
In cases like eg. allocstall, they should happen infrequently enough that the extra complexity is probably not worth worrying about.
True, but it reduces kernel code, which is always good.
Quoted 3 lines
I don't think I commented about the preempt race though (and requirement to have preempt off from process context), which obviously can be a problem as you say (though I think things are currently safe?).
"I think it should not be racy because the function should always be called with the page table lock held, which disables preempt. I guess the comment should be explicit about that as well."
Yes, you're right! My bad.
Quoted 8 lines
Quoted 7 lines
- Make the two-underscore version disable and enable preemption, which is required to avoid preempt-related races which can result in missed updates.
- Extends the lightweight version usage in page reclaim, pte allocation, and a few other codepaths.
Quoted 7 lines
I guess
nr_dirtylooks OK in the places it can be put undertree_lock.
nr_page_table_pagesis OK because ptl should be held to prevent preempt.pgrotated and pgactivate should be good because of
lru_lock.Thanks for going through these!
There's still probably a few more counters but the ones covered till now should be the most significant ones performance-wise.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Marcelo Tosatti
Quoted 2 lines · Nick Piggin
I guess I was hoping to try to keep it simple, and just have two variants, the __ version would require the caller to do the locking.
Quoted 7 lines
I see - one point is that the two/three underscore versions make it clear that preempt is required, though, but it might be a bit over-complicated as you say.
Well, its up to you - please rearrange the patch as you wish and merge up?
OK I will push it upstream - thanks!
We can revisit details again when some smoke clears from the coming 2.6.16 merge cycle?
Signature · 9 lines
SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 12 lines · Nick Piggin
Quoted 11 lines · Marcelo Tosatti
Quoted 2 lines · Nick Piggin
I guess I was hoping to try to keep it simple, and just have two variants, the __ version would require the caller to do the locking.
I see - one point is that the two/three underscore versions make it clear that preempt is required, though, but it might be a bit over-complicated as you say.
Quoted 8 lines
Quoted 3 lines
Well, its up to you - please rearrange the patch as you wish and merge up?
OK I will push it upstream - thanks!
We can revisit details again when some smoke clears from the coming 2.6.16 merge cycle?
Sure - we can also go further and the optimize operations on the remaining counters.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 2 lines · Marcelo Tosatti
Hi Nick!
Hey Marcelo!
Quoted 30 lines · Nick Piggin
Quoted 7 lines
Hi Guys,
I've been waiting for some
mm/patches to clear from -mm before commenting too much... however I see that this patch is actually against -mm itself, with my__mod_page_statestuff in it... that makes the page state accounting much lighter weight AND is not racy.It is racy with reference to preempt (please refer to the race condition described above):
diff -puN
mm/rmap.c~mm-page_state-optmm/rmap.cmm/rmap.c 2005-12-13 22:25:01.000000000 -0800 renamed from mm/rmap.c~mm-page_state-opt 2005-12-13 22:25:01.000000000 -0800 +5
-1@@ -451,7 +451,11 @@ static void __page_set_anon_rmap(struct page->index = linear_page_index(vma, address); - inc_page_state(nr_mapped); + /* + * nr_mapped state can be updated without turning off + * interrupts because it is not modified via interrupt. + */ + __inc_page_state(nr_mapped); }And since "
nr_mapped" is not a counter for debugging purposes only, you can't be lazy with reference to its consistency.
Quoted 4 lines
I would argue that you need a preempt save version for this important counters, surrounded by preempt_disable/preempt_enable (which vanish if one selects !CONFIG_PREEMPT).
I think it should not be racy because the function should always be called with the page table lock held, which disables preempt. I guess the comment should be explicit about that as well.
There were some runtime warnings that come up when this patch first went into -mm because of a silly typo, however that should now be resolved too.
Quoted 10 lines
As Christoph notes, debugging counter consistency can be lazy, not even requiring correct preempt locking (hum, this is debatable, needs careful verification).
Quoted 3 lines
So I'm not exactly sure why such a patch as this is wanted now? Are there any more
xxx_page_statehotspots? (I admit to only looking at page faults, page allocator, and page reclaim).A consolidation of the good parts of both would be interesting.
Quoted 8 lines
I don't see much point in Christoph's naming change to "
event_counter", why are you doing that?And follows an addition to your's mm-page_state-opt-docs.patch. Still need to verify "
nr_dirty" and "nr_unstable".Happy new year!
Thanks, happy new year to you too!
Signature · 11 lines
SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Nick Piggin
So I'm not exactly sure why such a patch as this is wanted now? Are there any more
xxx_page_statehotspots? (I admit to only looking at page faults, page allocator, and page reclaim).
The proposed patchset is based on the zoned counter patchset. This means that critical counters have been converted to use different macros. The following discussion of Marcelo and Nick on nr_mapped etc is not relevant to this patch since nr_mapped etc are not event counters but are handled by the zoned counters.
The event counters are the leftover vanity counters that are referenced only for display in /proc and the proposed approach is to only allow increments and allow racy updates.
Then these lightweight counters are also used to optimize away the numa specific counters in the per cpu structures.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>