From nobody Tue Apr 25 16:24:16 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q5S4d3p8nz47Ng8 for ; Tue, 25 Apr 2023 16:24:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q5S4d2nC2z3rnH for ; Tue, 25 Apr 2023 16:24:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682439857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5ccwJs0QnyS3CfNec/IO657HKJrPMgNU7j4l7fxnjlA=; b=vwZezxGJoJSQ7HqYFSbZqyq7MhR6/PSLTzCS9szWzCc+C7MPxsogIOhlNZUol1VIHVm3QA PTU6iBmGMuK38jEAq+fzuj7ZyY6322UmFHdDYie9scxrzjXCuY4aO+2z4t7W1C/9UGqp6r SP1GvqIlVwGM7nBVZd62QlklrGl2sGozDkB6+K6DYsDNM+JrTvDOvcZl4JW4W09nfIQklp Mllfpi05TNDWkQ3Zncxs6iha0NY76gXNfvG2qr21vKbi2y2vIiuOFsi1MqlvS6o0ibs6OQ mciG9TcFzlbR3oFyyj4tGnDKu1wev7MuZeR7YLL8IfGBlxHM2YCCwEd29350rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682439857; a=rsa-sha256; cv=none; b=X2bs4WVUrc2uzDeQP84R/YiWIw/YJSKQwR9PoOVwXFhtrAGPZaW8cl79blkf6du1kqj3kz YvwD6xL7lYSqu47qnvv24Qi+pmq23UZtXXQJ7yNrB3YDeABbv7ZgmS/OP3d1OZkdRV3wDW ALaGe43aKeDJgLmV8DMPhqb8pd57g+Cnpus3vT+rmZeO4/cg1GAUn+CtWTtK1folmX4NaY kpxPHDzEpMa9wmFDRnqYWMTUSMNvDJmg3LmoyklneRvPNUbrTuaYRexVlHnbUK+s2ThK6q yoUw5RB9tVRh5WiYwcOi5Oljpn3m5oGRSn060fHWgDwRcWWuZKoQ/iTLka8J4w== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q5S4d1sG7z1DXg for ; Tue, 25 Apr 2023 16:24:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 33PGOHe9029558 for ; Tue, 25 Apr 2023 16:24:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 33PGOH0n029557 for bugs@FreeBSD.org; Tue, 25 Apr 2023 16:24:17 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 271065] Kernel FUSE limits read() size by 64k/128k Date: Tue, 25 Apr 2023 16:24:16 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: asomers@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271065 --- Comment #4 from Alan Somers --- (In reply to Ivan Rozhuk from comment #2) > fuse: unknown option(s): `-o async_read' > looks like it was not handled. > I do not see code to handle it in sshfs and in kernel FUSE. Annoying, because it's mentioned in the sshfs man page: https://linux.die.net/man/1/sshfs . > Read ahead is work. There is comment in kernel FUSE code that it read one > block ahead, so this is why I got 64+64=3D128k read request. Where do you see that comment? It's definitely possible to read ahead more than that. For example: $ cd /usr/tests/sys/fs/fusefs $ sudo sysctl vfs.usermount=3D1 $ sudo kldload fusefs $ mkdir mountpoint $ sudo chmod 1777 mountpoint $ ./read --gtest_filter=3DRA/ReadAhead.readahead/3 -v Note: Google Test filter =3D RA/ReadAhead.readahead/3 [=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from RA/ReadAhead [ RUN ] RA/ReadAhead.readahead/3 INIT ino=3D 0 ACCESS ino=3D 1 mask=3D0x1 LOOKUP ino=3D 1 some_file.txt OPEN ino=3D42 flags=3D0 BMAP ino=3D42 block=3D0 blocksize=3D0x10000 READ ino=3D42 offset=3D0 size=3D262144 [ OK ] RA/ReadAhead.readahead/3 (2 ms) [----------] 1 test from RA/ReadAhead (2 ms total) [----------] Global test environment tear-down [=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D] 1 test from 1 test case ran. (2 ms total) [ PASSED ] 1 test. That shows a 256kB read. By tweaking the test's source a bit, I can make it read up to 1 MB. I haven't tried higher. The FUSE server can limit the amount of readahead at mount time. Looking at the source, it seems that sshfs sets the limit to UINT_MAX. However, I see= a discrepancy between what libfuse does and what the fusefs test suite does.= =20 Could you please try this patch and tell me what you find? diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index 6ac7b4432e23..173fe7a71234 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -1096,7 +1096,7 @@ fuse_internal_send_init(struct fuse_data *data, struct thread *td) * fusefs currently reads ahead no more than one cache block at a t= ime. * See fuse_read_biobackend */ - fiii->max_readahead =3D maxbcachebuf; + fiii->max_readahead =3D maxphys; /* * Unsupported features: * FUSE_FILE_OPS: No known FUSE server or client supports it --=20 You are receiving this mail because: You are the assignee for the bug.=