alistair23-linux/Documentation/filesystems
David Howells fee096deb4 CacheFiles: Catch an overly long wait for an old active object
Catch an overly long wait for an old, dying active object when we want to
replace it with a new one.  The probability is that all the slow-work threads
are hogged, and the delete can't get a look in.

What we do instead is:

 (1) if there's nothing in the slow work queue, we sleep until either the dying
     object has finished dying or there is something in the slow work queue
     behind which we can queue our object.

 (2) if there is something in the slow work queue, we return ETIMEDOUT to
     fscache_lookup_object(), which then puts us back on the slow work queue,
     presumably behind the deletion that we're blocked by.  We are then
     deferred for a while until we work our way back through the queue -
     without blocking a slow-work thread unnecessarily.

A backtrace similar to the following may appear in the log without this patch:

	INFO: task kslowd004:5711 blocked for more than 120 seconds.
	"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
	kslowd004     D 0000000000000000     0  5711      2 0x00000080
	 ffff88000340bb80 0000000000000046 ffff88002550d000 0000000000000000
	 ffff88002550d000 0000000000000007 ffff88000340bfd8 ffff88002550d2a8
	 000000000000ddf0 00000000000118c0 00000000000118c0 ffff88002550d2a8
	Call Trace:
	 [<ffffffff81058e21>] ? trace_hardirqs_on+0xd/0xf
	 [<ffffffffa011c4d8>] ? cachefiles_wait_bit+0x0/0xd [cachefiles]
	 [<ffffffffa011c4e1>] cachefiles_wait_bit+0x9/0xd [cachefiles]
	 [<ffffffff81353153>] __wait_on_bit+0x43/0x76
	 [<ffffffff8111ae39>] ? ext3_xattr_get+0x1ec/0x270
	 [<ffffffff813531ef>] out_of_line_wait_on_bit+0x69/0x74
	 [<ffffffffa011c4d8>] ? cachefiles_wait_bit+0x0/0xd [cachefiles]
	 [<ffffffff8104c125>] ? wake_bit_function+0x0/0x2e
	 [<ffffffffa011bc79>] cachefiles_mark_object_active+0x203/0x23b [cachefiles]
	 [<ffffffffa011c209>] cachefiles_walk_to_object+0x558/0x827 [cachefiles]
	 [<ffffffffa011a429>] cachefiles_lookup_object+0xac/0x12a [cachefiles]
	 [<ffffffffa00aa1e9>] fscache_lookup_object+0x1c7/0x214 [fscache]
	 [<ffffffffa00aafc5>] fscache_object_state_machine+0xa5/0x52d [fscache]
	 [<ffffffffa00ab4ac>] fscache_object_slow_work_execute+0x5f/0xa0 [fscache]
	 [<ffffffff81082093>] slow_work_execute+0x18f/0x2d1
	 [<ffffffff8108239a>] slow_work_thread+0x1c5/0x308
	 [<ffffffff8104c0f1>] ? autoremove_wake_function+0x0/0x34
	 [<ffffffff810821d5>] ? slow_work_thread+0x0/0x308
	 [<ffffffff8104be91>] kthread+0x7a/0x82
	 [<ffffffff8100beda>] child_rip+0xa/0x20
	 [<ffffffff8100b87c>] ? restore_args+0x0/0x30
	 [<ffffffff8104be17>] ? kthread+0x0/0x82
	 [<ffffffff8100bed0>] ? child_rip+0x0/0x20
	1 lock held by kslowd004/5711:
	 #0:  (&sb->s_type->i_mutex_key#7/1){+.+.+.}, at: [<ffffffffa011be64>] cachefiles_walk_to_object+0x1b3/0x827 [cachefiles]

