aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2009-07-01 20:28:41 -0400
committerMiklos Szeredi <mszeredi@suse.cz>2009-07-07 11:28:52 -0400
commit7a6d3c8b3049d07123628f2bf57127bba2cc878f (patch)
treebfa09bd7e87753eb777699e0566e396ae639532c /fs/fuse/inode.c
parent8e4a718ff38d8539938ec3421935904c27e00c39 (diff)
fuse: make the number of max background requests and congestion threshold tunable
The practical values for these limits depend on the design of the filesystem server so let userspace set them at initialization time. Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index f91ccc4a189d..9aa6f46d0c32 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -32,6 +32,12 @@ DEFINE_MUTEX(fuse_mutex);
32 32
33#define FUSE_DEFAULT_BLKSIZE 512 33#define FUSE_DEFAULT_BLKSIZE 512
34 34
35/** Maximum number of outstanding background requests */
36#define FUSE_DEFAULT_MAX_BACKGROUND 12
37
38/** Congestion starts at 75% of maximum */
39#define FUSE_DEFAULT_CONGESTION_THRESHOLD (FUSE_DEFAULT_MAX_BACKGROUND * 3 / 4)
40
35struct fuse_mount_data { 41struct fuse_mount_data {
36 int fd; 42 int fd;
37 unsigned rootmode; 43 unsigned rootmode;
@@ -517,6 +523,8 @@ void fuse_conn_init(struct fuse_conn *fc)
517 INIT_LIST_HEAD(&fc->bg_queue); 523 INIT_LIST_HEAD(&fc->bg_queue);
518 INIT_LIST_HEAD(&fc->entry); 524 INIT_LIST_HEAD(&fc->entry);
519 atomic_set(&fc->num_waiting, 0); 525 atomic_set(&fc->num_waiting, 0);
526 fc->max_background = FUSE_DEFAULT_MAX_BACKGROUND;
527 fc->congestion_threshold = FUSE_DEFAULT_CONGESTION_THRESHOLD;
520 fc->khctr = 0; 528 fc->khctr = 0;
521 fc->polled_files = RB_ROOT; 529 fc->polled_files = RB_ROOT;
522 fc->reqctr = 0; 530 fc->reqctr = 0;
@@ -736,6 +744,12 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
736 else { 744 else {
737 unsigned long ra_pages; 745 unsigned long ra_pages;
738 746
747 if (arg->minor >= 13) {
748 if (arg->max_background)
749 fc->max_background = arg->max_background;
750 if (arg->congestion_threshold)
751 fc->congestion_threshold = arg->congestion_threshold;
752 }
739 if (arg->minor >= 6) { 753 if (arg->minor >= 6) {
740 ra_pages = arg->max_readahead / PAGE_CACHE_SIZE; 754 ra_pages = arg->max_readahead / PAGE_CACHE_SIZE;
741 if (arg->flags & FUSE_ASYNC_READ) 755 if (arg->flags & FUSE_ASYNC_READ)