From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77891C52D7C for ; Thu, 22 Aug 2024 17:01:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05C766B00A0; Thu, 22 Aug 2024 13:01:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1F808001E; Thu, 22 Aug 2024 13:01:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE68A80041; Thu, 22 Aug 2024 13:01:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id BE2968001E for ; Thu, 22 Aug 2024 13:01:09 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 69E971C410D for ; Thu, 22 Aug 2024 17:01:09 +0000 (UTC) X-FDA: 82480496658.25.B8CC71E Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by imf28.hostedemail.com (Postfix) with ESMTP id 420ABC0041 for ; Thu, 22 Aug 2024 17:01:06 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BMw108jw; spf=pass (imf28.hostedemail.com: domain of joannelkoong@gmail.com designates 209.85.160.173 as permitted sender) smtp.mailfrom=joannelkoong@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724345985; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tuwl4rzkAcyRVZqp56l8KyXW3qwZYMG4uOgDY/0J1+4=; b=zCkrMESxBWJDhGIdP1GKfxL0jp4nI/YqhhBE8eSiBBuhPD9eZ1Bf5qc3hkNfmIofi8i1Ta J8VHEuO4KwbAqQ6Dw19tAHnek4IRU1zz1ngjUxwSUmPYV4cXiK7GXfpVV4xnYk8+VqfsQ0 3iCN/gDG75MyrCP27/iE2tcnv8CgtLM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724345985; a=rsa-sha256; cv=none; b=wbokoFPsdf0yOh/rAFdlbMU4zXo/PJn1wrn3gnTk5yrwz8Tzl/h9UeoUtSx7tZPOIStNUv tkwHLkr4xai1i9tJXoBqwoj0xCW6Hr28DJpCLhpCO1BFf4PgSJrQbV6SqbVqL+/+EColW5 3Za7D10pV8sgJYko3iYMpsgf9ZLCZkQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BMw108jw; spf=pass (imf28.hostedemail.com: domain of joannelkoong@gmail.com designates 209.85.160.173 as permitted sender) smtp.mailfrom=joannelkoong@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-44fe58fcf2bso6235341cf.2 for ; Thu, 22 Aug 2024 10:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724346065; x=1724950865; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tuwl4rzkAcyRVZqp56l8KyXW3qwZYMG4uOgDY/0J1+4=; b=BMw108jwqSX+Bio/OZIFlivwl+Zy8pb/GtBZlHp52UHNZDUYD/8gxG2nnTn5CH41q7 LOHm5jKX+AtDFlgG9oGMUwo9LtYVntRMRaSR9rW3coN2wVyAxO6NjIOL0Rzb4yfG/6I/ c7gr+7gnTVTNZ5aV1mnK8vb/SiS/m94l7FdqVh29ysnnu5TdudzS6cFv8CxjD2ZECiqk OwH057D07qxVl4P+1nLuda0w5WjeP6S4RAIJUoiCvwWdH8v5dgE4X0dUVm2THPby0TLK IucWmxxZxM7Ftpnz96qMSglH2zu7/ViGrah7N/VdYI6rrw9PHfY3j8C5k5NTiJNFpF+c aKgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724346065; x=1724950865; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tuwl4rzkAcyRVZqp56l8KyXW3qwZYMG4uOgDY/0J1+4=; b=Q6/RnW6kPt6RWw6VD4jQpvpANFGF6ziX2QnVlCCtk38kXjyjmN3Lv7HGzHnXV6pJCr fc9SjmXZTfNHtvGQaz3YUWYYpD8oSxK6ztwrXowUm61gPWkB/Zt37+AqABVFVvCFiu7w 2okH0OiVFaNq8aYiUzAt4x+9VKh4vX9QyIw/xFEXbelIfkGF8kVQjtu0CPLxhC3PBlUt r5CtYwHTd6v0NV9WGwzgeXTWLtvdfY642KhE/UXkSbXRpwqvhp2IdEUzyBm9jpDObhAg rX8TqGObPeYVkJY2M0NZYBmduN98qF6a9fWBwf8jtljZ3OdSk9xDh/1pYVjGgfyqW/T8 O6lQ== X-Forwarded-Encrypted: i=1; AJvYcCX5T1evOaKz8/4BwqZnUnHlO33XkPR8hQTENk+oKH/8U5VV+Aq1yh/svQ29+4htgSipSQN2twOXCQ==@kvack.org X-Gm-Message-State: AOJu0Yxn3180HTWhD5i0nn88Eb0BUmt7UNjiBm6xrbK95IO+tB9SN55T DQHuOxjLsC6JbseZVtXjt+kNDe9aqcj92A9FXuCu24sAJT9vG2rPcfQhKw6VRQgfZBtyDJUE5w9 VCp4pJxMpINStQs1LTy7HJDu8PSI= X-Google-Smtp-Source: AGHT+IHUeiRGLKAv+AloQUOB3Dht/6V5uELOuqjosFjmD4sPq3W1dSn1FBnAJBuZA0EHHirrfld/27lV5HUwqUvKI20= X-Received: by 2002:a05:622a:518f:b0:453:17e0:5516 with SMTP id d75a77b69052e-454ff7cbcd2mr32573891cf.36.1724346065050; Thu, 22 Aug 2024 10:01:05 -0700 (PDT) MIME-Version: 1.0 References: <495d2400-1d96-4924-99d3-8b2952e05fc3@linux.alibaba.com> <67771830-977f-4fca-9d0b-0126abf120a5@fastmail.fm> <2f834b5c-d591-43c5-86ba-18509d77a865@fastmail.fm> In-Reply-To: From: Joanne Koong Date: Thu, 22 Aug 2024 10:00:54 -0700 Message-ID: Subject: Re: [HELP] FUSE writeback performance bottleneck To: Miklos Szeredi Cc: Bernd Schubert , Jingbo Xu , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , lege.wang@jaguarmicro.com, "Matthew Wilcox (Oracle)" , "linux-mm@kvack.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 420ABC0041 X-Stat-Signature: 3pst6c3ixrssqcgksj95ttiir89f7akt X-HE-Tag: 1724346066-153402 X-HE-Meta: U2FsdGVkX1+ksX5/gV2LqoraZqYPab9T9hu1WzLpU+sAz3ATvoT3EzrrppiA0z/Fyfthh/7RupQBCYu2XN33ic6KJWAakypO14hDF5rpxBiYsNd8myOsdjfCdQf4sSRr+2Iwg8EDRVBUyG9gz84b65vS1y6Dnl6G7lkVqEIcNodcNCiQiW0F4YzfRo6+sJ3Ffs94kb4/tkvWhgn0IkD1y9KcKcsSprNGQbWpDEYwA/NrGA9QWweHQflWiwJwlx4fFtZ7YWD7pAKyUTb4yTxclvX/fW1h652vMTnnYryj0H9efXE4/n3yPC6J79q2JXYV2N7a/zlMq5qVyJqOAId1s5IV2fzJo3trtd95oneXTzGo8ASXUlqifSKj6isZ1GvoHi/x+KJi5FNTqsg5A1DwO9hrug2zbGjj5PhhVuYhImumtGq325Ejn43xw0x/zJrxqS+9FQOgKwyrm/Ct/GQL0oRvI5JVtcGODavB2509dbOVH/fT1SjPCU2UoLmB6gzd7OIksUSGACiKTEaXU+gIgQd/BFEqi5BNkv3KKOOgwNJaePjMxnDfR7QZCUOhQrecloPD/DhgG8R9XNzT8dzPQHsDRXWL5Z8lga2686RBLHggsMKwfwWr/EddEOt1GLUs6vo6Z9RWyiJESWd76xF1uO9WmSoPxSLL5Un9N6KcmvBK0WA9HazzewyPzzJzM3hmyqazYXOWOzqpxBxTMPDa3hISy6j/9phFlTZ0uF07U9HWsLa65ofujHTibJVckyDnXK3Uthgb3aDtQuogo5nMMnqAzovxIs0tfJJjmyujyS3hGTyLJjk7xPZuix9QeIHYAL7MpDXICGF0Va2xWXeB+TpjbmRdQ22jTS0VOC0fRQ8XifediZ36khoYiVg4/iPi1dliL7RxshhHzXF8cvbQ7MU0y958gJyr6aLQmQnFNyuQMNb7+6rSAc/HnLcygexMgv5V3g9vj7xVvqC5xrM CRLCMoLm QlBBnDn80l94T9H7sLbLlIjqFDZhLKBOkQZTZcoGL9ic3q6CwzDztLgq7brZU8i+KGXemvyugEFZW3B1fThAWHdhu5rRMQ684YedynAwMFm0vSpCE+DvtSWPz/rSd4q2MMF2cnZcIp1rmyyxUoHs94HTMfo8OpCA6hAr29WWSTBvjXYPkoITGEq+m/SyK5CU0V8tta0G9tWkPPThA9xVutNeLqXmSKwW7wMVTCFWqauLwVPGNcZCiQ+7MMeOg81ZGm8KxsRdvigRGu1tkKkbsW0Arqgl36T1mocI1FfgpH8KkepBQ6L3F5iB8tfJXn6zdDsuO1kaZvfB3zw7PJgNmFpOgiw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Jun 4, 2024 at 3:02=E2=80=AFAM Miklos Szeredi w= rote: > > On Tue, 4 Jun 2024 at 11:32, Bernd Schubert = wrote: > > > Back to the background for the copy, so it copies pages to avoid > > blocking on memory reclaim. With that allocation it in fact increases > > memory pressure even more. Isn't the right solution to mark those pages > > as not reclaimable and to avoid blocking on it? Which is what the tmp > > pages do, just not in beautiful way. > > Copying to the tmp page is the same as marking the pages as > non-reclaimable and non-syncable. > > Conceptually it would be nice to only copy when there's something > actually waiting for writeback on the page. > > Note: normally the WRITE request would be copied to userspace along > with the contents of the pages very soon after starting writeback. > After this the contents of the page no longer matter, and we can just > clear writeback without doing the copy. > > But if the request gets stuck in the input queue before being copied > to userspace, then deadlock can still happen if the server blocks on > direct reclaim and won't continue with processing the queue. And > sync(2) will also block in that case. Why doesn't it suffice to just check if the page is being reclaimed and do the tmp page allocation only if it's under reclaim? > > So we'd somehow need to handle stuck WRITE requests. I don't see an > easy way to do this "on demand", when something actually starts > waiting on PG_writeback. Alternatively the page copy could be done > after a timeout, which is ugly, but much easier to implement. > > Also splice from the fuse dev would need to copy those pages, but that > shouldn't be a problem, since it's just moving the copy from one place > to another. > > Thanks, > Miklos