linux/arch
Christoph Lameter f8891e5e1f [PATCH] Light weight event counters
The remaining counters in page_state after the zoned VM counter patches
have been applied are all just for show in /proc/vmstat.  They have no
essential function for the VM.

We use a simple increment of per cpu variables.  In order to avoid the most
severe races we disable preempt.  Preempt does not prevent the race between
an increment and an interrupt handler incrementing the same statistics
counter.  However, that race is exceedingly rare, we may only loose one
increment or so and there is no requirement (at least not in kernel) that
the vm event counters have to be accurate.

In the non preempt case this results in a simple increment for each
counter.  For many architectures this will be reduced by the compiler to a
single instruction.  This single instruction is atomic for i386 and x86_64.
 And therefore even the rare race condition in an interrupt is avoided for
both architectures in most cases.

The patchset also adds an off switch for embedded systems that allows a
building of linux kernels without these counters.

The implementation of these counters is through inline code that hopefully
results in only a single instruction increment instruction being emitted
(i386, x86_64) or in the increment being hidden though instruction
concurrency (EPIC architectures such as ia64 can get that done).

Benefits:
- VM event counter operations usually reduce to a single inline instruction
  on i386 and x86_64.
- No interrupt disable, only preempt disable for the preempt case.
  Preempt disable can also be avoided by moving the counter into a spinlock.
- Handling is similar to zoned VM counters.
- Simple and easily extendable.
- Can be omitted to reduce memory use for embedded use.

References:

RFC http://marc.theaimsgroup.com/?l=linux-kernel&m=113512330605497&w=2
RFC http://marc.theaimsgroup.com/?l=linux-kernel&m=114988082814934&w=2
local_t http://marc.theaimsgroup.com/?l=linux-kernel&m=114991748606690&w=2
V2 http://marc.theaimsgroup.com/?t=115014808400007&r=1&w=2
V3 http://marc.theaimsgroup.com/?l=linux-kernel&m=115024767022346&w=2
V4 http://marc.theaimsgroup.com/?l=linux-kernel&m=115047968808926&w=2

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-30 11:25:36 -07:00
..
alpha Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-29 10:49:17 -07:00
arm [PATCH] zoned vm counters: conversion of nr_pagetables to per zone counter 2006-06-30 11:25:35 -07:00
arm26 [PATCH] No arch-specific strpbrk implementations 2006-04-11 06:18:40 -07:00
cris Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/devfs-2.6 2006-06-29 14:19:21 -07:00
frv [PATCH] 64bit resource: change pci core and arch code to use resource_size_t 2006-06-27 09:24:00 -07:00
h8300 [PATCH] fix incorrect SA_ONSTACK behaviour for 64-bit processes 2006-06-23 07:43:05 -07:00
i386 [PATCH] zoned vm counters: conversion of nr_writeback to per zone counter 2006-06-30 11:25:35 -07:00
ia64 [PATCH] zoned vm counters: basic ZVC (zoned vm counter) implementation 2006-06-30 11:25:34 -07:00
m32r [PATCH] genirq: rename desc->handler to desc->chip 2006-06-29 10:26:21 -07:00
m68k [PATCH] arch: use list_move() 2006-06-26 09:58:17 -07:00
m68knommu Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-29 10:49:17 -07:00
mips Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus 2006-06-29 13:44:45 -07:00
parisc Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6 2006-06-29 11:30:45 -07:00
powerpc [PATCH] KConfig: Spellchecking 'similarity' and 'independent' 2006-06-29 11:59:14 -07:00
ppc Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/devfs-2.6 2006-06-29 14:19:21 -07:00
s390 [PATCH] Light weight event counters 2006-06-30 11:25:36 -07:00
sh Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/devfs-2.6 2006-06-29 14:19:21 -07:00
sh64 Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-29 10:49:17 -07:00
sparc [PATCH] zoned vm counters: conversion of nr_pagecache to per zone counter 2006-06-30 11:25:34 -07:00
sparc64 [PATCH] zoned vm counters: conversion of nr_pagecache to per zone counter 2006-06-30 11:25:34 -07:00
um [PATCH] zoned vm counters: conversion of nr_pagetables to per zone counter 2006-06-30 11:25:35 -07:00
v850 Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-29 10:49:17 -07:00
x86_64 [NET]: make skb_release_data() static 2006-06-29 16:58:30 -07:00
xtensa Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-29 10:49:17 -07:00