[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fuse-devel
Subject:    [fuse-devel] performance, bufsize and FUSE_MAX_PAGES_PER_REQ
From:       Constantine Shulyupin <const () makelinux ! co ! il>
Date:       2017-06-18 17:36:32
Message-ID: CAE7jHC_EDotmxjagwRerDg-MhuZOjtFYaWnyrcAnV8hqzusS4w () mail ! gmail ! com
[Download RAW message or body]

I noticed, when I've increased bufsize in libfuse and
FUSE_MAX_PAGES_PER_REQ in kernel I got better throughput.
To see the the difference you need to use fast target device, like
RAID or tmpfs.
Please see patches inline below.
I found that FUSE_MAX_PAGES_PER_REQ was set to 32, which is 128 KB for
4KB page many years ago:
334f485df       (Miklos Szeredi 2005-09-09 13:10:27 -0700
31)#define FUSE_MAX_PAGES_PER_REQ 32

Questions:
Are there plans to alter FUSE_MAX_PAGES_PER_REQ?
I can add configuration of this parameter, what are requirements?

diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 5c4adc4..ffa29f0 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -25,7 +25,8 @@
#include <linux/kref.h>

/** Max number of pages that can be used in a single read request */
-#define FUSE_MAX_PAGES_PER_REQ 32
+//#define FUSE_MAX_PAGES_PER_REQ 32
+#define FUSE_MAX_PAGES_PER_REQ 256 // 256 * PAGE_SIZE = 1 M

/** Bias for fi->writectr, meaning new writepages must not be sent */
#define FUSE_NOWRITE INT_MIN

diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index a960123..3a1f191 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -2829,8 +2829,9 @@ struct fuse_session *fuse_session_new(struct
fuse_args *args,
       if (se->debug)
               fprintf(stderr, "FUSE library version: %s\n", PACKAGE_VERSION);

-       se->bufsize = getpagesize() + 0x1000;
-       se->bufsize = se->bufsize < MIN_BUFSIZE ? MIN_BUFSIZE : se->bufsize;
+       //se->bufsize = getpagesize() + 0x1000;
+       //se->bufsize = se->bufsize < MIN_BUFSIZE ? MIN_BUFSIZE : se->bufsize;
+       se->bufsize = (1<<20) + 0x1000;

       list_init_req(&se->list);
       list_init_req(&se->interrupts);


-- 
Constantine Shulyupin
http://www.MakeLinux.co.il/
Embedded Linux Systems
Tel Aviv

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
-- 
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic