linux_dsm_epyc7002/fs/ncpfs
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
..
dir.c [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
file.c [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
getopt.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
getopt.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
inode.c [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
ioctl.c [PATCH] ncpfs: remove kmalloc wrapper 2006-01-14 18:27:12 -08:00
Kconfig Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmap.c [PATCH] Light weight event counters 2006-06-30 11:25:36 -07:00
ncplib_kernel.c [PATCH] sem2mutex: NCPFS 2006-03-23 07:38:14 -08:00
ncplib_kernel.h [PATCH] shrink dentry struct 2006-01-08 20:13:58 -08:00
ncpsign_kernel.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ncpsign_kernel.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sock.c [PATCH] sem2mutex: NCPFS 2006-03-23 07:38:14 -08:00
symlink.c [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00