linux/Documentation
Andi Kleen 6a46079cf5 HWPOISON: The high level memory error handler in the VM v7
Add the high level memory handler that poisons pages
that got corrupted by hardware (typically by a two bit flip in a DIMM
or a cache) on the Linux level. The goal is to prevent everyone
from accessing these pages in the future.

This done at the VM level by marking a page hwpoisoned
and doing the appropriate action based on the type of page
it is.

The code that does this is portable and lives in mm/memory-failure.c

To quote the overview comment:

High level machine check handler. Handles pages reported by the
hardware as being corrupted usually due to a 2bit ECC memory or cache
failure.

This focuses on pages detected as corrupted in the background.
When the current CPU tries to consume corruption the currently
running process can just be killed directly instead. This implies
that if the error cannot be handled for some reason it's safe to
just ignore it because no corruption has been consumed yet. Instead
when that happens another machine check will happen.

Handles page cache pages in various states. The tricky part
here is that we can access any page asynchronous to other VM
users, because memory failures could happen anytime and anywhere,
possibly violating some of their assumptions. This is why this code
has to be extremely careful. Generally it tries to use normal locking
rules, as in get the standard locks, even if that means the
error handling takes potentially a long time.

Some of the operations here are somewhat inefficient and have non
linear algorithmic complexity, because the data structures have not
been optimized for this case. This is in particular the case
for the mapping from a vma to a process. Since this case is expected
to be rare we hope we can get away with this.

There are in principle two strategies to kill processes on poison:
- just unmap the data and wait for an actual reference before
killing
- kill as soon as corruption is detected.
Both have advantages and disadvantages and should be used
in different situations. Right now both are implemented and can
be switched with a new sysctl vm.memory_failure_early_kill
The default is early kill.

The patch does some rmap data structure walking on its own to collect
processes to kill. This is unusual because normally all rmap data structure
knowledge is in rmap.c only. I put it here for now to keep
everything together and rmap knowledge has been seeping out anyways

Includes contributions from Johannes Weiner, Chris Mason, Fengguang Wu,
Nick Piggin (who did a lot of great work) and others.

