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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AF06C433EF for ; Fri, 3 Dec 2021 18:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382394AbhLCSPh (ORCPT ); Fri, 3 Dec 2021 13:15:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21918 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbhLCSPg (ORCPT ); Fri, 3 Dec 2021 13:15:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638555131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OVm0OT3iBmxonhyx3ujuxwBXaBB+Vd0lpl9c1C741QI=; b=SDGIAOVsTgpouyQCGSUEeUTY3TLazJ+oIUCvgwXu4TJrrGXaFyQRzA5bKyDu5x0J+Tf9Jx U+t1lIhN6LwPO7/e6VqBShTXdYXe253O6fAP2/DxQBwpCcn14xTJsqosUpkIIktknP6vgD YyE8y8FsVKnlU9hj9doEgMm07rSqVjo= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-592-Lhv9Cyw1M4-hGSZlKqiNuA-1; Fri, 03 Dec 2021 13:12:10 -0500 X-MC-Unique: Lhv9Cyw1M4-hGSZlKqiNuA-1 Received: by mail-wm1-f70.google.com with SMTP id 138-20020a1c0090000000b00338bb803204so1902752wma.1 for ; Fri, 03 Dec 2021 10:12:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OVm0OT3iBmxonhyx3ujuxwBXaBB+Vd0lpl9c1C741QI=; b=pDA0irE0N1fVmAoZ5cgiHL3F7+YApnqFN00PaJivapWmFJ1mLcqELHtSDHCLw1Ox5I W2p6ZvMmTsgCeHGujkuWzwqnvECQKwmRl6Y9XOZdMFauQm/cXmkhyeAT79FyJyinONJh ujOk194SSXfySA1GHj7Wth3Z/4BD0a2rW2Y0EyWmBKVI3STHkj8lKLLKja3u8RIglhc1 WsvZil6MPqLXxmEyWQz3NpSEDlOAXkrNj1oVgWrCZu1BFcTE4S5MPmyovSge2CsoZUN/ fxq4SAK6PUqVNnqopEJaZntvPeHO3oWw1Q/ymYPsY0S0pD0DGmcXhmXlf6ksH1mvoOXX 96dA== X-Gm-Message-State: AOAM5337clDPJT2kx31FMwfxbKGFXq3ptgUBlg1Xzs/KnMqrx6DkruaP COvyB44WEptKXnN2tpBkjIl5OENEBU+PtucPNBHofFRZvC52b2FC7e97YgOwrusFqqWcGD38XLl bz3RYUxez70UedJIfSph5JRTOmHGkNKoxLOpOE5Z/ X-Received: by 2002:a1c:f005:: with SMTP id a5mr17543367wmb.19.1638555129440; Fri, 03 Dec 2021 10:12:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQR6sbSMWp+wr1XbwmFPvbhovhVed+t90DxqkiD9Bo9uH//esaslD4B3M/FOP3e48MFHRzNCb7WdlY5ZTcAIE= X-Received: by 2002:a1c:f005:: with SMTP id a5mr17543328wmb.19.1638555129216; Fri, 03 Dec 2021 10:12:09 -0800 (PST) MIME-Version: 1.0 References: <20211201193750.2097885-1-catalin.marinas@arm.com> In-Reply-To: From: Andreas Gruenbacher Date: Fri, 3 Dec 2021 19:11:58 +0100 Message-ID: Subject: Re: [PATCH v2 0/4] Avoid live-lock in fault-in+uaccess loops with sub-page faults To: Linus Torvalds Cc: Catalin Marinas , Josef Bacik , David Sterba , Al Viro , Andrew Morton , Will Deacon , Matthew Wilcox , linux-fsdevel , LKML , Linux ARM , linux-btrfs Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 3, 2021 at 6:58 PM Linus Torvalds wrote: > On Fri, Dec 3, 2021 at 7:29 AM Andreas Gruenbacher wrote: > > We're trying pretty hard to handle large I/O requests efficiently at > > the filesystem level. A small, static upper limit in the fault-in > > functions has the potential to ruin those efforts. So I'm not a fan of > > that. > > I don't think fault-in should happen under any sane normal circumstances. > > Except for low-memory situations, and then you don't want to fault in > large areas. > > Do you really expect to write big areas that the user has never even > touched? That would be literally insane. > > And if the user _has_ touched them, then they'll in in-core. Except > for the "swapped out" case. > > End result: this is purely a correctness issue, not a performance issue. It happens when you mmap a file and write the mmapped region to another file, for example. I don't think we want to make filesystems go bonkers in such scenarios. Scaling down in response to memory pressure sounds perfectly fine though. Thanks, Andreas