Skip to content

Zoned VM counters V3

Christoph Lameter linux-mm lkml 1 version In review

Get series with b4
b4 am 20060612211244.20862.41106.sendpatchset@schroedinger.engr.sgi.com

Versions newest first

  1. v1 Latest21 patches 16 repliesIn review

V1->V2 from the cover letter

- Cleanup code, resequence and base patches on 2.6.17-rc6-mm1
- Reduce interrupt holdoffs
- Add zone reclaim interval removal patch

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21Create vmstat.c/.h from page_alloc.c/.hinclude/linux/mm.h include/linux/page-flags.h include/linux/vmstat.h +3 more+555 -5420 replies
2/21Basic ZVC (zoned vm counter) implementationarch/ia64/Kconfig include/linux/mmzone.h include/linux/vmstat.h +3 more+374 -46 replies
3/21Convert nr_mapped to per zone counterarch/i386/mm/pgtable.c drivers/base/node.c fs/proc/proc_misc.c +6 more+16 -150 replies
4/21swap_prefetch: Convert nr_mapped to ZVCmm/swap_prefetch.c+2 -11 reply
5/21Conversion of nr_pagecache to per zone counterarch/s390/appldata/appldata_mem.c arch/sparc/kernel/sys_sunos.c arch/sparc64/kernel/sys_sunos32.c +10 more+16 -610 replies
6/21Remove nr_mapped from scan controls structuremm/vmscan.c+2 -70 replies
7/21Split NR_ANON off from NR_MAPPEDdrivers/base/node.c fs/proc/proc_misc.c include/linux/mmzone.h +4 more+14 -50 replies
8/21swap_prefetch: Split NR_ANON off NR_MAPPEDmm/swap_prefetch.c+1 -01 reply
9/21zone_reclaim: remove /proc/sys/vm/zone_reclaim_intervalDocumentation/sysctl/vm.txt include/linux/mmzone.h include/linux/swap.h +3 more+10 -510 replies
10/21Conversion of nr_slab to per zone counterarch/i386/mm/pgtable.c drivers/base/node.c fs/proc/proc_misc.c +5 more+9 -100 replies
11/21swap_prefetch: Conversion of nr_slab to ZVCmm/swap_prefetch.c+2 -50 replies
12/21Conversion of nr_pagetables to per zone counterarch/arm/mm/mm-armv.c arch/i386/mm/pgtable.c arch/um/kernel/skas/mmu.c +6 more+11 -80 replies
13/21Conversion of nr_dirty to per zone counterarch/i386/mm/pgtable.c drivers/base/node.c fs/buffer.c +8 more+15 -160 replies
14/21swap_prefetch: Conversion of nr_dirty to ZVCmm/swap_prefetch.c+1 -11 reply
15/21reiser4: Conversiion of nr_dirty to ZVCfs/reiser4/as_ops.c fs/reiser4/page_cache.c+2 -20 replies
16/21Conversion of nr_writeback to per zone counterarch/i386/mm/pgtable.c drivers/base/node.c fs/proc/proc_misc.c +5 more+11 -150 replies
17/21swap_prefetch: Conversion of nr_writeback to ZVCmm/swap_prefetch.c+1 -11 reply
18/21Conversion of nr_unstable to per zone counterdrivers/base/node.c fs/fs-writeback.c fs/nfs/write.c +5 more+9 -150 replies
19/21swap_prefetch: Conversion of nr_unstable to ZVCmm/swap_prefetch.c+3 -216 replies
20/21Conversion of nr_bounce to per zone counterdrivers/base/node.c include/linux/mmzone.h mm/highmem.c +1 more+6 -30 replies
21/21Remove useless struct wbsmm/page-writeback.c+33 -510 replies

Reviews trailers per patch

4 of 21 patches have a Reviewed-by or Acked-by.

PatchCon Kolivas
1/21
2/21
3/21
4/21A-b
5/21
6/21
7/21
8/21A-b
9/21
10/21
11/21
12/21
13/21
14/21A-b
15/21
16/21
17/21A-b
18/21
19/21
20/21
21/21

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/21] Zoned VM counters V3

toyed around with local_t and racy updates for event counters.

Zone based VM statistics are necessary to be able to determine what the state of memory in one zone is. In a NUMA system this can be helpful for local reclaim and other memory optimizations that may be able to shift VM load in order to get more balanced memory use.

It is also useful to know how the computing load affects the memory allocations on various zones. This patchset allows the retrieval of that data from userspace.

The patchset introduces a framework for counters that is a cross between the existing page_stats --which are simply global counters split per cpu-- and the approach of deferred incremental updates implemented for nr_pagecache.

Small per cpu 8 bit counters are added to struct zone. If the counter exceeds certain thresholds then the counters are accumulated in an array of atomic_long in the zone and in a global array that sums up all zone values. The small 8 bit counters are next to the per cpu page pointers and so they will be in high in the cpu cache when pages are allocated and freed.

Access to VM counter information for a zone and for the whole machine is then possible by simply indexing an array (Thanks to Nick Piggin for pointing out that approach). The access to the total number of pages of various types does no longer require the summing up of all per cpu counters.

Benefits of this patchset right now:

- Ability for UP and SMP configuration to determine how memory is balanced between the DMA, NORMAL and HIGHMEM zones.

- loops over all processors are avoided in writeback and reclaim paths. We can avoid caching the writeback information because the needed information is directly accessible.

- Special handling for nr_pagecache removed.

- zone_reclaim_interval vanishes since VM stats can now determine when it is worth to do local reclaim.

- Fast inline per node page state determination.

- Accurate counters in /sys/devices/system/node/node*/meminfo. Current counters are counting simply which processor allocated a page somewhere and guestimate based on that. So the counters were not useful to show the actual distribution of page use on a specific zone.

- The swap_prefetch patch requires per node statistics in order to figure out when processors of a node can prefetch. This patch provides some of the needed numbers.

- Detailed VM counters available in more /proc and /sys status files.

References to earlier discussions:
V1 http://marc.theaimsgroup.com/?l=linux-kernel&m=113511649910826&w=2
V2 http://marc.theaimsgroup.com/?l=linux-kernel&m=114980851924230&w=2
Earlier approaches:
http://marc.theaimsgroup.com/?l=linux-kernel&m=113460596414687&w=2

Performance tests with AIM7 did not show any regressions. Seems to be a tad faster even. Tested on ia64/NUMA. Builds fine on i386, SMP / UP. Includes fixes for s390/arm/uml arch code.

Changelog

V1->V2:

- Cleanup code, resequence and base patches on 2.6.17-rc6-mm1
- Reduce interrupt holdoffs
- Add zone reclaim interval removal patch

V2->V3:
- Against temp tree by Andrew. (2.6.17-rc6-mm2 - old patches) Temp patch at http://www.zip.com.au/~akpm/linux/patches/stuff/cl.bz2
- Incorporate additional fixes for arch code.
- Create vmstat.c/h from pieces of page_alloc.c.
- Do the swap prefetch support patches the right way.
- Reorganize patchset so that the tree compiles after each patch (However, swap prefetch/reiser4 patches are separate. So if a swap prefetch patch follows then two patches must be applied for the kernel to compile again).
- Do various prescribed tests. Make sure that there is no remaining reference to page state in some arch code.
- Optimize the node_page_state function so that it can be used inline.

The patchset consists of 21 patches that are following this one.

--
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>