From owner-freebsd-bugs@freebsd.org Mon Jun 15 12:33:58 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 978F0332BD4 for ; Mon, 15 Jun 2020 12:33:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49lrNk3XlYz4XJb for ; Mon, 15 Jun 2020 12:33:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 77D4A332DA0; Mon, 15 Jun 2020 12:33:58 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 779BC332D9F for ; Mon, 15 Jun 2020 12:33:58 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lrNk2ZJ4z4XLK for ; Mon, 15 Jun 2020 12:33:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 38E2F1DA2B for ; Mon, 15 Jun 2020 12:33:58 +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 05FCXv4Z011995 for ; Mon, 15 Jun 2020 12:33:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 05FCXv6p011891 for bugs@FreeBSD.org; Mon, 15 Jun 2020 12:33:57 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 247276] [fusefs] lockup when using mmap w/ direct_io Date: Mon, 15 Jun 2020 12:33:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: trapexit@spawn.link X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 12:33:58 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247276 Bug ID: 247276 Summary: [fusefs] lockup when using mmap w/ direct_io Product: Base System Version: 12.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: trapexit@spawn.link Attachment #215581 text/plain mime type: Created attachment 215581 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D215581&action= =3Dedit example mmap usage I'm the author of the FUSE based filesystem mergerfs. A user recently repor= ted that after updating to 12.1 some client software to mergerfs was locking up. rtorrent in particular.=20 rtorrent uses mmap. Linux's FUSE implementation is unable to handle mmap wh= en direct_io is enabled so I recommend to users not enable direct_io who need = any software leveraging mmap. The user hadn't read the docs and was using direc= t_io on FreeBSD. It appears that mmap does work on FreeBSD's FUSE implementation when direct_io is used so he had no issues. Once updated his setup started blocking and the apps became unkillable (wai= ting on IO). I wrote a simple mmap example to read and write to a shared mapped = file and could reproduce the issue. When direct_io is off everything works fine. If I enable direct_io I will s= ee read requests come into the mergerfs server and so long as I only read from= the mapped memory it works fine. When writing however as soon as it needs to fl= ush it seems to lock up. I don't see any write commands come in, the client app blocks and is unkillable, other calls into the filesystem seem to work brie= fly and then block. A stack trace of mergerfs seems to indicate that it is work= ing as normal and could take requests. If mergerfs is killed none of the clients receive an error from the syscalls they are blocked on. I've been able to reproduce this with sshfs by simply adding `direct_io` to= the mount options. Attached is an example that triggers it. --=20 You are receiving this mail because: You are the assignee for the bug.=