[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120705105059.17812.31903.stgit@ltc137.sdl.hitachi.co.jp>
Date: Thu, 05 Jul 2012 19:51:00 +0900
From: Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: fuse-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, yrl.pp-manager.tt@...achi.com,
Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>,
Miklos Szeredi <miklos@...redi.hu>
Subject: [RFC PATCH 3/5] fuse: make default global limit minimum value
The default global limits for congestion threshold and backgrounded
requests are calculated using size of fuse_req structure, which is
variable due to the tunable read/write request size. This patch sets
them to their minimum values by default in order to avoid the variable
and unstable limits per mount.
Signed-off-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>
Cc: Miklos Szeredi <miklos@...redi.hu>
---
fs/fuse/fuse_i.h | 5 +++++
fs/fuse/inode.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index c96dc5f..72210a8 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -29,6 +29,11 @@
/** Default number of pages that can be used in a single read/write request */
#define FUSE_DEFAULT_MAX_PAGES_PER_REQ 32
+/** Maximum size of struct fuse_req */
+#define FUSE_MAX_FUSE_REQ_SIZE (sizeof(struct fuse_req) + \
+ FUSE_MAX_PAGES_PER_REQ * \
+ sizeof(struct page *))
+
/** Bias for fi->writectr, meaning new writepages must not be sent */
#define FUSE_NOWRITE INT_MIN
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index aadf157..d8d302a 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -758,7 +758,7 @@ static void sanitize_global_limit(unsigned *limit)
{
if (*limit == 0)
*limit = ((num_physpages << PAGE_SHIFT) >> 13) /
- sizeof(struct fuse_req);
+ FUSE_MAX_FUSE_REQ_SIZE;
if (*limit >= 1 << 16)
*limit = (1 << 16) - 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists