Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f92b99b9dccb61760b345baf40ed37f59b91f8af
Commit:     f92b99b9dccb61760b345baf40ed37f59b91f8af
Parent:     fdc1ca8abae72c5829e099fd35626b83ecb12666
Author:     Miklos Szeredi <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:30:59 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:43:03 2007 -0700

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/fuse/dev.c    |    8 ++++++++
 fs/fuse/fuse_i.h |    5 ++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 3ad22be..ebc36f5 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)
                        fc->blocked = 0;
                        wake_up_all(&fc->blocked_waitq);
                }
+               if (fc->num_background == FUSE_CONGESTION_THRESHOLD) {
+                       clear_bdi_congested(&fc->bdi, READ);
+                       clear_bdi_congested(&fc->bdi, WRITE);
+               }
                fc->num_background--;
        }
        spin_unlock(&fc->lock);
@@ -378,6 +382,10 @@ static void request_send_nowait(struct fuse_conn *fc, 
struct fuse_req *req)
                fc->num_background++;
                if (fc->num_background == FUSE_MAX_BACKGROUND)
                        fc->blocked = 1;
+               if (fc->num_background == FUSE_CONGESTION_THRESHOLD) {
+                       set_bdi_congested(&fc->bdi, READ);
+                       set_bdi_congested(&fc->bdi, WRITE);
+               }
 
                queue_request(fc, req);
                spin_unlock(&fc->lock);
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 68ae87c..9f4603b 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -20,7 +20,10 @@
 #define FUSE_MAX_PAGES_PER_REQ 32
 
 /** Maximum number of outstanding background requests */
-#define FUSE_MAX_BACKGROUND 10
+#define FUSE_MAX_BACKGROUND 12
+
+/** Congestion starts at 75% of maximum */
+#define FUSE_CONGESTION_THRESHOLD (FUSE_MAX_BACKGROUND * 75 / 100)
 
 /** It could be as large as PATH_MAX, but would that have any uses? */
 #define FUSE_NAME_MAX 1024
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to