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 54D8FC433EF for ; Sun, 6 Mar 2022 09:27:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 617C66B0071; Sun, 6 Mar 2022 04:27:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C7B16B0072; Sun, 6 Mar 2022 04:27:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B5666B0073; Sun, 6 Mar 2022 04:27:15 -0500 (EST) 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 368776B0071 for ; Sun, 6 Mar 2022 04:27:15 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id F186F237AB for ; Sun, 6 Mar 2022 09:27:14 +0000 (UTC) X-FDA: 79213432788.04.3E5A8B8 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf19.hostedemail.com (Postfix) with ESMTP id 4226D1A0002 for ; Sun, 6 Mar 2022 09:27:14 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 40D9867373; Sun, 6 Mar 2022 10:27:10 +0100 (CET) Date: Sun, 6 Mar 2022 10:27:09 +0100 From: Christoph Hellwig To: Hugh Dickins Cc: Andrew Morton , Mikulas Patocka , Zdenek Kabelac , Lukas Czerner , "Darrick J. Wong" , Miklos Szeredi , Christoph Hellwig , Borislav Petkov , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH mmotm] tmpfs: do not allocate pages on read Message-ID: <20220306092709.GA22883@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4226D1A0002 X-Stat-Signature: pnyxzq88quonjadrq6rrmeqodkq3xp3i Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=none; spf=none (imf19.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-HE-Tag: 1646558834-596165 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 Fri, Mar 04, 2022 at 09:09:01PM -0800, Hugh Dickins wrote: > It's not quite as simple as just removing the test (as Mikulas did): > xfstests generic/013 hung because splice from tmpfs failed on page not > up-to-date and page mapping unset. That can be fixed just by marking > the ZERO_PAGE as Uptodate, which of course it is; doing so here in > shmem_file_read_iter() is distasteful, but seems to be the best way. Shouldn't we set ZERO_PAGE uptodate during early init code as it, uh, is per definition uptodate all the time? > > My intention, though, was to stop using the ZERO_PAGE here altogether: > surely iov_iter_zero() is better for this case? Sadly not: it relies > on clear_user(), and the x86 clear_user() is slower than its copy_user(): > https://lore.kernel.org/lkml/2f5ca5e4-e250-a41c-11fb-a7f4ebc7e1c9@google.com/ Oh, that's sad as just using clear_user would be the right thing to here. > But while we are still using the ZERO_PAGE, let's stop dirtying its > struct page cacheline with unnecessary get_page() and put_page(). > > Reported-by: Mikulas Patocka > Reported-by: Lukas Czerner > Signed-off-by: Hugh Dickins But except for maybe making sure that ZERO_PAGE is always marked uptodate this does looks good to me.