mirror_ubuntu-kernels/include/linux
Christoph Lameter f6ac2354d7 [PATCH] zoned vm counters: create vmstat.c/.h from page_alloc.c/.h
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
V4 http://marc.theaimsgroup.com/?l=linux-kernel&m=115024767318740&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.

This patch:

Move counter code from page_alloc.c/page-flags.h to vmstat.c/h.

Create vmstat.c/vmstat.h by separating the counter code and the proc
functions.

Move the vm_stat_text array before zoneinfo_show.

[akpm@osdl.org: s390 build fix]
[akpm@osdl.org: HOTPLUG_CPU build fix]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-30 11:25:34 -07:00
..
amba
byteorder
dvb
hdlc
isdn [PATCH] i4l: remove unneeded include/linux/isdn/tpam.h 2006-06-29 10:26:21 -07:00
lockd
mmc
mtd
netfilter
netfilter_arp
netfilter_bridge
netfilter_ipv4
netfilter_ipv6
nfsd
raid [PATCH] md: Don't write dirty/clean update to spares - leave them alone 2006-06-26 09:58:39 -07:00
spi [PATCH] SPI: infrastructure to initialize spi_device.mode early 2006-06-28 15:51:01 -07:00
sunrpc spelling fixes 2006-06-26 18:35:02 +02:00
tc_act
tc_ematch
usb
8250_pci.h
a.out.h
ac97_codec.h [PATCH] ac97_codec: make bitfield unsigned 2006-06-28 14:59:06 -07:00
acct.h
acpi.h [PATCH] pgdat allocation for new node add (get node id by acpi) 2006-06-27 17:32:36 -07:00
adb.h
adfs_fs_i.h
adfs_fs_sb.h
adfs_fs.h
affs_fs.h
affs_hardblocks.h
agp_backend.h
agpgart.h
aio_abi.h
aio.h
amifd.h
amifdreg.h
amigaffs.h
apm_bios.h
arcdevice.h
arcfb.h
ata.h
atalk.h
atm_eni.h
atm_he.h
atm_idt77105.h
atm_nicstar.h
atm_suni.h
atm_tcp.h
atm_zatm.h
atm.h
atmapi.h
atmarp.h
atmbr2684.h
atmclip.h
atmdev.h [ATM]: basic sysfs support for ATM devices 2006-06-29 16:58:19 -07:00
atmioc.h
atmlec.h
atmmpc.h
atmppp.h
atmsap.h
atmsvc.h
attribute_container.h
audit.h
auto_fs4.h
auto_fs.h
auxvec.h
awe_voice.h
ax25.h
b1lli.h
b1pcmcia.h
backing-dev.h
backlight.h
baycom.h
bcd.h
bfs_fs.h
binfmts.h
bio.h
bit_spinlock.h
bitmap.h [PATCH] x86_64: Optimize bitmap_weight for small bitmaps 2006-06-26 10:48:16 -07:00
bitops.h
blkdev.h
blkpg.h
blktrace_api.h
blockgroup_lock.h
bootmem.h
bpqether.h
buffer_head.h [PATCH] fs/buffer.c: cleanups 2006-06-27 17:32:38 -07:00
cache.h
calc64.h
capability.h
capi.h
cciss_ioctl.h
cd1400.h
cdev.h
cdk.h
cdrom.h
chio.h
circ_buf.h
clk.h
clocksource.h [PATCH] fix and optimize clock source update 2006-06-26 09:58:21 -07:00
cm4000_cs.h
cn_proc.h
cobalt-nvram.h
coda_cache.h
coda_fs_i.h
coda_linux.h [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
coda_proc.h
coda_psdev.h
coda.h
coff.h
com20020.h
compat_ioctl.h [PATCH] devfs: Remove devfs from the kernel tree 2006-06-26 12:25:05 -07:00
compat.h [PATCH] x86_64: Add compat_printk and sysctl to turn off compat layer warnings 2006-06-26 10:48:16 -07:00
compiler-gcc3.h
compiler-gcc4.h
compiler-gcc.h
compiler-intel.h
compiler.h
completion.h
comstats.h
concap.h
config.h
configfs.h
connector.h
console_struct.h
console.h [PATCH] VT binding: Add binding/unbinding support for the VT console 2006-06-26 09:58:33 -07:00
consolemap.h
cpu.h [PATCH] cpu hotplug: add hotplug versions of cpu_notifier 2006-06-27 17:32:41 -07:00
cpufreq.h
cpumask.h
cpuset.h
cramfs_fs_sb.h
cramfs_fs.h
crash_dump.h
crc16.h
crc32.h
crc32c.h
crc-ccitt.h
crypto.h [CRYPTO] api: Removed const from cra_name/cra_driver_name 2006-06-26 17:34:40 +10:00
cryptohash.h
ctype.h
cuda.h
cyclades.h
cyclomx.h
cycx_cfm.h
cycx_drv.h
cycx_x25.h
dcache.h
dccp.h
dcookies.h
debugfs.h
delay.h
device-mapper.h [PATCH] dm: improve error message consistency 2006-06-26 09:58:36 -07:00
device.h
devpts_fs.h
dio.h
dirent.h
divert.h
dm9000.h
dm-ioctl.h [PATCH] dm: prevent removal if open 2006-06-26 09:58:36 -07:00
dma-mapping.h
dmaengine.h [PATCH] Remove gratuitous inclusion of <linux/config.h> from <linux/dmaengine.h> 2006-06-27 17:32:39 -07:00
dmapool.h
dmi.h
dn.h
dnotify.h
dqblk_v1.h
dqblk_v2.h
dqblk_xfs.h
ds1286.h
ds1742rtc.h
ds17287rtc.h
dtlk.h
edd.h
efi.h
efs_dir.h
efs_fs_i.h
efs_fs_sb.h
efs_fs.h [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
efs_vh.h
eisa.h
elevator.h
elf-em.h elf-em.h: Define and explain both EM_MIPS_RS3_LE and EM_MIPS_RS4_BE. 2006-06-29 21:10:50 +01:00
elf-fdpic.h
elf.h
elfcore.h
err.h
errno.h
errqueue.h
etherdevice.h
ethtool.h
eventpoll.h
ext2_fs_sb.h
ext2_fs.h
ext3_fs_i.h
ext3_fs_sb.h
ext3_fs.h
ext3_jbd.h
fadvise.h
fb.h [PATCH] devfs: Remove the devfs_fs_kernel.h file from the tree 2006-06-26 12:25:08 -07:00
fcdevice.h
fcntl.h
fd1772.h
fd.h
fddidevice.h
fdreg.h
file.h
filter.h
firmware.h
flat.h
font.h
fs_enet_pd.h
fs_struct.h
fs_uart_pd.h
fs.h [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
fsl_devices.h
fsnotify.h
ftape-header-segment.h
ftape-vendors.h
ftape.h
fuse.h
futex.h [PATCH] pi-futex: futex_lock_pi/futex_unlock_pi support 2006-06-27 17:32:47 -07:00
gameport.h
gen_stats.h
genalloc.h
generic_serial.h
genetlink.h
genhd.h [PATCH] devfs: Remove the gendisk devfs_name field as it's no longer needed 2006-06-26 12:25:08 -07:00
gfp.h
gigaset_dev.h
hardirq.h
harrier_defs.h
hash.h
hayesesp.h
hdlc.h
hdlcdrv.h
hdpu_features.h
hdreg.h
hdsmart.h
hiddev.h
highmem.h
highuid.h
hil_mlc.h
hil.h
hippidevice.h
hp_sdc.h
hpet.h
hpfs_fs.h
hrtimer.h
hugetlb.h
hw_random.h [PATCH] Add new generic HW RNG core 2006-06-26 09:58:19 -07:00
hwmon-sysfs.h
hwmon-vid.h
hwmon.h
hysdn_if.h
i2c-algo-bit.h
i2c-algo-ite.h
i2c-algo-pca.h
i2c-algo-pcf.h
i2c-algo-sgi.h
i2c-algo-sibyte.h
i2c-dev.h
i2c-id.h
i2c-isa.h
i2c-ocores.h
i2c-pxa.h
i2c.h
i2o-dev.h
i2o.h
i8k.h
ibmtr.h
icmp.h
icmpv6.h
ide.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/devfs-2.6 2006-06-29 14:19:21 -07:00
idr.h [PATCH] lib: add idr_replace 2006-06-26 09:58:34 -07:00
if_arcnet.h
if_arp.h
if_bonding.h
if_bridge.h
if_cablemodem.h
if_ec.h
if_eql.h
if_ether.h
if_fc.h
if_fddi.h
if_frad.h
if_hippi.h
if_infiniband.h
if_ltalk.h
if_packet.h
if_plip.h
if_ppp.h
if_pppox.h
if_shaper.h
if_slip.h
if_strip.h
if_tr.h
if_tun.h
if_tunnel.h
if_vlan.h
if_wanpipe_common.h
if_wanpipe.h
if.h
igmp.h
in6.h
in_route.h
in.h
inet_diag.h
inet.h
inetdevice.h
init_task.h [PATCH] pi-futex: rt mutex core 2006-06-27 17:32:47 -07:00
init.h
initrd.h
inotify.h
input.h
interrupt.h [PATCH] genirq: add irq-wake (power-management) support 2006-06-29 10:26:24 -07:00
io.h
ioc3.h
ioc4.h
ioctl32.h
ioctl.h
ioport.h Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-29 10:49:17 -07:00
ioprio.h
ip6_tunnel.h
ip_mp_alg.h
ip.h
ipc.h
ipmi_msgdefs.h
ipmi_smi.h
ipmi.h [PATCH] drivers/char/ipmi/ipmi_msghandler.c: make proc_ipmi_root static 2006-06-27 17:32:48 -07:00
ipsec.h
ipv6_route.h
ipv6.h
ipx.h
irda.h
irq_cpustat.h
irq.h [PATCH] genirq: add chip->eoi(), fastack -> fasteoi 2006-06-29 10:26:26 -07:00
irqreturn.h
isa.h
isapnp.h
isdn_divertif.h
isdn_ppp.h
isdn.h
isdnif.h
isicom.h
iso_fs.h
istallion.h
ite_gpio.h
ixjuser.h
jbd.h
jffs2.h [JFFS2][XATTR] using 'delete marker' for xdatum/xref deletion 2006-06-27 16:16:26 +01:00
jffs.h
jhash.h
jiffies.h
journal-head.h
joystick.h
kallsyms.h
kbd_diacr.h
kbd_kern.h [PATCH] remove active field from tty buffer structure 2006-06-28 14:59:05 -07:00
kd.h
kdev_t.h
kernel_stat.h
kernel.h [PATCH] x86_64: reliable stack trace support 2006-06-26 10:48:17 -07:00
kernelcapi.h
kexec.h
key-ui.h
key.h [PATCH] Keys: Allow in-kernel key requestor to pass auxiliary data to upcaller 2006-06-29 10:26:20 -07:00
keyboard.h
keyctl.h
kfifo.h
klist.h
kmalloc_sizes.h
kmod.h
kobj_map.h
kobject.h
kprobes.h
kref.h
kthread.h
ktime.h
lapb.h
lcd.h
leds.h
libata.h [PATCH] libata: implement ata_port_max_devices() 2006-06-26 20:59:27 -04:00
libps2.h
license.h
limits.h
linkage.h
linux_logo.h
list.h [PATCH] add poison.h and patch primary users 2006-06-27 17:32:38 -07:00
llc.h
loop.h Revert "[PATCH] kthread: update loop.c to use kthread" 2006-06-26 11:55:42 -07:00
lp.h
m41t00.h
m48t86.h
major.h
matroxfb.h
mbcache.h
mc6821.h
mc146818rtc.h
mca-legacy.h
mca.h
memory_hotplug.h [PATCH] pgdat allocation and update for ia64 of memory hotplug: allocate pgdat and per node data 2006-06-27 17:32:37 -07:00
memory.h
mempolicy.h
mempool.h
meye.h
migrate.h
mii.h
minix_fs.h
miscdevice.h [PATCH] devfs: Remove the miscdevice devfs_name field as it's no longer needed 2006-06-26 12:25:08 -07:00
mm_inline.h
mm.h [PATCH] zoned vm counters: create vmstat.c/.h from page_alloc.c/.h 2006-06-30 11:25:34 -07:00
mman.h
mmtimer.h
mmzone.h
mod_devicetable.h
module.h [PATCH] Add EXPORT_UNUSED_SYMBOL and EXPORT_UNUSED_SYMBOL_GPL 2006-06-28 14:59:04 -07:00
moduleloader.h
moduleparam.h
mount.h
mpage.h
mqueue.h
mroute.h
msdos_fs.h
msg.h
mtio.h
mutex-debug.h
mutex.h
mv643xx.h
n_r3964.h
namei.h
namespace.h
nbd.h
ncp_fs_i.h
ncp_fs_sb.h
ncp_fs.h
ncp_mount.h
ncp_no.h
ncp.h
net.h [AF_UNIX]: Datagram getpeersec 2006-06-29 16:58:06 -07:00
netdevice.h [NET]: Add ECN support for TSO 2006-06-29 16:58:08 -07:00
netfilter_arp.h
netfilter_bridge.h
netfilter_decnet.h
netfilter_ipv4.h
netfilter_ipv6.h
netfilter_logging.h
netfilter.h
netlink.h
netpoll.h [NET] netpoll: break recursive loop in netpoll rx path 2006-06-26 00:04:27 -07:00
netrom.h
nfs2.h
nfs3.h
nfs4_acl.h
nfs4_mount.h
nfs4.h
nfs_fs_i.h
nfs_fs_sb.h
nfs_fs.h [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
nfs_idmap.h
nfs_mount.h
nfs_page.h
nfs_xdr.h
nfs.h
nfsacl.h
nfsd_idmap.h
nls.h
nmi.h
node.h [PATCH] node hotplug: register cpu: remove node struct 2006-06-27 17:32:37 -07:00
nodemask.h
notifier.h
nsc_gpio.h [PATCH] chardev: GPIO for SCx200 & PC-8736x: use dev_dbg in common module 2006-06-27 17:32:43 -07:00
nubus.h
numa.h
nvram.h
openprom_fs.h
oprofile.h
page-flags.h [PATCH] zoned vm counters: create vmstat.c/.h from page_alloc.c/.h 2006-06-30 11:25:34 -07:00
pagemap.h
pagevec.h
param.h
parport_pc.h
parport.h
parser.h
patchkey.h
pci_ids.h [PATCH] ata: add some NVIDIA chipset IDs 2006-06-26 20:59:28 -04:00
pci_regs.h
pci-acpi.h
pci.h [PATCH] 64bit resource: change pci core and arch code to use resource_size_t 2006-06-27 09:24:00 -07:00
pcieport_if.h
percpu_counter.h
percpu.h
personality.h
pfkeyv2.h
pfn.h
pg.h
phonedev.h
phy.h
pid.h
pipe_fs_i.h
pkt_cls.h
pkt_sched.h
pktcdvd.h
platform_device.h
plist.h [PATCH] Fix plist include dependency 2006-06-28 15:54:27 -07:00
pm_legacy.h
pm.h
pmu.h
pnp.h [PATCH] 64bit resource: change pnp core to use resource_size_t 2006-06-27 09:24:00 -07:00
pnpbios.h
poison.h [PATCH] poison: add & use more constants 2006-06-27 17:32:38 -07:00
poll.h
posix_acl_xattr.h
posix_acl.h
posix_types.h
posix-timers.h
ppdev.h
ppp_channel.h
ppp_defs.h
ppp-comp.h
prctl.h
preempt.h
prefetch.h
prio_tree.h
proc_fs.h [PATCH] proc: Use struct pid not struct task_ref 2006-06-26 09:58:26 -07:00
profile.h
ps2esdi.h
ptrace.h [PATCH] coredump: kill ptrace related stuff 2006-06-26 09:58:27 -07:00
qic117.h
qnx4_fs.h
qnxtypes.h
quota.h
quotaio_v1.h
quotaio_v2.h
quotaops.h
radeonfb.h
radix-tree.h
raid_class.h
ramfs.h
random.h
raw.h
rbtree.h
rcupdate.h [PATCH] rcutorture: add call_rcu_bh() operations 2006-06-27 17:32:40 -07:00
reboot_fixups.h
reboot.h
reiserfs_acl.h
reiserfs_fs_i.h
reiserfs_fs_sb.h
reiserfs_fs.h [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
reiserfs_xattr.h
relay.h
resource.h
resume-trace.h
rio_drv.h
rio_ids.h
rio_regs.h
rio.h
rmap.h
romfs_fs.h
root_dev.h
rose.h
route.h
rslib.h
rtc-v3020.h
rtc.h
rtmutex.h [PATCH] pi-futex: rt mutex debug 2006-06-27 17:32:47 -07:00
rtnetlink.h
rwsem-spinlock.h
rwsem.h
sc26198.h
scatterlist.h
scc.h
sched.h [PATCH] rtmutex: Propagate priority settings into PI lock chains 2006-06-27 17:32:48 -07:00
screen_info.h
sctp.h
scx200_gpio.h [PATCH] chardev: GPIO for SCx200 & PC-8736x: device minor numbers are unsigned ints 2006-06-27 17:32:42 -07:00
scx200.h [PATCH] chardev: GPIO for SCx200 & PC-8736x: whitespace pre-clean 2006-06-27 17:32:42 -07:00
sdla_fr.h
sdla.h
seccomp.h
securebits.h
security.h [NETLINK]: Encapsulate eff_cap usage within security framework. 2006-06-29 16:57:55 -07:00
selection.h
selinux_netlink.h
selinux.h
sem.h
seq_file.h
seqlock.h
serial167.h
serial_8250.h
serial_core.h [PATCH] devfs: Remove devfs support from the serial subsystem 2006-06-26 12:25:05 -07:00
serial_ip3106.h
serial_reg.h
serial.h
serialP.h
serio.h
shm.h
shmem_fs.h
signal.h
skbuff.h [NET]: make skb_release_data() static 2006-06-29 16:58:30 -07:00
slab.h
smb_fs_i.h
smb_fs_sb.h
smb_fs.h
smb_mount.h
smb.h
smbno.h
smp_lock.h
smp.h
snmp.h
socket.h
sockios.h
som.h
sonet.h
sonypi.h
sort.h
sound.h
soundcard.h
spinlock_api_smp.h
spinlock_api_up.h
spinlock_types_up.h
spinlock_types.h
spinlock_up.h
spinlock.h
stallion.h
stat.h
statfs.h
stddef.h
stop_machine.h
string.h
stringify.h
superhyway.h
suspend.h
swap.h [PATCH] pgdat allocation for new node add (export kswapd start func) 2006-06-27 17:32:36 -07:00
swapops.h
synclink.h
sys.h
syscalls.h [PATCH] pi-futex: futex code cleanups 2006-06-27 17:32:46 -07:00
sysctl.h [PATCH] pi-futex: rt mutex core 2006-06-27 17:32:47 -07:00
sysdev.h
sysfs.h
sysrq.h
sysv_fs.h
tcp.h
telephony.h
termios.h
textsearch_fsm.h
textsearch.h
tfrc.h
thread_info.h
threads.h
ticable.h
time.h Merge branch 'x86-64' 2006-06-26 10:51:09 -07:00
timer.h
times.h
timex.h [PATCH] fix and optimize clock source update 2006-06-26 09:58:21 -07:00
tiocl.h
tipc_config.h
tipc.h
topology.h [PATCH] sched: mc/smt power savings sched policy 2006-06-27 17:32:45 -07:00
toshiba.h
transport_class.h
trdevice.h
tty_driver.h [PATCH] devfs: Rename TTY_DRIVER_NO_DEVFS to TTY_DRIVER_DYNAMIC_DEV 2006-06-26 12:25:09 -07:00
tty_flip.h [PATCH] remove active field from tty buffer structure 2006-06-28 14:59:05 -07:00
tty_ldisc.h
tty.h [PATCH] remove active field from tty buffer structure 2006-06-28 14:59:05 -07:00
types.h [PATCH] 64bit Resource: finally enable 64bit resource sizes 2006-06-27 09:24:00 -07:00
uaccess.h
udf_fs_i.h
udf_fs_sb.h
udf_fs.h
udp.h
ufs_fs_i.h
ufs_fs_sb.h
ufs_fs.h [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
uinput.h
uio.h
ultrasound.h
umem.h
un.h
unistd.h
unwind.h [PATCH] x86_64: allow unwinder to build without module support 2006-06-26 10:48:18 -07:00
usb_ch9.h
usb_gadget.h
usb_gadgetfs.h
usb_otg.h
usb_usual.h
usb.h
usbdevice_fs.h
user.h
utime.h
uts.h
utsname.h
vermagic.h
vfs.h
via.h
video_decoder.h
video_encoder.h
videodev2.h V4L/DVB (4223): Add V4L2_CID_MPEG_STREAM_VBI_FMT control 2006-06-26 09:21:45 -03:00
videodev.h
videotext.h
vmalloc.h
vmstat.h [PATCH] zoned vm counters: create vmstat.c/.h from page_alloc.c/.h 2006-06-30 11:25:34 -07:00
vt_buffer.h
vt_kern.h
vt.h
wait.h
wanrouter.h
watchdog.h
wavefront.h
wireless.h
workqueue.h
writeback.h
x25.h
xattr.h
xfrm.h
yam.h
zconf.h
zftape.h
zlib.h
zorro_ids.h
zorro.h
zutil.h