From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
Chris Wedgwood <reviews@ml.cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv.org>,
Chuck Ebbert <cebbert@redhat.com>,
Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
MinChan Kim <minchan.kim@gmail.com>,
Nick Piggin <nickpiggin@yahoo.com.au>
Subject: [patch 40/96] inotify: fix GFP_KERNEL related deadlock
Date: Fri, 13 Mar 2009 17:05:48 -0700 [thread overview]
Message-ID: <20090314000745.022590080@mini.kroah.org> (raw)
In-Reply-To: <20090314001449.GA4485@kroah.com>
[-- Attachment #1: inotify-fix-gfp_kernel-related-deadlock.patch --]
[-- Type: text/plain, Size: 4395 bytes --]
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ingo Molnar <mingo@elte.hu>
commit f04b30de3c82528f1ab4c58b3dd4c975f5341901 upstream.
Enhanced lockdep coverage of __GFP_NOFS turned up this new lockdep
assert:
[ 1093.677775]
[ 1093.677781] =================================
[ 1093.680031] [ INFO: inconsistent lock state ]
[ 1093.680031] 2.6.29-rc5-tip-01504-gb49eca1-dirty #1
[ 1093.680031] ---------------------------------
[ 1093.680031] inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
[ 1093.680031] kswapd0/308 [HC0[0]:SC0[0]:HE1:SE1] takes:
[ 1093.680031] (&inode->inotify_mutex){+.+.?.}, at: [<c0205942>] inotify_inode_is_dead+0x20/0x80
[ 1093.680031] {RECLAIM_FS-ON-W} state was registered at:
[ 1093.680031] [<c01696b9>] mark_held_locks+0x43/0x5b
[ 1093.680031] [<c016baa4>] lockdep_trace_alloc+0x6c/0x6e
[ 1093.680031] [<c01cf8b0>] kmem_cache_alloc+0x20/0x150
[ 1093.680031] [<c040d0ec>] idr_pre_get+0x27/0x6c
[ 1093.680031] [<c02056e3>] inotify_handle_get_wd+0x25/0xad
[ 1093.680031] [<c0205f43>] inotify_add_watch+0x7a/0x129
[ 1093.680031] [<c020679e>] sys_inotify_add_watch+0x20f/0x250
[ 1093.680031] [<c010389e>] sysenter_do_call+0x12/0x35
[ 1093.680031] [<ffffffff>] 0xffffffff
[ 1093.680031] irq event stamp: 60417
[ 1093.680031] hardirqs last enabled at (60417): [<c018d5f5>] call_rcu+0x53/0x59
[ 1093.680031] hardirqs last disabled at (60416): [<c018d5b9>] call_rcu+0x17/0x59
[ 1093.680031] softirqs last enabled at (59656): [<c0146229>] __do_softirq+0x157/0x16b
[ 1093.680031] softirqs last disabled at (59651): [<c0106293>] do_softirq+0x74/0x15d
[ 1093.680031]
[ 1093.680031] other info that might help us debug this:
[ 1093.680031] 2 locks held by kswapd0/308:
[ 1093.680031] #0: (shrinker_rwsem){++++..}, at: [<c01b0502>] shrink_slab+0x36/0x189
[ 1093.680031] #1: (&type->s_umount_key#4){+++++.}, at: [<c01e6d77>] shrink_dcache_memory+0x110/0x1fb
[ 1093.680031]
[ 1093.680031] stack backtrace:
[ 1093.680031] Pid: 308, comm: kswapd0 Not tainted 2.6.29-rc5-tip-01504-gb49eca1-dirty #1
[ 1093.680031] Call Trace:
[ 1093.680031] [<c016947a>] valid_state+0x12a/0x13d
[ 1093.680031] [<c016954e>] mark_lock+0xc1/0x1e9
[ 1093.680031] [<c016a5b4>] ? check_usage_forwards+0x0/0x3f
[ 1093.680031] [<c016ab74>] __lock_acquire+0x2c6/0xac8
[ 1093.680031] [<c01688d9>] ? register_lock_class+0x17/0x228
[ 1093.680031] [<c016b3d3>] lock_acquire+0x5d/0x7a
[ 1093.680031] [<c0205942>] ? inotify_inode_is_dead+0x20/0x80
[ 1093.680031] [<c08824c4>] __mutex_lock_common+0x3a/0x4cb
[ 1093.680031] [<c0205942>] ? inotify_inode_is_dead+0x20/0x80
[ 1093.680031] [<c08829ed>] mutex_lock_nested+0x2e/0x36
[ 1093.680031] [<c0205942>] ? inotify_inode_is_dead+0x20/0x80
[ 1093.680031] [<c0205942>] inotify_inode_is_dead+0x20/0x80
[ 1093.680031] [<c01e6672>] dentry_iput+0x90/0xc2
[ 1093.680031] [<c01e67a3>] d_kill+0x21/0x45
[ 1093.680031] [<c01e6a46>] __shrink_dcache_sb+0x27f/0x355
[ 1093.680031] [<c01e6dc5>] shrink_dcache_memory+0x15e/0x1fb
[ 1093.680031] [<c01b05ed>] shrink_slab+0x121/0x189
[ 1093.680031] [<c01b0d12>] kswapd+0x39f/0x561
[ 1093.680031] [<c01ae499>] ? isolate_pages_global+0x0/0x233
[ 1093.680031] [<c0157eae>] ? autoremove_wake_function+0x0/0x43
[ 1093.680031] [<c01b0973>] ? kswapd+0x0/0x561
[ 1093.680031] [<c0157daf>] kthread+0x41/0x82
[ 1093.680031] [<c0157d6e>] ? kthread+0x0/0x82
[ 1093.680031] [<c01043ab>] kernel_thread_helper+0x7/0x10
inotify_handle_get_wd() does idr_pre_get() which does a
kmem_cache_alloc() without __GFP_FS - and is hence deadlockable under
extreme MM pressure.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: MinChan Kim <minchan.kim@gmail.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/inotify.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -156,7 +156,7 @@ static int inotify_handle_get_wd(struct
int ret;
do {
- if (unlikely(!idr_pre_get(&ih->idr, GFP_KERNEL)))
+ if (unlikely(!idr_pre_get(&ih->idr, GFP_NOFS)))
return -ENOSPC;
ret = idr_get_new_above(&ih->idr, watch, ih->last_wd+1, &watch->wd);
} while (ret == -EAGAIN);
next prev parent reply other threads:[~2009-03-14 0:31 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090314000508.803142980@mini.kroah.org>
2009-03-14 0:14 ` [patch 00/96] 2.6.27.20-stable review Greg KH
2009-03-14 0:05 ` [patch 01/96] USB: net: asix: add support for Cables-to-Go USB Ethernet adapter Greg KH
2009-03-14 0:05 ` [patch 02/96] bridge: netfilter: fix update_pmtu crash with GRE Greg KH
2009-03-14 0:05 ` [patch 03/96] net: amend the fix for SO_BSDCOMPAT gsopt infoleak Greg KH
2009-03-14 0:05 ` [patch 04/96] net: Kill skb_truesize_check(), it only catches false-positives Greg KH
2009-03-14 0:05 ` [patch 05/96] sparc64: Fix DAX handling via userspace access from kernel Greg KH
2009-03-14 0:05 ` [patch 06/96] sparc: We need to implement arch_ptrace_stop() Greg KH
2009-03-14 0:05 ` [patch 07/96] documnt FMODE_ constants Greg KH
2009-03-14 12:46 ` Christoph Hellwig
2009-03-14 15:38 ` Greg KH
2009-03-14 19:18 ` Christoph Hellwig
2009-03-14 0:05 ` [patch 08/96] vfs: separate FMODE_PREAD/FMODE_PWRITE into separate flags Greg KH
2009-03-14 0:05 ` [patch 09/96] seq_file: properly cope with pread Greg KH
2009-03-14 0:05 ` [patch 10/96] vt: Declare PIO_CMAP/GIO_CMAP as compatbile ioctls Greg KH
2009-03-14 0:05 ` [patch 11/96] aoe: ignore vendor extension AoE responses Greg KH
2009-03-14 0:05 ` [patch 12/96] [CIFS] Fix oops in cifs_strfromUCS_le mounting to servers which do not specify their OS Greg KH
2009-03-14 0:05 ` [patch 13/96] JFFS2: fix mount crash caused by removed nodes Greg KH
[not found] ` <17cc26190905290126l8158b10t44ff0649feb5d7a9@mail.gmail.com>
2009-05-29 11:02 ` David Woodhouse
2009-03-14 0:05 ` [patch 14/96] mm: clean up for early_pfn_to_nid() Greg KH
2009-03-14 0:05 ` [patch 15/96] mm: fix memmap init for handling memory hole Greg KH
2009-03-14 0:05 ` [patch 16/96] PCI quirk: enable MSI on 8132 Greg KH
2009-03-14 0:05 ` [patch 17/96] rtl8187: New USB IDs for RTL8187L Greg KH
2009-03-14 0:05 ` [patch 18/96] SCSI: hptiop: Add new PCI device ID Greg KH
2009-03-14 0:05 ` [patch 19/96] SCSI: sd: revive sd_index_lock Greg KH
2009-03-14 0:05 ` [patch 20/96] timerfd: add flags check Greg KH
2009-03-14 0:05 ` [patch 21/96] USB: cdc-acm: add usb id for motomagx phones Greg KH
2009-03-14 0:05 ` [patch 22/96] USB: usb_get_string should check the descriptor type Greg KH
2009-03-14 0:05 ` [patch 23/96] USB: usb-storage: add IGNORE_RESIDUE flag for Genesys Logic adapters Greg KH
2009-03-14 0:05 ` [patch 24/96] WATCHDOG: ks8695_wdt.c: CLOCK_TICK_RATE undeclared Greg KH
2009-03-14 0:05 ` [patch 25/96] WATCHDOG: rc32434_wdt: fix watchdog driver Greg KH
2009-03-14 0:05 ` [patch 26/96] WATCHDOG: rc32434_wdt: fix sections Greg KH
2009-03-14 0:05 ` [patch 27/96] 8250: fix boot hang with serial console when using with Serial Over Lan port Greg KH
2009-03-14 0:05 ` [patch 28/96] ALSA: aw2: do not grab every saa7146 based device Greg KH
2009-03-14 0:05 ` [patch 29/96] ALSA: fix excessive background noise introduced by OSS emulation rate shrink Greg KH
2009-03-14 0:05 ` [patch 30/96] ALSA: hda - add another MacBook Pro 3,1 SSID Greg KH
2009-03-14 0:05 ` [patch 31/96] ALSA: usb-audio - Fix non-continuous rate detection Greg KH
2009-03-14 0:05 ` [patch 32/96] ALSA: usb-audio - Workaround for misdetected sample rate with CM6207 Greg KH
2009-03-14 0:05 ` [patch 33/96] asix: new device ids Greg KH
2009-03-14 0:05 ` [patch 34/96] cdc_ether: add usb id for Ericsson F3507g Greg KH
2009-03-14 0:05 ` [patch 35/96] copy_process: fix CLONE_PARENT && parent_exec_id interaction Greg KH
2009-03-14 0:05 ` [patch 36/96] Fix fixpoint divide exception in acct_update_integrals Greg KH
2009-03-14 0:05 ` [patch 37/96] fore200: fix oops on failed firmware load Greg KH
2009-03-14 0:05 ` [patch 38/96] fs: new inode i_state corruption fix Greg KH
2009-03-14 0:05 ` [patch 39/96] hpilo: new pci device Greg KH
2009-03-14 0:05 ` Greg KH [this message]
2009-03-14 0:05 ` [patch 41/96] intel-agp: fix a panic with 1M of shared memory, no GTT entries Greg KH
2009-03-14 0:05 ` [patch 42/96] jsm: additional device support Greg KH
2009-03-14 0:05 ` [patch 43/96] libata: Dont trust current capacity values in identify words 57-58 Greg KH
2009-03-14 0:05 ` [patch 44/96] libata: make sure port is thawed when skipping resets Greg KH
2009-03-14 0:05 ` [patch 45/96] md: avoid races when stopping resync Greg KH
2009-03-14 0:05 ` [patch 46/96] md/raid10: Dont call bitmap_cond_end_sync when we are doing recovery Greg KH
2009-03-14 0:05 ` [patch 47/96] md/raid10: Dont skip more than 1 bitmap-chunk at a time during recovery Greg KH
2009-03-14 0:05 ` [patch 48/96] mmc: s3cmci: fix s3c2410_dma_config() arguments Greg KH
2009-03-14 0:05 ` [patch 49/96] mmc_test: fix basic read test Greg KH
2009-03-14 0:05 ` [patch 50/96] mtd_dataflash: fix probing of AT45DB321C chips Greg KH
2009-03-14 0:05 ` [patch 51/96] PCI: Add PCI quirk to disable L0s ASPM state for 82575 and 82598 Greg KH
2009-03-14 0:06 ` [patch 52/96] PCI: dont enable too many HT MSI mappings Greg KH
2009-03-14 0:06 ` [patch 53/96] PCI: Enable PCIe AER only after checking firmware support Greg KH
2009-03-14 0:06 ` [patch 54/96] PCIe: portdrv: call pci_disable_device during remove Greg KH
2009-03-14 0:06 ` [patch 55/96] powerpc: Fix load/store float double alignment handler Greg KH
2009-03-14 0:06 ` [patch 56/96] proc: fix kflags to uflags copying in /proc/kpageflags Greg KH
2009-03-14 0:06 ` [patch 57/96] proc: fix PG_locked reporting " Greg KH
2009-03-14 0:06 ` [patch 58/96] RDMA/nes: Dont allow userspace QPs to use STag zero Greg KH
2009-03-14 0:06 ` [patch 59/96] sdhci: fix led naming Greg KH
2009-03-14 0:06 ` [patch 60/96] selinux: Fix a panic in selinux_netlbl_inode_permission() Greg KH
2009-03-14 0:06 ` [patch 61/96] selinux: Fix the NetLabel glue code for setsockopt() Greg KH
2009-03-14 0:06 ` [patch 62/96] sis190: add identifier for Atheros AR8021 PHY Greg KH
2009-03-14 0:06 ` [patch 63/96] sound: usb-audio: fix uninitialized variable with M-Audio MIDI interfaces Greg KH
2009-03-14 0:06 ` [patch 64/96] sound: virtuoso: revert "do not overwrite EEPROM on Xonar D2/D2X" Greg KH
2009-03-14 0:06 ` [patch 65/96] USB: EHCI: slow down ITD reuse Greg KH
2009-03-14 0:06 ` [patch 66/96] USB: option: add BenQ 3g modem information Greg KH
2009-03-14 0:06 ` [patch 67/96] x86-64: fix int $0x80 -ENOSYS return Greg KH
2009-03-14 0:06 ` [patch 68/96] x86-64: seccomp: fix 32/64 syscall hole Greg KH
2009-03-14 0:06 ` [patch 69/96] x86-64: syscall-audit: " Greg KH
2009-03-14 0:06 ` [patch 70/96] x86: add Dell XPS710 reboot quirk Greg KH
2009-03-14 0:06 ` [patch 71/96] x86: tone down mtrr_trim_uncached_memory() warning Greg KH
2009-03-14 0:06 ` [patch 72/96] x86, vmi: TSC going backwards check in vmi clocksource Greg KH
2009-03-14 0:06 ` [patch 73/96] xen/blkfront: use blk_rq_map_sg to generate ring entries Greg KH
2009-03-14 0:06 ` [patch 74/96] xen: disable interrupts early, as start_kernel expects Greg KH
2009-03-14 0:06 ` [patch 75/96] zaurus: add usb id for motomagx phones Greg KH
2009-03-14 0:06 ` [patch 76/96] DVB: s5h1409: Perform s5h1409 soft reset after tuning Greg KH
2009-03-14 0:06 ` [patch 77/96] [PATCH] V4L: tda8290: fix TDA8290 + TDA18271 initialization Greg KH
2009-03-14 0:06 ` [patch 78/96] V4L: ivtv: fix decoder crash regression Greg KH
2009-03-14 0:06 ` [patch 79/96] ACPI: fix broken usage of name.ascii Greg KH
2009-03-14 0:06 ` [patch 80/96] hwmon: (f71882fg) Hide misleading error message Greg KH
2009-03-14 0:06 ` [patch 81/96] i2c: Fix misplaced parentheses Greg KH
2009-03-14 0:06 ` [patch 82/96] i2c: Timeouts reach -1 Greg KH
2009-03-14 0:06 ` [patch 83/96] ide-iops: fix odd-length ATAPI PIO transfers Greg KH
2009-03-14 0:06 ` [patch 84/96] ARM: Add i2c_board_info for RiscPC PCF8583 Greg KH
2009-03-14 0:06 ` [patch 85/96] Fix no_timer_check on x86_64 Greg KH
2009-03-14 0:06 ` [patch 86/96] jbd2: Fix return value of jbd2_journal_start_commit() Greg KH
2009-03-14 0:06 ` [patch 87/96] Revert "ext4: wait on all pending commits in ext4_sync_fs()" Greg KH
2009-03-14 0:06 ` [patch 88/96] jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_truncate() Greg KH
2009-03-14 0:06 ` [patch 89/96] ext4: Fix to read empty directory blocks correctly in 64k Greg KH
2009-03-14 0:06 ` [patch 90/96] ext4: Fix lockdep warning Greg KH
2009-03-14 0:06 ` [patch 91/96] ext4: Initialize preallocation list_heads properly Greg KH
2009-03-14 0:06 ` [patch 92/96] ext4: Fix NULL dereference in ext4_ext_migrate()s error handling Greg KH
2009-03-14 0:06 ` [patch 93/96] ext4: Add fallback for find_group_flex Greg KH
2009-03-14 0:06 ` [patch 94/96] ext4: Fix deadlock in ext4_write_begin() and ext4_da_write_begin() Greg KH
2009-03-14 0:06 ` [patch 95/96] MIPS: compat: Implement is_compat_task Greg KH
2009-03-14 0:06 ` [patch 96/96] hwmon: (it87) Properly decode -128 degrees C temperature Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090314000745.022590080@mini.kroah.org \
--to=gregkh@suse.de \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cavokz@gmail.com \
--cc=cebbert@redhat.com \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=eteo@redhat.com \
--cc=jake@lwn.net \
--cc=jmforbes@linuxtx.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan.kim@gmail.com \
--cc=mingo@elte.hu \
--cc=mkrufky@linuxtv.org \
--cc=nickpiggin@yahoo.com.au \
--cc=rbranco@la.checkpoint.com \
--cc=rdunlap@xenotime.net \
--cc=reviews@ml.cw.f00f.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=w@1wt.eu \
--cc=zwane@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox