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 4E887C433EF for ; Thu, 7 Apr 2022 22:04:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B94416B0072; Thu, 7 Apr 2022 18:04:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B432A6B0073; Thu, 7 Apr 2022 18:04:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0D056B0074; Thu, 7 Apr 2022 18:04:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 9267A6B0072 for ; Thu, 7 Apr 2022 18:04:41 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 61D86255A0 for ; Thu, 7 Apr 2022 22:04:31 +0000 (UTC) X-FDA: 79331462742.09.05F31D9 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) by imf24.hostedemail.com (Postfix) with ESMTP id D67EC18000C for ; Thu, 7 Apr 2022 22:04:30 +0000 (UTC) Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-ddfa38f1c1so7865818fac.11 for ; Thu, 07 Apr 2022 15:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=58SSCJZXblAmvBhjeOB3uU7MwelxZJPYCI86bkrnS8E=; b=XgwIWPe4EmdEZzg2aaVL2kxNLbvNgtQDgA6CSmpYKHkmeCwbHkMVlvkx7EZXnFHO7x J4SENl4Kv459oEqbYIEqiYidiPRy2CAjIFGXnioedXGzr36OF1H2DkSJyBMBC6z2evxG ujxE2friAAG/Zl0uHBA5b6H+yYJKsHEbPH6JWlM7x9jyydRQcfHfaG4RYdDuX4izPVUy BUlIz/KJJJd3RmEBjuwka9CSK4AWLbHSWUwXCMjbjS1cOWXJCdVd70StvQcN6RjGDRYR LWZcR6+S/E+oBAOD/XW6YTBmfANzfiNjyarFB/JqspP7loBQBTX5qFG7/McZ3M07LdLI ItUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=58SSCJZXblAmvBhjeOB3uU7MwelxZJPYCI86bkrnS8E=; b=VG3HTsKKdWB/f1FXbGp8vfiwcA+ZO9yR7tqYSa1op+zcnbl0eD+NzyNTEPZkJgdyNJ 0FnnPW35FcHr6E/06l4rNNssJhbOfpUzPBjge31d3jL0MJpmvZUgcsCUmHUMJFMUJaHf dr1a9BgVCS+Cb3XVtq31oY/xTsvOXRaFxuxw9ARNVWxD8pDCMLlusHYE6p77hd2+H9s0 jtt7R26p9ysEXl1SEm9I1VMNMDld9qWKlOrSThzyXl15DX18FaiXbiw1aq3VMqChV54v I1li0ZMlUL+jZiuE5s68t9b6U8vDqwWX7rSeNni9CrRsvoOFf8lKZPtA3dFJhtgIiHei ymyw== X-Gm-Message-State: AOAM532/Wu88omomXod2bj1vQKj3QdDdhnOHzW3afKDwp7CUjtER/J8G MuQZQenaSK/PcKcCpaYXxGYz6Q== X-Google-Smtp-Source: ABdhPJy+Z5esE3uurhkzizDtW3m1OKRWfuXho1I1H/+hKIEmfhbFpufLCET49LNS8PawnB+emtOgVA== X-Received: by 2002:a05:6870:e990:b0:de:9b72:c80 with SMTP id r16-20020a056870e99000b000de9b720c80mr7234558oao.118.1649369069975; Thu, 07 Apr 2022 15:04:29 -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 r8-20020a05683001c800b005cdadc2a837sm8359376ota.70.2022.04.07.15.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 15:04:29 -0700 (PDT) Date: Thu, 7 Apr 2022 15:04:17 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Mark Hemment cc: Hugh Dickins , Chuck Lever III , Andrew Morton , Patrice CHOTARD , Mikulas Patocka , Lukas Czerner , Christoph Hellwig , "Darrick J. Wong" , Linux-MM , Linux NFS Mailing List , linux-fsdevel@vger.kernel.org Subject: Re: Regression in xfstests on tmpfs-backed NFS exports In-Reply-To: Message-ID: <5256a357-213e-84e9-a07f-f695cbb68272@google.com> References: <673D708E-2DFA-4812-BB63-6A437E0C72EE@oracle.com> <11f319-c9a-4648-bfbb-dc5a83c774@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=XgwIWPe4; spf=pass (imf24.hostedemail.com: domain of hughd@google.com designates 209.85.160.43 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D67EC18000C X-Stat-Signature: tk5bhqosf17ddb4tt8qkgrmi79dfnghu X-HE-Tag: 1649369070-924335 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 7 Apr 2022, Mark Hemment wrote: > On Thu, 7 Apr 2022 at 01:19, Hugh Dickins wrote: > > > > What could be going wrong there? I've thought of two possibilities. > > A minor, hopefully easily fixed, issue would be if fs/nfsd has > > trouble with seeing the same page twice in a row: since tmpfs is > > now using the ZERO_PAGE(0) for all pages of a hole, and I think I > > caught sight of code which looks to see if the latest page is the > > same as the one before. It's easy to imagine that might go wrong. > > When I worked at Veritas, data corruption over NFS was hit when > sending the same page in succession. This was triggered via VxFS's > shared page cache, after a file had been dedup'ed. > I can't remember all the details (~15yrs ago), but the core issue was > skb_can_coalesce() returning a false-positive for the 'same page' case > (no check for crossing a page boundary). Very useful input: thank you Mark. That tells me that, even if we spot a "bug" in fs/nfsd, there could be various other places which get confused if given the ZERO_PAGE(0) twice in a row. I won't be able to find them all, I cannot go on risking that. At first I thought of using ZERO_PAGE(0) for even pgoffs, alternating with a tmpfs-specific zeroed page for odd pgoffs. But I was forgetting that copying ZERO_PAGE(0) is itself just a workaround to avoid the 28% slower iov_iter_zero(). I think I have a reasonable hybrid: will reply to Chuck now with that. Hugh I've rewr