summaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi2008-02-06 10:38:39 +0100
committerLinus Torvalds2008-02-06 19:41:13 +0100
commitd12def1bcb809b6172ee207a24e00a0a4398df1d (patch)
tree96e151de1e80cacd9202a00b77654533a9754207 /fs/fuse/inode.c
parentfuse: save space in struct fuse_req (diff)
downloadkernel-qcow2-linux-d12def1bcb809b6172ee207a24e00a0a4398df1d.tar.gz
kernel-qcow2-linux-d12def1bcb809b6172ee207a24e00a0a4398df1d.tar.xz
kernel-qcow2-linux-d12def1bcb809b6172ee207a24e00a0a4398df1d.zip
fuse: limit queued background requests
Libfuse basically creates a new thread for each new request. This is fine for synchronous requests, which are naturally limited. However background requests (especially writepage) can cause a thread creation storm. To avoid this, limit the number of background requests available to userspace. This is done by introducing another queue for background requests, and a counter for the number of "active" requests, which are currently available for userspace. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index e5e80d1a4687..c90f633d0b57 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -465,6 +465,7 @@ static struct fuse_conn *new_conn(void)
INIT_LIST_HEAD(&fc->processing);
INIT_LIST_HEAD(&fc->io);
INIT_LIST_HEAD(&fc->interrupts);
+ INIT_LIST_HEAD(&fc->bg_queue);
atomic_set(&fc->num_waiting, 0);
fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
fc->bdi.unplug_io_fn = default_unplug_io_fn;