public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/21] Zoned VM counters V3
@ 2006-06-12 21:12 Christoph Lameter
  2006-06-12 21:12 ` [PATCH 01/21] Create vmstat.c/.h from page_alloc.c/.h Christoph Lameter
                   ` (20 more replies)
  0 siblings, 21 replies; 39+ messages in thread
From: Christoph Lameter @ 2006-06-12 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, Hugh Dickins, Con Kolivas, Marcelo Tosatti, Nick Piggin,
	linux-mm, Andi Kleen, Dave Chinner, Christoph Lameter

NOTE: This is *not* the lightweight event counter patchset where we
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.


^ permalink raw reply	[flat|nested] 39+ messages in thread
* [PATCH 00/21] Zoned VM counters V4
@ 2006-06-14  1:02 Christoph Lameter
  2006-06-14  1:02 ` [PATCH 04/21] swap_prefetch: Convert nr_mapped to ZVC Christoph Lameter
  0 siblings, 1 reply; 39+ messages in thread
From: Christoph Lameter @ 2006-06-14  1:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Con Kolivas, Christoph Lameter, Dave Chinner

NOTE: ZVC are *not* the lightweight event counters. ZVCs are
reliable whereas event counters do not need to be.

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
V3 http://marc.theaimsgroup.com/?l=linux-kernel&m=115014697910351&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.

V3->V4:
- nr_pagecache definition was not cleaned up in V3.
- Fix nfs issues with NR_UNSTABLE where the page reference was not valid
  and with NR_DIRTY.
- Update swap_prefetch patches after feedback from Colin.
- Rename NR_STAT_ITEMS to NR_VM_ZONE_STAT_ITEMS.
- IA64: Make CONFIG_DMA_IS_NORMAL depend on SGI_SN2. Others
  may be added in the future.
- Fix order issues with vmstat
- Limit crossposting


The patchset consists of 21 patches that are following this one and is
against a temp patch against 2.6.17-rc6 at
http://www.zip.com.au/~akpm/linux/patches/stuff/cl.bz2
plus a small fix from http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff_plain;h=440a733fe2e9ea3d1374d4fd72e7bba60e268e05;hp=4649a63a8cb6f9c3892e92538b394f754295a90e


^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2006-06-14 16:15 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-12 21:12 [PATCH 00/21] Zoned VM counters V3 Christoph Lameter
2006-06-12 21:12 ` [PATCH 01/21] Create vmstat.c/.h from page_alloc.c/.h Christoph Lameter
2006-06-12 21:12 ` [PATCH 02/21] Basic ZVC (zoned vm counter) implementation Christoph Lameter
2006-06-13  5:37   ` zoned vm counters: per zone counter functionality Nick Piggin
2006-06-13 15:55     ` Christoph Lameter
2006-06-14  1:21       ` Nick Piggin
2006-06-14  5:37         ` Hugh Dickins
2006-06-14  5:53           ` Andi Kleen
2006-06-14 16:14         ` Christoph Lameter
2006-06-12 21:13 ` [PATCH 03/21] Convert nr_mapped to per zone counter Christoph Lameter
2006-06-12 21:13 ` [PATCH 04/21] swap_prefetch: Convert nr_mapped to ZVC Christoph Lameter
2006-06-12 23:36   ` Con Kolivas
2006-06-12 21:13 ` [PATCH 05/21] Conversion of nr_pagecache to per zone counter Christoph Lameter
2006-06-12 21:13 ` [PATCH 06/21] Remove nr_mapped from scan controls structure Christoph Lameter
2006-06-12 21:13 ` [PATCH 07/21] Split NR_ANON off from NR_MAPPED Christoph Lameter
2006-06-12 21:13 ` [PATCH 08/21] swap_prefetch: Split NR_ANON off NR_MAPPED Christoph Lameter
2006-06-12 23:36   ` Con Kolivas
2006-06-12 21:13 ` [PATCH 09/21] zone_reclaim: remove /proc/sys/vm/zone_reclaim_interval Christoph Lameter
2006-06-12 21:13 ` [PATCH 10/21] Conversion of nr_slab to per zone counter Christoph Lameter
2006-06-12 21:13 ` [PATCH 11/21] swap_prefetch: Conversion of nr_slab to ZVC Christoph Lameter
2006-06-12 21:13 ` [PATCH 12/21] Conversion of nr_pagetables to per zone counter Christoph Lameter
2006-06-12 21:13 ` [PATCH 13/21] Conversion of nr_dirty " Christoph Lameter
2006-06-12 21:13 ` [PATCH 14/21] swap_prefetch: Conversion of nr_dirty to ZVC Christoph Lameter
2006-06-12 23:38   ` Con Kolivas
2006-06-12 21:14 ` [PATCH 15/21] reiser4: Conversiion " Christoph Lameter
2006-06-12 21:14 ` [PATCH 16/21] Conversion of nr_writeback to per zone counter Christoph Lameter
2006-06-12 21:14 ` [PATCH 17/21] swap_prefetch: Conversion of nr_writeback to ZVC Christoph Lameter
2006-06-12 23:38   ` Con Kolivas
2006-06-12 21:14 ` [PATCH 18/21] Conversion of nr_unstable to per zone counter Christoph Lameter
2006-06-12 21:14 ` [PATCH 19/21] swap_prefetch: Conversion of nr_unstable to ZVC Christoph Lameter
2006-06-12 23:40   ` Con Kolivas
2006-06-12 23:48     ` Christoph Lameter
2006-06-12 23:57       ` Con Kolivas
2006-06-12 23:59         ` Con Kolivas
2006-06-13  0:08           ` Christoph Lameter
2006-06-13  0:19             ` Con Kolivas
2006-06-12 21:14 ` [PATCH 20/21] Conversion of nr_bounce to per zone counter Christoph Lameter
2006-06-12 21:14 ` [PATCH 21/21] Remove useless struct wbs Christoph Lameter
  -- strict thread matches above, loose matches on Subject: below --
2006-06-14  1:02 [PATCH 00/21] Zoned VM counters V4 Christoph Lameter
2006-06-14  1:02 ` [PATCH 04/21] swap_prefetch: Convert nr_mapped to ZVC Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox