linux/fs
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
..
9p [PATCH] v9fs: fix fid check in v9fs_create 2006-06-28 14:59:05 -07:00
adfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
affs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
afs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
autofs [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
autofs4 [PATCH] fs: use list_move() 2006-06-26 09:58:18 -07:00
befs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
bfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
cifs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
coda Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/devfs-2.6 2006-06-29 14:19:21 -07:00
configfs configfs: Clear up a few extra spaces where there should be TABs. 2006-06-29 14:43:01 -07:00
cramfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
debugfs Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2006-06-24 13:07:53 -04:00
devpts [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
efs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
exportfs [PATCH] NFS server subtree_check returns dubious value 2006-05-21 12:59:16 -07:00
ext2 [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
ext3 [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
fat [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
freevxfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
fuse [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
hfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
hfsplus [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
hostfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
hpfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
hppfs [PATCH] VFS: Permit filesystem to perform statfs with a known root dentry 2006-06-23 07:42:45 -07:00
hugetlbfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
isofs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
jbd [PATCH] add poison.h and patch primary users 2006-06-27 17:32:38 -07:00
jffs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
jffs2 [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
jfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
lockd NLM: Fix reclaim races 2006-06-09 09:40:27 -04:00
minix [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
msdos [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
ncpfs [PATCH] Light weight event counters 2006-06-30 11:25:36 -07:00
nfs [PATCH] zoned vm counters: conversion of nr_unstable to per zone counter 2006-06-30 11:25:36 -07:00
nfs_common [PATCH] nfsacl: Solaris VxFS compatibility fix 2005-10-11 09:46:54 -07:00
nfsd [PATCH] spin/rwlock init cleanups 2006-06-27 17:32:39 -07:00
nls [PATCH] fs: Use ARRAY_SIZE macro 2006-03-24 07:33:19 -08:00
ntfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
ocfs2 ocfs2: remove redundant NULL checks in ocfs2_direct_IO_get_blocks() 2006-06-29 16:13:35 -07:00
openpromfs [OPENPROMFS]: Rewrite using in-kernel device tree and seq_file. 2006-06-25 23:19:14 -07:00
partitions [PATCH] devfs: Remove the devfs_fs_kernel.h file from the tree 2006-06-26 12:25:08 -07:00
proc [PATCH] zoned vm counters: conversion of nr_bounce to per zone counter 2006-06-30 11:25:36 -07:00
qnx4 [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
ramfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
reiserfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
romfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
smbfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
sysfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
sysv [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
udf [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
ufs [PATCH] ufs: printk() fix 2006-06-29 10:26:20 -07:00
vfat [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
xfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
Kconfig ocfs2: OCFS2_FS must depend on SYSFS 2006-06-29 14:56:12 -07:00
Kconfig.binfmt [PATCH] frv: suppress configuration of certain features for FRV 2006-01-08 20:13:36 -08:00
Makefile [PATCH] devfs: Remove devfs from the kernel tree 2006-06-26 12:25:05 -07:00
aio.c spelling fixes 2006-06-26 18:35:02 +02:00
attr.c [PATCH] capable/capability.h (fs/) 2006-01-11 18:42:13 -08:00
bad_inode.c [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
binfmt_aout.c [PATCH] dump_thread() cleanup 2006-01-10 08:01:25 -08:00
binfmt_elf.c [PATCH] binflt_elf: remove more casts 2006-06-23 07:43:05 -07:00
binfmt_elf_fdpic.c [PATCH] frv: binfmt_elf_fdpic __user annotations 2006-06-23 07:42:54 -07:00
binfmt_em86.c
binfmt_flat.c [PATCH] uclinux: use PER_LINUX_32BIT in binfmt_flat 2006-06-25 21:04:24 -07:00
binfmt_misc.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2006-06-24 13:07:53 -04:00
binfmt_script.c
binfmt_som.c
bio.c [PATCH] Fix missing ret assignment in __bio_map_user() error path 2006-06-17 10:52:12 -07:00
block_dev.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/devfs-2.6 2006-06-29 14:19:21 -07:00
buffer.c [PATCH] zoned vm counters: conversion of nr_dirty to per zone counter 2006-06-30 11:25:35 -07:00
char_dev.c [PATCH] devfs: Remove the devfs_fs_kernel.h file from the tree 2006-06-26 12:25:08 -07:00
compat.c [PATCH] x86_64: Add compat_printk and sysctl to turn off compat layer warnings 2006-06-26 10:48:16 -07:00
compat_ioctl.c [PATCH] devfs: Remove devfs from the kernel tree 2006-06-26 12:25:05 -07:00
dcache.c [PATCH] core: use list_move() 2006-06-26 09:58:17 -07:00
dcookies.c [PATCH] Use __read_mostly on some hot fs variables 2006-03-26 08:56:56 -08:00
direct-io.c [PATCH] Kill PF_SYNCWRITE flag 2006-06-23 17:10:39 +02:00
dnotify.c [PATCH] Use __read_mostly on some hot fs variables 2006-03-26 08:56:56 -08:00
dquot.c [PATCH] use list_add_tail() instead of list_add() 2006-06-26 09:58:17 -07:00
drop_caches.c [PATCH] drop-pagecache 2006-01-08 20:12:40 -08:00
eventpoll.c [PATCH] epoll: use unlocked wqueue operations 2006-06-25 10:01:13 -07:00
exec.c [PATCH] coredump: shutdown current process first 2006-06-26 09:58:27 -07:00
fcntl.c BUG_ON() Conversion in fs/fcntl.c 2006-04-02 13:37:19 +02:00
fifo.c [PATCH] pipe.c/fifo.c code cleanups 2006-04-11 13:53:33 +02:00
file.c [PATCH] for_each_possible_cpu: fixes for generic part 2006-03-28 09:16:05 -08:00
file_table.c [PATCH] percpu counter data type changes to suppport more than 2**31 ext3 free blocks counter 2006-06-23 07:43:06 -07:00
filesystems.c
fs-writeback.c [PATCH] zoned vm counters: conversion of nr_unstable to per zone counter 2006-06-30 11:25:36 -07:00
inode.c [PATCH] Light weight event counters 2006-06-30 11:25:36 -07:00
inotify.c [PATCH] inotify (4/5): allow watch removal from event handler 2006-06-20 05:25:19 -04:00
inotify_user.c [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
ioctl.c [PATCH] capable/capability.h (fs/) 2006-01-11 18:42:13 -08:00
ioprio.c [PATCH] lsm: add task_setioprio hook 2006-06-23 07:42:53 -07:00
libfs.c [PATCH] core: use list_move() 2006-06-26 09:58:17 -07:00
locks.c [PATCH] fs/locks.c: make posix_locks_deadlock() static 2006-06-23 07:43:03 -07:00
mbcache.c [PATCH] Typo fixes 2006-03-28 09:16:08 -08:00
mpage.c [PATCH] writeback: fix range handling 2006-06-23 07:42:49 -07:00
namei.c [PATCH] Implement AT_SYMLINK_FOLLOW flag for linkat 2006-06-25 10:01:22 -07:00
namespace.c [PATCH] core: use list_move() 2006-06-26 09:58:17 -07:00
nfsctl.c [PATCH] fs: Use ARRAY_SIZE macro 2006-03-24 07:33:19 -08:00
open.c [PATCH] ftruncate does not always update m/ctime 2006-06-25 10:01:15 -07:00
pipe.c [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
pnode.c [PATCH] core: use list_move() 2006-06-26 09:58:17 -07:00
pnode.h
posix_acl.c
quota.c [PATCH] sem2mutex: quota 2006-03-23 07:38:11 -08:00
quota_v1.c
quota_v2.c [PATCH] sem2mutex: quota 2006-03-23 07:38:11 -08:00
read_write.c [PATCH] splice: unlikely() optimizations 2006-04-11 13:56:09 +02:00
readdir.c [PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem 2006-01-09 15:59:24 -08:00
select.c [PATCH] fs: sys_poll with timeout -1 bug fix 2006-06-25 10:01:22 -07:00
seq_file.c [PATCH] sem2mutex: fs/seq_file.c 2006-03-23 07:38:12 -08:00
splice.c [PATCH] splice: retrieve mapping after locking the page 2006-06-23 17:10:39 +02:00
stat.c [PATCH] powerpc: Wire up *at syscalls 2006-04-28 21:04:59 +10:00
super.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2006-06-24 13:07:53 -04:00
sync.c [PATCH] writeback: fix range handling 2006-06-23 07:42:49 -07:00
xattr.c [PATCH] log more info for directory entry change events 2006-06-20 05:25:28 -04:00
xattr_acl.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00