Chris Wilson
51311d0a5c
drm/i915: Do not hold mutex when faulting in user addresses
...
Linus Torvalds found that it was rather trivial to trigger a system
freeze:
In fact, with lockdep, I don't even need to do the sysrq-d thing: it
shows the bug as it happens. It's the X server taking the same lock
recursively.
Here's the problem:
=============================================
[ INFO: possible recursive locking detected ]
2.6.37-rc2-00012-gbdbd01a #7
---------------------------------------------
Xorg/2816 is trying to acquire lock:
(&dev->struct_mutex){+.+.+.}, at: [<ffffffff812c626c>] i915_gem_fault+0x50/0x17e
but task is already holding lock:
(&dev->struct_mutex){+.+.+.}, at: [<ffffffff812c403b>] i915_mutex_lock_interruptible+0x28/0x4a
other info that might help us debug this:
2 locks held by Xorg/2816:
#0 : (&dev->struct_mutex){+.+.+.}, at: [<ffffffff812c403b>] i915_mutex_lock_interruptible+0x28/0x4a
#1 : (&mm->mmap_sem){++++++}, at: [<ffffffff81022d4f>] page_fault+0x156/0x37b
This recursion was introduced by rearranging the locking to avoid the
double locking on the fast path (4f27b5d and fbd5a26d ) and the
introduction of the prefault to encourage the fast paths (b5e4f2b). In
order to undo the problem, we rearrange the code to perform the access
validation upfront, attempt to prefault and then fight for control of the
mutex. the best case scenario where the mutex is uncontended the
prefaulting is not wasted.
Reported-and-tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-19 09:30:15 +00:00
..
accessibility
acpi
ACPI: debugfs custom_method open to non-root
2010-11-13 09:52:16 -08:00
amba
ata
drivers/ata/pata_octeon_cf.c: delete double assignment
2010-11-12 17:10:55 -05:00
atm
solos: Refuse to upgrade firmware with older FPGA. It doesn't work.
2010-11-08 12:17:05 -08:00
auxdisplay
base
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
2010-10-29 15:09:56 -07:00
block
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
2010-11-12 08:52:47 -08:00
bluetooth
Bluetooth: Add MacBookAir3,1(2) support
2010-11-09 01:08:53 -02:00
cdrom
cdrom: gdrom: ctrl_in/outX to __raw_read/writeX conversion.
2010-10-27 14:33:39 +09:00
char
Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
2010-11-13 10:00:15 -08:00
clocksource
ARM: shmobile: remove sh_timer_config clk member
2010-10-31 10:40:39 -04:00
connector
cpufreq
cpuidle
crypto
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
2010-11-13 09:55:56 -08:00
dca
dio
dma
drivers/dma/Kconfig: add part number for Topcliff.
2010-10-29 14:14:02 -07:00
edac
Merge branch 'linux_next' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/i7core
2010-10-26 10:13:48 -07:00
eisa
firewire
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
2010-11-05 14:17:22 -07:00
firmware
dmi: log board, system, and BIOS information
2010-10-27 18:03:05 -07:00
gpio
gpio: Add VIA VX855 GPIO driver
2010-10-29 00:29:51 +02:00
gpu
drm/i915: Do not hold mutex when faulting in user addresses
2010-11-19 09:30:15 +00:00
hid
hwmon
hwmon: (gpio-fan) Fix fan_ctrl_init error path
2010-11-11 09:43:51 -08:00
i2c
i2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllers
2010-10-31 21:07:00 +01:00
ide
ide: clean up timed out request handling
2010-10-26 10:17:30 -07:00
idle
Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6
2010-10-26 17:28:07 -07:00
ieee802154
infiniband
convert get_sb_single() users
2010-10-29 04:16:28 -04:00
input
Input: do not pass injected events back to the originating handler
2010-11-11 01:01:26 -08:00
isdn
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
2010-11-05 15:25:48 -07:00
leds
drivers/leds/leds-gpio.c: properly initialize return value
2010-11-12 07:55:32 -08:00
lguest
macintosh
drivers/macintosh/adb-iop.c: flags should be unsigned long
2010-11-12 07:55:30 -08:00
mca
md
block: read i_size with i_size_read()
2010-11-10 14:40:53 +01:00
media
[media] soc-camera: Compile fixes for mx2-camera
2010-11-09 15:16:31 -02:00
memstick
message
mfd
mfd: Fix a memory leak when unload mc13xxx-core module
2010-10-29 00:30:43 +02:00
misc
drivers/misc/bh1770glc.c: error handling in bh1770_power_state_store()
2010-11-12 07:55:31 -08:00
mmc
mfd: Adding twl6030 mmc card detect support for MMC1
2010-10-29 00:29:59 +02:00
mtd
Merge git://git.infradead.org/mtd-2.6
2010-10-30 08:31:35 -07:00
net
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
2010-11-12 17:17:55 -08:00
nubus
of
oprofile
Merge branches 'perf-fixes-for-linus' and 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
2010-10-30 11:43:26 -07:00
parisc
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
2010-10-28 09:24:14 -07:00
parport
pci
xen-pcifront: fix PCI reference leak
2010-11-08 11:41:15 -05:00
pcmcia
drivers/pcmcia/soc_common.c: Use printf extension %pV
2010-11-10 14:31:28 +01:00
platform
Remove duplicate includes from many files
2010-10-27 18:03:18 -07:00
pnp
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
2010-10-26 17:28:37 -07:00
power
power: Revert "power_supply: Mark twl4030_charger as broken"
2010-10-29 00:30:44 +02:00
pps
ps3
rapidio
rapidio: use resource_size()
2010-11-12 07:55:30 -08:00
regulator
regulator: max8998 BUCK1/2 voltage change with use of GPIOs
2010-10-29 00:30:15 +02:00
rtc
sh: mach-snapgear: Kill off machtype, consolidate board def.
2010-10-29 19:06:53 +09:00
s390
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
2010-11-12 17:17:55 -08:00
sbus
scsi
block: remove REQ_HARDBARRIER
2010-11-10 14:54:09 +01:00
serial
Revert "8250: Fix tcsetattr to avoid ioctl(TIOCMIWAIT) hang"
2010-11-13 09:59:19 -08:00
sfi
sh
Merge branches 'sh/pio-death', 'sh/nommu', 'sh/clkfwk', 'sh/core' and 'sh/intc-extension' into sh-fixes-for-linus
2010-11-08 09:42:43 +09:00
sn
spi
Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
2010-11-01 07:50:43 -04:00
ssb
staging
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
2010-11-13 09:55:19 -08:00
tc
telephony
thermal
tty
n_gsm: Fix length handling
2010-11-11 11:06:09 -08:00
uio
usb
Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
2010-11-12 17:13:28 -08:00
uwb
UWB: Return UWB_RSV_ALLOC_NOT_FOUND rather than crashing on NULL dereference if kzalloc fails
2010-11-11 07:14:07 -08:00
vhost
video
backlight: MacBookAir3,1(3,2) mbp-nvidia-bl support
2010-11-12 07:55:33 -08:00
virtio
vlynq
w1
w1: don't allow arbitrary users to remove w1 devices
2010-10-27 18:03:17 -07:00
watchdog
WATCHDOG: octeon-wdt: Use I/O clock rate for timing calculations.
2010-10-29 19:08:42 +01:00
xen
Merge branch 'upstream/core' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
2010-11-12 16:01:55 -08:00
zorro
Kconfig
Makefile
TTY: create drivers/tty and move the tty core files there
2010-11-05 08:10:33 -07:00