{"id":2230339,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2230339/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/patch/177747214856.4107473.4498426418327534752.stgit@frogsfrogsfrogs/","project":{"id":8,"url":"http://patchwork.ozlabs.org/api/1.1/projects/8/?format=json","name":"Linux ext4 filesystem development","link_name":"linux-ext4","list_id":"linux-ext4.vger.kernel.org","list_email":"linux-ext4@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<177747214856.4107473.4498426418327534752.stgit@frogsfrogsfrogs>","date":"2026-04-29T14:57:19","name":"[18/19] fuse4fs: disable fs reclaim and write throttling","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f7e8748ade8d7fc57c71ad121b1791b69cee16ae","submitter":{"id":77032,"url":"http://patchwork.ozlabs.org/api/1.1/people/77032/?format=json","name":"Darrick J. Wong","email":"djwong@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ext4/patch/177747214856.4107473.4498426418327534752.stgit@frogsfrogsfrogs/mbox/","series":[{"id":502087,"url":"http://patchwork.ozlabs.org/api/1.1/series/502087/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/list/?series=502087","date":"2026-04-29T14:53:09","name":"[01/19] fuse2fs: implement bare minimum iomap for file mapping reporting","version":1,"mbox":"http://patchwork.ozlabs.org/series/502087/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2230339/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230339/checks/","tags":{},"headers":{"Return-Path":"\n <SRS0=O3+I=C4=vger.kernel.org=linux-ext4+bounces-16207-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=iqMvmYIj;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=o3+i=c4=vger.kernel.org=linux-ext4+bounces-16207-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=104.64.211.4 arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org","gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=iqMvmYIj;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16207-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"iqMvmYIj\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5LP54fh6z1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 01:11:37 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g5LP5404sz4w91\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 01:11:37 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4g5LP53g3yz4wJs; Thu, 30 Apr 2026 01:11:37 +1000 (AEST)","from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4g5LP16fy3z4w91\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 30 Apr 2026 01:11:33 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 9BEDB304791B\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 29 Apr 2026 14:57:23 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 625BB3382C7;\n\tWed, 29 Apr 2026 14:57:20 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 2509C27EFE9;\n\tWed, 29 Apr 2026 14:57:19 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id B0D51C19425;\n\tWed, 29 Apr 2026 14:57:19 +0000 (UTC)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1777475497; cv=pass;\n\tb=rl44NFTm+PQCb7iVoDBCOP8JoxfjG2Gu7vuTXkWEw0Aha6v8zsNl7i/R+oIZNn66kEF7ohbIGmtxi+AHaiFxrh6F7JTD9TyVvs5gR6ZLUeY93zlzPl6WtJN92CJO3bjMMEgzO5zyU3JinJKLcgQREa4TvgYdQ3/gu5W5/4xxAgTU7VEzvQRtA4cLAXcEY0Wq+AgNVYT/Pv/NFONI9b4kuvB5j9ishk4dPKlKZ1RWJIPieORs3+flt4TeVQ59pRg6N24tKtnYH6NlWSXJ8c9dNTicbhicvwcQunF8yKHasAUYsHlq2BAM0q1Yl+vuXAx+yVLhDWBbYky8aCjFFusw5g==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777474640; cv=none;\n b=PGa+/YdU2i3VWEK5gSPHD3ONpyKoSAvRM6O38xxV3Q2YsX+vfcRw9+35pG04RXbE8dvgYf+UXfRGub12IO968TQ5N/RZeDyb1TE/MDOuOrZwA8Y3prqoxqliQj3qJiV6XhjCLHDUoNizs9gdvyhZJ9XRXge+SOKFpAbtg+rZBS8="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1777475497; c=relaxed/relaxed;\n\tbh=opW0dCMf9Qp9RHWewva9kmrneAbe/f0pWazNA2R8gtE=;\n\th=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=eDzPzgge4MnBL4ltAYck1FqMhW4TXW+k6yUqHbbSAn//Vg13c9UCcEyOdHtqDUpA8LXUjYNqyweDxJ4ayRYCAdsyDaIUK/DqzGJb00JyuB/dJPoM1pocGB9P8NsCk1htf0TlMyOECv6tkLFE+LsB1xvgei6ukpEqiU3akk7oaob28IRWigb7MgvQMuL6hQ+Ih8mSY812L5WEmpehT6dNVBkVPIz4HOYuLRQqAXECHmNqnOZlqBLo995esgI91mfzLULKeym/Cfsk+gVKfgu78BQnTk5jzXmTl+qFFEPbknXMLDtjGLgi6IQpCTrPcXz0SvEBuleY27zlGKNdiLHRFg==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777474640; c=relaxed/simple;\n\tbh=tCi7wwALN1ce27SquWkJbr9vDfxpixM4HQt7Q00zrgk=;\n\th=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=Fr7OPLSQ5VuYmsqVfbnkbdM+mRfODSuoS5sX49NMHTweKH9ez9kNbuKGJcHlAKE6V/oZf7qwUSvbIRfcuLXekZRjTyHoJOhnMu9mGyngyIstjbwWJQECbMMwjNI7jo9L2osf6uLT3V8S+5W/m5OKWNcOz93vHu5CIMCOPsfOJ8Q="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=iqMvmYIj; dkim-atps=neutral;\n spf=pass (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16207-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=iqMvmYIj; arc=none smtp.client-ip=10.30.226.201"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777474639;\n\tbh=tCi7wwALN1ce27SquWkJbr9vDfxpixM4HQt7Q00zrgk=;\n\th=Date:Subject:From:To:Cc:In-Reply-To:References:From;\n\tb=iqMvmYIjQBkXa8+Erogr/iISdGVSr1jxu4ZNvlmcgBG7yxSdOqz8luB8B2vTBMnmj\n\t IiirlW7fn1hK97Frs88fZc9myOlMLXaE9QUCZ27VPYVemzh/nMv9zbP/jXgGvomwzS\n\t GwUZQZuuscSdhEoq8axaUW6JwUImq5XBqzFxCTQ8hbleXwu8kxFQnt7p5t9DhYlKwY\n\t F1VR1vQTXd7ZMJV5iCdBXpcMMbszrL20lEg+LjEXxTCz7uBTPUfTqUNMouHDjNVPYK\n\t xcWniLz5/6fqQBAIDiiYITw4839bN9CCqmnQ5UJy0o0GW46jXC3iH4HUEcuWjVer4G\n\t VA/l7pH+jAWDA==","Date":"Wed, 29 Apr 2026 07:57:19 -0700","Subject":"[PATCH 18/19] fuse4fs: disable fs reclaim and write throttling","From":"\"Darrick J. Wong\" <djwong@kernel.org>","To":"tytso@mit.edu","Cc":"bernd@bsbernd.com, miklos@szeredi.hu, linux-ext4@vger.kernel.org,\n neal@gompa.dev, linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev,\n joannelkoong@gmail.com","Message-ID":"<177747214856.4107473.4498426418327534752.stgit@frogsfrogsfrogs>","In-Reply-To":"<177747214459.4107473.9520724883867588970.stgit@frogsfrogsfrogs>","References":"<177747214459.4107473.9520724883867588970.stgit@frogsfrogsfrogs>","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","X-Spam-Status":"No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"},"content":"From: Darrick J. Wong <djwong@kernel.org>\n\nAsk the kernel if we can disable fs reclaim and write throttling.\n\nDisabling fs reclaim prevents livelocks where the fuse server can\nallocate memory, fault into the kernel, and then the allocation tries to\ninitiate writeback by calling back into the same fuse server.\n\nDisabling BDI write throttling means that writeback won't be throttled\nby metadata writes to the filesystem.\n\nSigned-off-by: \"Darrick J. Wong\" <djwong@kernel.org>\n---\n fuse4fs/fuse4fs.c |   36 ++++++++++++++++++++++++++++++++++--\n 1 file changed, 34 insertions(+), 2 deletions(-)","diff":"diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c\nindex 49708bdf7b655d..6ea2d30772ae5a 100644\n--- a/fuse4fs/fuse4fs.c\n+++ b/fuse4fs/fuse4fs.c\n@@ -7969,6 +7969,19 @@ static void try_set_io_flusher(struct fuse4fs *ff)\n #endif\n }\n \n+/* Undo try_set_io_flusher */\n+static void try_clear_io_flusher(struct fuse4fs *ff)\n+{\n+#ifdef HAVE_PR_SET_IO_FLUSHER\n+\t/*\n+\t * zero ret means it's already set, negative means we can't even\n+\t * look at the value so don't bother clearing it\n+\t */\n+\tif (prctl(PR_GET_IO_FLUSHER, 0, 0, 0, 0) > 0)\n+\t\tprctl(PR_SET_IO_FLUSHER, 0, 0, 0, 0);\n+#endif\n+}\n+\n /* Try to adjust the OOM score so that we don't get killed */\n static void try_adjust_oom_score(struct fuse4fs *ff)\n {\n@@ -8022,6 +8035,23 @@ static int fuse4fs_event_loop(struct fuse4fs *ff,\n \t\t\t      struct fuse_loop_config *loop_config,\n \t\t\t      const struct fuse_cmdline_opts *opts)\n {\n+\tbool clear_io_flusher = false;\n+\tint ret;\n+\n+\t/*\n+\t * Try to set ourselves up with fs reclaim disabled to prevent\n+\t * recursive reclaim and throttling.  This must be done before starting\n+\t * the worker threads so that they inherit the process flags.\n+\t */\n+\tret = fuse_lowlevel_disable_fsreclaim(ff->fuse, 1);\n+\tif (ret) {\n+\t\terr_printf(ff, \"%s: %s.\\n\",\n+ _(\"Could not register as FS flusher thread\"),\n+\t\t\t   strerror(-ret));\n+\t\ttry_set_io_flusher(ff);\n+\t\tclear_io_flusher = true;\n+\t}\n+\n \t/*\n \t * Since there's a Big Kernel Lock around all the libext2fs code, we\n \t * only need to start four threads -- one to decode a request, another\n@@ -8032,7 +8062,10 @@ static int fuse4fs_event_loop(struct fuse4fs *ff,\n \tfuse_loop_cfg_set_idle_threads(loop_config, opts->max_idle_threads);\n \tfuse_loop_cfg_set_max_threads(loop_config, 4);\n \n-\treturn fuse_session_loop_mt(ff->fuse, loop_config) == 0 ? 0 : 8;\n+\tret = fuse_session_loop_mt(ff->fuse, loop_config) == 0 ? 0 : 8;\n+\tif (clear_io_flusher)\n+\t\ttry_clear_io_flusher(ff);\n+\treturn ret;\n }\n \n #ifdef HAVE_FUSE4FS_SERVICE\n@@ -8251,7 +8284,6 @@ int main(int argc, char *argv[])\n \t\t}\n \t}\n \n-\ttry_set_io_flusher(&fctx);\n \ttry_adjust_oom_score(&fctx);\n \n \t/* Will we allow users to allocate every last block? */\n","prefixes":["18/19"]}