diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-10-17 02:30:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:43:03 -0400 |
commit | f92b99b9dccb61760b345baf40ed37f59b91f8af (patch) | |
tree | 1460ac391186be79beb79a6d4030cc387239681c /fs/fuse/dev.c | |
parent | fdc1ca8abae72c5829e099fd35626b83ecb12666 (diff) |
fuse: update backing_dev_info congestion state
Set the read and write congestion state if the request queue is close to
blocking, and clear it when it's not.
This prevents unnecessary blocking in readahead and (when writable mmaps are
allowed) writeback.
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/dev.c')
-rw-r--r-- | fs/fuse/dev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 3ad22beb24c2..ebc36f525eee 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -224,6 +224,10 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) | |||
224 | fc->blocked = 0; | 224 | fc->blocked = 0; |
225 | wake_up_all(&fc->blocked_waitq); | 225 | wake_up_all(&fc->blocked_waitq); |
226 | } | 226 | } |
227 | if (fc->num_background == FUSE_CONGESTION_THRESHOLD) { | ||
228 | clear_bdi_congested(&fc->bdi, READ); | ||
229 | clear_bdi_congested(&fc->bdi, WRITE); | ||
230 | } | ||
227 | fc->num_background--; | 231 | fc->num_background--; |
228 | } | 232 | } |
229 | spin_unlock(&fc->lock); | 233 | spin_unlock(&fc->lock); |
@@ -378,6 +382,10 @@ static void request_send_nowait(struct fuse_conn *fc, struct fuse_req *req) | |||
378 | fc->num_background++; | 382 | fc->num_background++; |
379 | if (fc->num_background == FUSE_MAX_BACKGROUND) | 383 | if (fc->num_background == FUSE_MAX_BACKGROUND) |
380 | fc->blocked = 1; | 384 | fc->blocked = 1; |
385 | if (fc->num_background == FUSE_CONGESTION_THRESHOLD) { | ||
386 | set_bdi_congested(&fc->bdi, READ); | ||
387 | set_bdi_congested(&fc->bdi, WRITE); | ||
388 | } | ||
381 | 389 | ||
382 | queue_request(fc, req); | 390 | queue_request(fc, req); |
383 | spin_unlock(&fc->lock); | 391 | spin_unlock(&fc->lock); |