Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp3573520rwb; Sun, 30 Jul 2023 10:35:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlErYspwCrQHp0g457cFE3mUXapTH1ynrQa9yLfePml5rR9f2kx8aQGNJa6AIJG9JAM922qY X-Received: by 2002:a17:902:d483:b0:1bb:91f2:bb32 with SMTP id c3-20020a170902d48300b001bb91f2bb32mr9397450plg.39.1690738519988; Sun, 30 Jul 2023 10:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690738519; cv=none; d=google.com; s=arc-20160816; b=IMt7Ijof0WcU34hr7XWehA/ySA8u8q9Fi+sEAjHbJeXXWe+WYnyo24pi00jSNE0mRI mekKLfjHMCTrAUfnjSLfWUMwMQHzkDWg0oPpA0DKmYiFpN+be6kvef9ASSqm3k9Z8v/T xL1m+VwF2VyWPr9gIbkAqsrpiLUYfW6JqG56gnT9OBhOZD4L5tqMCaS+FsFIhvJ/1WqL ilBy0SWinZNuxYzNSuNz9M4iboc/RU/24LS0/ccw6UNsWqN4BAfEp3muFpsKMmkFqFm8 BPsr664WvBhMFN0c4Ct6sUah9L6Ko74x61/mWTVWyzex3YUKhlEjqOO75V2ddrwjseT9 BQ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=MOc3sAM7hTvO70uQD/m9fZDrRb5SABF2nw7C9wZtKX8=; fh=NeL54igG4ibVW55k2PQRXyd5j/1zhefRRoFSo8rxapY=; b=KFeVn0KkKyILTK+vIBNQ8fBXfb7mCh/G3BVmNerkJT/3xoj5vomTq0X7eXglTtxq1m eJ0BsY2+O/gwMbzAeYllnyxDAAxNvtfLvrB4dwbNMNCBZXc6r6/g8BWfVL+wZVM4hFoT A/gbb07GGPM06YwVdHM5b2c1P4j6jh4NKYxvyKxfz8Q+5TDMRStP0wPeqcv+S37MoSKb Pi6MzmhiNatPnkJDYt+lFJPdO80SVu47cu9r1lOnqJ6yYxsYJ4n4W3afBepXJWvNUFjB d1O3v2BZ/rwuh+NGtYFfc48PLla9f6J9Ak9SASZLRLLlmVlwgHNO0/jhCP11+nCesy5x Idaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=VRJUGNdO; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a170902684d00b001bba6128bf5si5999656pln.368.2023.07.30.10.35.06; Sun, 30 Jul 2023 10:35:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=VRJUGNdO; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229501AbjG3Quz (ORCPT + 99 others); Sun, 30 Jul 2023 12:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbjG3Quy (ORCPT ); Sun, 30 Jul 2023 12:50:54 -0400 Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12DA51A5 for ; Sun, 30 Jul 2023 09:50:54 -0700 (PDT) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-583d702129cso39758227b3.3 for ; Sun, 30 Jul 2023 09:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690735853; x=1691340653; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=MOc3sAM7hTvO70uQD/m9fZDrRb5SABF2nw7C9wZtKX8=; b=VRJUGNdOo9yMXtnka8zKkl1PjpZ+2Vm6W3+/xtQ1VST2i7zAukOA7oMx0ozyCe40Es fCvAF1pAOInKQiIfEqt/w5ar/y+86Sq3DK+MULvwtqjQIPFAju8l7jlc00m8kxmcoBYD i8RxouS/f9mnL41JvJ5sjFxnkZRlyIT5BhzPKCQdqura4EbI+2qWzydZxaxylt8XiC5E MHwtcmyy3NlXT2bgQ1N2xZ6rwIUeOGZmdS8NRBmk9nGMU10YZxM4Y7UnEk5xxG9Ar+En DlB++9F2tBivYrwca0A4ILMHfAS8sq7fCtHPqmfF2FoxccV/XekEQrVcS+9cT5Jff0Gr PLJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690735853; x=1691340653; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MOc3sAM7hTvO70uQD/m9fZDrRb5SABF2nw7C9wZtKX8=; b=gc92vEl4eY+YQrdA3tyh0dZaKz16+7QEL45A3MnmYwwt7n81EApTINs61jEwvod97G PLY8lLFUz9FN36GK0CYYJ4dtWyQ1ycL2FnTRsBecgZVN2DPoJcVNneZk9aj1lqfUhioL 2tbDmVSEktCK0QzfBdNQRWN4qqepyIeMf3GowWuaZ61P98Y6pHl9yeJx3kSMGtNQGE2A CdsZhbVfLHJxBiJOuKGouNZUoE39iQveONd35rYxPBkseLH0onzXNCjSrqHwAeRMasi7 EFT6vuCmIHketPiervtZE6dTKK+OdREI8oGjMTRJ/8fAgpDcj5y+9F+gQFNQOmNqrWmj 1B9g== X-Gm-Message-State: ABy/qLa4lJQTJvJPqx0kZFUBsAKBVjOcpIieRgK+U9WpQNEFP60gwLV0 ASJhNJS93owZvtcgGN136iqyaQ== X-Received: by 2002:a81:910a:0:b0:56c:ed71:a4ca with SMTP id i10-20020a81910a000000b0056ced71a4camr7546472ywg.1.1690735853181; Sun, 30 Jul 2023 09:50:53 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id m79-20020a0dca52000000b00545a08184cesm1020928ywd.94.2023.07.30.09.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jul 2023 09:50:52 -0700 (PDT) Date: Sun, 30 Jul 2023 09:50:44 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Chuck Lever cc: NeilBrown , Chuck Lever , David Howells , Jeff Layton , Hugh Dickins , Jens Axboe , Matthew Wilcox , linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] nfsd: Fix reading via splice In-Reply-To: Message-ID: <3082a8da-4a13-de28-ed50-8aa2e7a59afd@google.com> References: <169054754615.3783.11682801287165281930.stgit@klimt.1015granger.net> <169058849828.32308.14965537137761913794@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sun, 30 Jul 2023, Chuck Lever wrote: > On Sat, Jul 29, 2023 at 09:54:58AM +1000, NeilBrown wrote: > > On Fri, 28 Jul 2023, Chuck Lever wrote: > > > From: David Howells ... > - This fix is destined for 6.5-rc, which limits the amount of > clean up and optimization we should be doing > > I'd like to apply David's fix as-is, unless it's truly broken or > someone has a better quick solution. I certainly have no objection to you doing so; and think that you and David will have a much better appreciation of the risks than me. But I ought to mention that this two-ZERO_PAGEs-in-a-row behaviour was problematic for splice() in the past - see the comments on ZERO_PAGE(0) and its alternative block in shmem_file_read_iter(). 1bdec44b1eee ("tmpfs: fix regressions from wider use of ZERO_PAGE"): ah, that came from a report by you too, xfstests on nfsd. In principle there's a very simple (but inferior) solution at the shmem end: for shmem_file_splice_read() to use SGP_CACHE (used when faulting in a hole) instead of SGP_READ in its call to shmem_get_folio(). (And delete all of shmem's splice_zeropage_into_pipe() code.) I say "in principle" because all David's testing has been with the SGP_READ there, and perhaps there's some gotcha I'm overlooking which would turn up when switching over to SGP_CACHE. And I say "inferior" because that way entails allocating and zeroing pages for holes (which page reclaim will then free later on if they remain clean). My vote would be for putting David's nfsd patch in for now, but keeping an open mind as to whether the shmem end has to change, if there might be further problems elsewhere than nfsd. Hugh