linux/include
Tim Hockin e02e68d31e x86_64: support poll() on /dev/mcelog
Background:
 /dev/mcelog is typically polled manually.  This is less than optimal for
 situations where accurate accounting of MCEs is important.  Calling
 poll() on /dev/mcelog does not work.

Description:
 This patch adds support for poll() to /dev/mcelog.  This results in
 immediate wakeup of user apps whenever the poller finds MCEs.  Because
 the exception handler can not take any locks, it can not call the wakeup
 itself.  Instead, it uses a thread_info flag (TIF_MCE_NOTIFY) which is
 caught at the next return from interrupt or exit from idle, calling the
 mce_user_notify() routine.  This patch also disables the "fake panic"
 path of the mce_panic(), because it results in printk()s in the exception
 handler and crashy systems.

 This patch also does some small cleanup for essentially unused variables,
 and moves the user notification into the body of the poller, so it is
 only called once per poll, rather than once per CPU.

Result:
 Applications can now poll() on /dev/mcelog.  When an error is logged
 (whether through the poller or through an exception) the applications are
 woken up promptly.  This should not affect any previous behaviors.  If no
 MCEs are being logged, there is no overhead.

Alternatives:
 I considered simply supporting poll() through the poller and not using
 TIF_MCE_NOTIFY at all.  However, the time between an uncorrectable error
 happening and the user application being notified is *the*most* critical
 window for us.  Many uncorrectable errors can be logged to the network if
 given a chance.

 I also considered doing the MCE poll directly from the idle notifier, but
 decided that was overkill.

Testing:
 I used an error-injecting DIMM to create lots of correctable DRAM errors
 and verified that my user app is woken up in sync with the polling interval.
 I also used the northbridge to inject uncorrectable ECC errors, and
 verified (printk() to the rescue) that the notify routine is called and the
 user app does wake up.  I built with PREEMPT on and off, and verified
 that my machine survives MCEs.

[wli@holomorphy.com: build fix]
Signed-off-by: Tim Hockin <thockin@google.com>
Signed-off-by: William Irwin <bill.irwin@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-21 18:37:10 -07:00
..
acpi x86_64: fake pxm-to-node mapping for fake numa 2007-07-21 18:37:10 -07:00
asm-alpha [PATCH] sched: sched_cacheflush is now unused 2007-07-19 21:28:35 +02:00
asm-arm [PATCH] sched: sched_cacheflush is now unused 2007-07-19 21:28:35 +02:00
asm-arm26 [PATCH] sched: sched_cacheflush is now unused 2007-07-19 21:28:35 +02:00
asm-avr32 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-blackfin fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
asm-cris arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-frv arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-generic i386: Put allocated ELF notes in read-only data segment 2007-07-19 10:04:47 -07:00
asm-h8300 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-i386 i386: minor nx handling adjustment 2007-07-21 18:37:09 -07:00
asm-ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2007-07-20 12:02:20 -07:00
asm-m32r [PATCH] sched: sched_cacheflush is now unused 2007-07-19 21:28:35 +02:00
asm-m68k m68k iomem (based on Geert's tree + memcpy_... stuff) 2007-07-20 08:24:49 -07:00
asm-m68knommu m68knommu: remove is_in_rom() function 2007-07-19 10:04:51 -07:00
asm-mips [MIPS] User stack pointer randomisation 2007-07-20 18:57:40 +01:00
asm-parisc [PATCH] sched: sched_cacheflush is now unused 2007-07-19 21:28:35 +02:00
asm-powerpc [CELL] spufs: rework list management and associated locking 2007-07-20 21:42:28 +02:00
asm-ppc [PATCH] sched: sched_cacheflush is now unused 2007-07-19 21:28:35 +02:00
asm-s390 [PATCH] sched: sched_cacheflush is now unused 2007-07-19 21:28:35 +02:00
asm-sh sh: intc - add support for SH7750 and its variants 2007-07-20 18:44:49 +09:00
asm-sh64 sh64: Wire up fallocate() syscall. 2007-07-20 12:37:51 +09:00
asm-sparc [SPARC]: Implement fb_is_primary_device(). 2007-07-20 17:15:09 -07:00
asm-sparc64 [SPARC64]: Convert parport to of_platform_driver. 2007-07-20 17:15:35 -07:00
asm-um arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-v850 fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
asm-x86_64 x86_64: support poll() on /dev/mcelog 2007-07-21 18:37:10 -07:00
asm-xtensa arch: personality independent stack top 2007-07-19 10:04:45 -07:00
crypto
keys
linux x86_64: fake pxm-to-node mapping for fake numa 2007-07-21 18:37:10 -07:00
math-emu
media V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22) 2007-07-18 14:24:44 -03:00
mtd UBI: kill homegrown endian macros 2007-07-18 16:53:49 +03:00
net Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6 2007-07-19 14:42:40 -07:00
pcmcia
rdma
rxrpc
scsi [SCSI] Remove unused method scsi_device_cancel 2007-07-14 16:01:16 -05:00
sound [ALSA] version 1.0.14 2007-07-20 11:13:35 +02:00
video tgafb: actually allocate memory for the pseudo_palette 2007-07-17 10:23:12 -07:00
xen xen: Place vcpu_info structure into per-cpu memory 2007-07-18 08:47:45 -07:00
Kbuild