Signed-off-by: David Howells <dhowells@redhat.com>
2009-11-19 18:12:05 +00:00
..
caching CacheFiles: Catch an overly long wait for an old active object 2009-11-19 18:12:05 +00:00
configfs
pohmelfs Staging: Pohmelfs: Added IO permissions and priorities. 2009-04-17 11:06:30 -07:00
00-INDEX update Documentation/filesystems/00-INDEX with new nfsd related docs. 2009-04-28 12:54:45 -04:00
9p.txt 9p: Update documentation to add fscache related bits 2009-09-23 13:03:46 -05:00
adfs.txt
affs.txt
afs.txt AFS: Documentation updates 2009-08-19 10:40:13 -07:00
autofs4-mount-control.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
automount-support.txt
befs.txt
bfs.txt
btrfs.txt Btrfs: Add Documentation/filesystem/btrfs.txt, remove old COPYING 2009-01-07 09:54:24 -05:00
cifs.txt
coda.txt
cramfs.txt
debugfs.txt Document the debugfs API 2009-06-06 10:28:14 -06:00
dentry-locking.txt
devpts.txt Document usage of multiple-instances of devpts 2009-01-02 10:19:36 -08:00
directory-locking
dlmfs.txt
dnotify.txt
ecryptfs.txt
exofs.txt exofs: Documentation 2009-03-31 19:44:38 +03:00
Exporting
ext2.txt Doc fix: ext2 can only have 32,000 subdirs, not 32,768 2009-06-18 13:03:44 -07:00
ext3.txt ext3: Update documentation about ext3 quota mount options 2009-10-13 00:06:43 +02:00
ext4.txt Revert "ext4: Remove journal_checksum mount option and enable it by default" 2009-11-02 10:15:27 -08:00
fiemap.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
files.txt fix f_count description in Documentation/filesystems/files.txt 2008-12-31 18:07:42 -05:00
fuse.txt
gfs2-glocks.txt GFS2: Update docs 2009-05-19 10:23:23 +01:00
gfs2-uevents.txt GFS2: Add a document explaining GFS2's uevents 2009-08-17 11:11:41 +01:00
gfs2.txt GFS2: Update docs 2009-05-19 10:23:23 +01:00
hfs.txt
hfsplus.txt
hpfs.txt
inotify.txt
isofs.txt isofs: let mode and dmode mount options override rock ridge mode setting 2009-06-18 13:03:45 -07:00
jfs.txt
knfsd-stats.txt Document /proc/fs/nfsd/pool_stats 2009-03-27 19:24:27 -04:00
Locking update Documentation/filesystems/Locking 2009-06-24 08:15:25 -04:00
locks.txt
mandatory-locking.txt
ncpfs.txt ncpfs: remove dead URL from documentation 2009-09-23 07:39:42 -07:00
nfs-rdma.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
nfs.txt NFS: Add a dns resolver for use with NFSv4 referrals and migration 2009-08-19 18:22:15 -04:00
nfs41-server.txt nfsd: revise 4.1 status documentation 2009-09-21 11:13:45 -04:00
nfsroot.txt trivial: fix typo "for for" in multiple files 2009-09-21 15:14:54 +02:00
nilfs2.txt nilfs2: modify list of unsupported features in caveats 2009-06-10 23:41:11 +09:00
ntfs.txt
ocfs2.txt ocfs2: add mount option and Kconfig option for acl 2009-01-05 08:36:52 -08:00
omfs.txt
porting
proc.txt ext4: Use tracepoints for mb_history trace file 2009-09-30 00:32:42 -04:00
quota.txt
ramfs-rootfs-initramfs.txt
relay.txt
romfs.txt
rpc-cache.txt
seq_file.txt Doc: seq_file.txt fix wrong dd command example. 2009-09-10 14:33:35 -06:00
sharedsubtree.txt doc/filesystems: more mount cleanups 2009-09-24 07:20:57 -07:00
smbfs.txt
spufs.txt
squashfs.txt Squashfs: fix documentation typo, Cramfs filesystem limit is 256 MiB 2009-03-05 00:40:13 +00:00
sysfs-pci.txt trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
sysfs.txt driver core: documentation: make it clear that sysfs is optional 2009-07-28 13:45:23 -07:00
sysv-fs.txt
tmpfs.txt hugh: update email address 2009-05-21 13:14:32 -07:00
ubifs.txt UBIFS: remove fast unmounting 2009-01-29 16:34:30 +02:00
udf.txt udf: implement mode and dmode mounting options 2009-04-02 12:29:50 +02:00
ufs.txt
vfat.txt vfat: change the default from shortname=lower to shortname=mixed 2009-08-01 21:35:25 +09:00
vfs.txt HWPOISON: Define a new error_remove_page address space op for async truncation 2009-09-16 11:50:13 +02:00
xfs.txt
xip.txt