Cc: npiggin@suse.de
Cc: riel@redhat.com
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
2009-09-16 11:50:15 +02:00
..
ABI block: Update topology documentation 2009-08-01 10:24:35 +02:00
DocBook docbook: fix printk of ip address 2009-07-30 13:10:50 -07:00
PCI PCI AER: software error injection 2009-06-16 14:30:14 -07:00
RCU rcu: Remove CONFIG_PREEMPT_RCU 2009-08-23 10:32:40 +02:00
accounting Documentation/accounting/getdelays.c intialize the variable before using it 2009-06-16 19:47:51 -07:00
acpi ACPI: update debug parameter documentation 2008-11-07 21:45:29 -05:00
aoe
arm Nicolas Pitre has a new email address 2009-09-15 09:37:12 -07:00
auxdisplay .gitignore updates 2008-10-30 11:38:45 -07:00
blackfin Blackfin arch: Add document about bfin-gpio 2009-01-07 23:14:38 +08:00
block Trivial typo fixes in Documentation/block/data-integrity.txt. 2009-07-01 10:56:25 +02:00
blockdev mflash: initial support 2009-04-07 08:12:38 +02:00
cdrom debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem. 2009-06-15 21:30:28 -07:00
cgroups cpusets: document adding/removing cpus to cpuset elaborately 2009-06-30 18:56:01 -07:00
connector Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-07-23 19:03:51 -07:00
console
cpu-freq [CPUFREQ] minor correction to cpu-freq documentation 2009-06-15 11:49:42 -04:00
cpuidle
cris fix random typos 2008-10-16 11:21:30 -07:00
crypto async_tx, dmaengine: document channel allocation and api rework 2009-01-05 18:10:19 -07:00
development-process docs: Encourage better changelogs in the development process document 2009-06-04 10:32:49 -06:00
device-mapper dm raid1: add userspace log 2009-06-22 10:12:35 +01:00
driver-model driver model: fix show/store prototypes in doc. 2009-07-12 13:02:10 -07:00
dvb V4L/DVB (12206): get_dvb_firmware: Correct errors in MPC718 firmware extraction logic 2009-07-05 19:21:49 -03:00
early-userspace
fault-injection debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem. 2009-06-15 21:30:28 -07:00
fb Documentation/fb/vesafb.txt: fix typo 2009-06-16 19:47:58 -07:00
filesystems HWPOISON: Define a new error_remove_page address space op for async truncation 2009-09-16 11:50:13 +02:00
firmware_class driver core: fix documentation of request_firmware_nowait 2009-06-15 21:30:24 -07:00
frv
hwmon hwmon: (f71882fg) Add support for the F71858F 2009-06-15 18:39:52 +02:00
i2c i2c: Add a sysfs interface to instantiate devices 2009-06-19 16:58:20 +02:00
i2o
ia64 trivial: Fix misspelling of firmware 2009-03-30 15:21:59 +02:00
ide ide: preserve Host Protected Area by default (v2) 2009-06-07 13:52:52 +02:00
infiniband IPoIB: Document newish features 2009-04-08 13:52:01 -07:00
input Input: add new driver for Sentelic Finger Sensing Pad 2009-08-19 21:46:09 -07:00
ioctl Merge branch 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2009-09-14 17:43:43 -07:00
isdn isdn: clean up documentation index 2009-06-20 01:10:38 -07:00
ja_JP block: rename CONFIG_LBD to CONFIG_LBDAF 2009-06-19 08:08:50 +02:00
kbuild kconfig: resort the documentation of the environment variables 2009-06-09 22:37:47 +02:00
kdump trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
ko_KR
kvm KVM: Document KVM_CAP_IRQCHIP 2009-09-10 10:46:55 +03:00
laptops thinkpad-acpi: remove dock and bay subdrivers 2009-08-01 23:46:58 -04:00
lguest lguest and virtio: cleanup struct definitions to Linux style. 2009-07-30 16:03:46 +09:30
m68k
make
mips ide: remove unused CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ 2009-01-14 19:19:03 +01:00
misc-devices drivers/misc/isl29003.c: driver for the ISL29003 ambient light sensor 2009-04-01 08:59:18 -07:00
mn10300 trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
mtd trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
namespaces
netlabel
networking sctp: Sysctl configuration for IPv4 Address Scoping 2009-09-04 18:21:01 -04:00
parisc
pcmcia .gitignore updates 2008-10-30 11:38:45 -07:00
power PM: Introduce core framework for run-time PM of I/O devices (rev. 17) 2009-08-23 00:04:44 +02:00
powerpc Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds 2009-06-28 11:02:32 -07:00
pps LinuxPPS: core support 2009-06-18 13:04:04 -07:00
prctl
s390 [S390] s390dbf: Add description for usage of "%s" in sprintf events 2009-09-11 10:29:53 +02:00
scheduler sched: Documentation/sched-rt-group: Fix style issues & bump version 2009-06-21 13:12:46 +02:00
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-06-17 09:50:44 -07:00
serial Create/use more directory structure in the Documentation/ tree. 2008-11-14 17:28:53 +00:00
sh sh: Kill off remaining CONFIG_SH_KGDB bits. 2008-12-22 18:44:05 +09:00
sound Merge branch 'topic/snd-printk' into for-linus 2009-09-10 15:33:03 +02:00
sparc
spi spi: new spi->mode bits 2009-06-30 18:56:00 -07:00
sysctl HWPOISON: The high level memory error handler in the VM v7 2009-09-16 11:50:15 +02:00
telephony
thermal
timers trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
trace tracing: Remove mentioning of legacy latency_trace file from documentation 2009-09-04 23:30:38 +02:00
uml
usb trivial: usb: fix missing space typo in doc 2009-06-12 18:01:51 +02:00
video4linux V4L/DVB (12720): em28xx-cards: Add vendor/product id for Kworld DVD Maker 2 2009-09-14 22:39:19 -03:00
vm slub: add option to disable higher order debugging slabs 2009-07-10 09:52:55 +03:00
w1 w1: send status messages after command processing 2009-01-08 08:31:14 -08:00
watchdog [WATCHDOG] hpwdt: Add NMI priority option 2009-06-23 07:13:45 +00:00
wimax i2400m: documentation and instructions for usage 2009-01-07 10:00:18 -08:00
x86 x86, intel_txt: Intel TXT boot support 2009-07-21 11:49:06 -07:00
zh_CN
00-INDEX Bluetooth: Add documentation for Marvell Bluetooth driver 2009-08-22 14:25:32 -07:00
BUG-HUNTING
Changes Documentation/Changes: perl is needed to build the kernel 2009-06-18 13:03:46 -07:00
CodingStyle trivial: fix typo milisecond/millisecond for documentation and source comments. 2009-06-12 18:01:46 +02:00
DMA-API.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
DMA-ISA-LPC.txt
DMA-attributes.txt
DMA-mapping.txt dma-mapping: update the old macro DMA_nBIT_MASK related documentations 2009-04-07 08:31:12 -07:00
HOWTO Remove Andrew Morton's http://www.zip.com.au/~akpm/ 2008-10-16 11:21:32 -07:00
IO-mapping.txt Documentation: move DMA-mapping.txt to Doc/PCI/ 2009-01-29 18:19:29 -08:00
IPMI.txt
IRQ-affinity.txt
IRQ.txt
Intel-IOMMU.txt
Makefile
ManagementStyle docs: fix ManagementStyle book name 2008-10-30 11:38:46 -07:00
SAK.txt Remove Andrew Morton's old email accounts 2008-10-16 11:21:32 -07:00
SELinux.txt
SM501.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
SecurityBugs
Smack.txt smack: implement logging V3 2009-04-14 09:00:23 +10:00
SubmitChecklist block: rename CONFIG_LBD to CONFIG_LBDAF 2009-06-19 08:08:50 +02:00
SubmittingDrivers Remove Andrew Morton's old email accounts 2008-10-16 11:21:32 -07:00
SubmittingPatches Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-06-14 13:46:25 -07:00
VGA-softcursor.txt
applying-patches.txt
atomic_ops.txt Documentation/atomic_ops.txt: fix sample code 2009-06-16 19:47:52 -07:00
bad_memory.txt Document handling of bad memory 2008-12-03 16:09:53 -07:00
basic_profiling.txt
binfmt_misc.txt
braille-console.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
bt8xxgpio.txt
btmrvl.txt Bluetooth: Add documentation for Marvell Bluetooth driver 2009-08-22 14:25:32 -07:00
c2port.txt Add c2 port support 2008-11-12 17:17:18 -08:00
cachetlb.txt
cpu-hotplug.txt x86: use possible_cpus=NUM to extend the possible cpus allowed 2008-12-18 12:08:05 +01:00
cpu-load.txt
cputopology.txt cpumask: Use topology_core_cpumask()/topology_thread_cpumask() 2009-01-11 19:12:49 +01:00
credentials.txt CRED: Documentation 2008-11-14 10:39:26 +11:00
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt trivial: Documentation/dell_rbu.txt: fix typos 2009-06-12 18:01:50 +02:00
devices.txt lanana: assign a device name and numbering for MAX3100 2009-04-07 08:44:05 -07:00
dmaengine.txt async_tx, dmaengine: document channel allocation and api rework 2009-01-05 18:10:19 -07:00
dontdiff dontdiff: Fix asm exclude 2009-03-26 15:45:43 -07:00
dynamic-debug-howto.txt Dynamic debug: allow simple quoting of words 2009-03-24 16:38:27 -07:00
edac.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
eisa.txt
email-clients.txt Documentation/email-clients.txt: add some info about gmail 2008-11-06 15:41:19 -08:00
feature-removal-schedule.txt Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2009-09-14 10:37:28 -07:00
flexible-arrays.txt Document the flex_array library. 2009-09-10 14:33:36 -06:00
futex-requeue-pi.txt futex: add requeue-pi documentation 2009-05-09 07:12:50 +02:00
gcov.txt gcov: fix documentation 2009-06-30 18:55:59 -07:00
gpio.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
highuid.txt
hw_random.txt
ics932s401 ics932s401: new clock generator chip driver 2008-11-12 17:17:18 -08:00
initrd.txt
intel_txt.txt x86, intel_txt: Intel TXT boot support 2009-07-21 11:49:06 -07:00
io-mapping.txt io mapping: improve documentation 2008-11-03 18:21:44 +01:00
io_ordering.txt
iostats.txt
irqflags-tracing.txt
isapnp.txt
java.txt
kernel-doc-nano-HOWTO.txt kernel-doc: restrict syntax for private: and public: 2009-05-02 15:36:10 -07:00
kernel-docs.txt
kernel-parameters.txt Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-09-15 09:39:44 -07:00
keys-request-key.txt
keys.txt KEYS: Add a keyctl to install a process's session keyring on its parent [try #6] 2009-09-02 21:29:22 +10:00
kmemcheck.txt kmemcheck: add the kmemcheck documentation 2009-06-13 14:27:20 +02:00
kmemleak.txt kmemleak: add clear command support 2009-09-08 16:36:08 +01:00
kobject.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
kprobes.txt debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem. 2009-06-15 21:30:28 -07:00
kref.txt
ldm.txt
leds-class.txt
leds-lp3944.txt leds: LED driver for National Semiconductor LP3944 Funlight Chip 2009-06-23 20:21:38 +01:00
local_ops.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
lockdep-design.txt lockdep: Fix typos in documentation 2009-08-07 12:03:46 +02:00
lockstat.txt lockstat: contend with points 2008-10-20 15:43:10 +02:00
logo.gif Revert "linux.conf.au 2009: Tuz" 2009-04-27 12:00:27 -07:00
logo.txt Revert "linux.conf.au 2009: Tuz" 2009-04-27 12:00:27 -07:00
magic-number.txt documentation: update header file paths 2009-01-06 15:59:28 -08:00
markers.txt markers: comment marker_synchronize_unregister() on data dependency 2008-11-28 16:47:41 +01:00
mca.txt
md.txt Documentation/md.txt update 2009-03-31 15:18:37 +11:00
memory-barriers.txt sched: Document memory barriers implied by sleep/wake-up primitives 2009-04-29 14:15:55 +02:00
memory-hotplug.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
memory.txt
mono.txt
mutex-design.txt
nmi_watchdog.txt x86, nmi-watchdog: update procfs nmi_watchdog file documentation v2 2008-10-30 19:07:04 +01:00
nommu-mmap.txt NOMMU: Make mmap allocation page trimming behaviour configurable. 2009-01-08 12:04:47 +00:00
numastat.txt
oops-tracing.txt
parport-lowlevel.txt
parport.txt
pi-futex.txt
pnp.txt
preempt-locking.txt
printk-formats.txt DOC: add printk-formats.txt 2008-11-12 17:17:17 -08:00
prio_tree.txt
rbtree.txt trivial: rbtree.txt: fix rb_entry() parameters in sample code 2009-06-12 18:01:47 +02:00
rfkill.txt rfkill: export persistent attribute in sysfs 2009-06-19 11:50:18 -04:00
robust-futex-ABI.txt futex: documentation: fix inconsistent description of futex list_op_pending 2009-06-18 13:03:56 -07:00
robust-futexes.txt
rt-mutex-design.txt
rt-mutex.txt
rtc.txt
serial-console.txt
sgi-ioc4.txt
sgi-visws.txt
slow-work.txt Document the slow work thread pool 2009-04-03 16:42:35 +01:00
sparse.txt Documentation: explain the difference between __bitwise and __bitwise__ 2009-04-11 08:18:11 +02:00
spinlocks.txt
stable_api_nonsense.txt
stable_kernel_rules.txt Update stable tree documentation 2008-10-29 15:03:49 -07:00
svga.txt
sysfs-rules.txt Doc/sysfs-rules: Swap the order of the words so the sentence makes more sense 2009-05-08 19:22:20 -07:00
sysrq.txt sysrq, kdump: make sysrq-c consistent 2009-07-29 19:10:36 -07:00
tomoyo.txt tomoyo: add Documentation/tomoyo.txt 2009-04-14 09:14:58 +10:00
unaligned-memory-access.txt
unicode.txt
unshare.txt
video-output.txt
volatile-considered-harmful.txt
voyager.txt
zorro.txt