linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolaus Rath <Nikolaus@rath.org>
To: linux-fsdevel@vger.kernel.org,
	fuse-devel <fuse-devel@lists.sourceforge.net>
Subject: [fuse] Why is readahead=0 limiting read size?
Date: Sat, 21 Mar 2020 13:39:37 +0000	[thread overview]
Message-ID: <87r1xlesiu.fsf@vostro.rath.org> (raw)

Hello,

When issuing a 16 kB read request from userspace and the default FUSE
readahead settings, data is read in batches of 32k:

$ example/passthrough_ll -d mnt
FUSE library version: 3.9.1
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.27
flags=0x003ffffb
max_readahead=0x00020000
   INIT: 7.31
   flags=0x0000f439
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   time_gran=1
   unique: 1, success, outsize: 80
unique: 2, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 20822
lo_lookup(parent=1, name=bin)
  1/bin -> 140290677541808
   unique: 2, success, outsize: 144
unique: 3, opcode: LOOKUP (1), nodeid: 140290677541808, insize: 45, pid: 20822
lo_lookup(parent=140290677541808, name=bash)
  140290677541808/bash -> 140290677542048
   unique: 3, success, outsize: 144
unique: 4, opcode: OPEN (14), nodeid: 140290677542048, insize: 48, pid: 20822
lo_open(ino=140290677542048, flags=32768)
   unique: 4, success, outsize: 32
unique: 5, opcode: FLUSH (25), nodeid: 140290677542048, insize: 64, pid: 20822
   unique: 5, success, outsize: 16
unique: 6, opcode: READ (15), nodeid: 140290677542048, insize: 80, pid: 20822
lo_read(ino=140290677542048, size=32768, off=0)
   unique: 6, success, outsize: 32784
unique: 7, opcode: FLUSH (25), nodeid: 140290677542048, insize: 64, pid: 20822
   unique: 7, success, outsize: 16
unique: 8, opcode: RELEASE (18), nodeid: 140290677542048, insize: 64, pid: 0
   unique: 8, success, outsize: 16


However, when disabling readahead, the read size decreases to 4k:


$ example/passthrough_ll -d mnt
FUSE library version: 3.9.1
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.27
flags=0x003ffffb
max_readahead=0x00020000
   INIT: 7.31
   flags=0x0000f439
   max_readahead=0x00000000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   time_gran=1
   unique: 1, success, outsize: 80
unique: 2, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 20911
lo_lookup(parent=1, name=bin)
  1/bin -> 140509922200528
   unique: 2, success, outsize: 144
unique: 3, opcode: LOOKUP (1), nodeid: 140509922200528, insize: 45, pid: 20911
lo_lookup(parent=140509922200528, name=bash)
  140509922200528/bash -> 140510056418784
   unique: 3, success, outsize: 144
unique: 4, opcode: OPEN (14), nodeid: 140510056418784, insize: 48, pid: 20911
lo_open(ino=140510056418784, flags=32768)
   unique: 4, success, outsize: 32
unique: 5, opcode: FLUSH (25), nodeid: 140510056418784, insize: 64, pid: 20911
   unique: 5, success, outsize: 16
unique: 6, opcode: READ (15), nodeid: 140510056418784, insize: 80, pid: 20911
lo_read(ino=140510056418784, size=4096, off=0)
   unique: 6, success, outsize: 4112
unique: 7, opcode: READ (15), nodeid: 140510056418784, insize: 80, pid: 20911
lo_read(ino=140510056418784, size=4096, off=4096)
   unique: 7, success, outsize: 4112
unique: 8, opcode: READ (15), nodeid: 140510056418784, insize: 80, pid: 20911
lo_read(ino=140510056418784, size=4096, off=8192)
   unique: 8, success, outsize: 4112
unique: 9, opcode: READ (15), nodeid: 140510056418784, insize: 80, pid: 20911
lo_read(ino=140510056418784, size=4096, off=12288)
   unique: 9, success, outsize: 4112
unique: 10, opcode: FLUSH (25), nodeid: 140510056418784, insize: 64, pid: 20911
   unique: 10, success, outsize: 16
unique: 11, opcode: RELEASE (18), nodeid: 140510056418784, insize: 64, pid: 0
   unique: 11, success, outsize: 16



Is that intentional? If so, why?

Is there any way to get larger read requests without also enabling
readahead?

(I am generating the userspace request with

$ dd if=<mountpoint>/bin/bash of=/dev/null bs=16k count=1)


Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

             reply	other threads:[~2020-03-21 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-21 13:39 Nikolaus Rath [this message]
2020-03-26 10:38 ` [fuse] Why is readahead=0 limiting read size? Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1xlesiu.fsf@vostro.rath.org \
    --to=nikolaus@rath.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).