diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2008-02-06 04:38:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 13:41:13 -0500 |
commit | d12def1bcb809b6172ee207a24e00a0a4398df1d (patch) | |
tree | 96e151de1e80cacd9202a00b77654533a9754207 /fs/fuse/fuse_i.h | |
parent | b57d426445c98789265de6a9338cdb06462d15fb (diff) |
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/fuse_i.h')
-rw-r--r-- | fs/fuse/fuse_i.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index c5c1ebff1e2d..67aaf6ee38ea 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
@@ -296,6 +296,12 @@ struct fuse_conn { | |||
296 | /** Number of requests currently in the background */ | 296 | /** Number of requests currently in the background */ |
297 | unsigned num_background; | 297 | unsigned num_background; |
298 | 298 | ||
299 | /** Number of background requests currently queued for userspace */ | ||
300 | unsigned active_background; | ||
301 | |||
302 | /** The list of background requests set aside for later queuing */ | ||
303 | struct list_head bg_queue; | ||
304 | |||
299 | /** Pending interrupts */ | 305 | /** Pending interrupts */ |
300 | struct list_head interrupts; | 306 | struct list_head interrupts; |
301 | 307 | ||