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 7BFB1C433EF for ; Sat, 9 Apr 2022 05:06:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D3E26B0071; Sat, 9 Apr 2022 01:06:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 084006B0073; Sat, 9 Apr 2022 01:06:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8D716B0074; Sat, 9 Apr 2022 01:06:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0180.hostedemail.com [216.40.44.180]) by kanga.kvack.org (Postfix) with ESMTP id DA7C96B0071 for ; Sat, 9 Apr 2022 01:06:43 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8F60CA7272 for ; Sat, 9 Apr 2022 05:06:43 +0000 (UTC) X-FDA: 79336155486.30.F4380CB Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf24.hostedemail.com (Postfix) with ESMTP id E149E180002 for ; Sat, 9 Apr 2022 05:06:42 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id AB9CC68AFE; Sat, 9 Apr 2022 07:06:38 +0200 (CEST) Date: Sat, 9 Apr 2022 07:06:38 +0200 From: Christoph Hellwig To: Hugh Dickins Cc: Andrew Morton , Chuck Lever III , Mark Hemment , Patrice CHOTARD , Mikulas Patocka , Lukas Czerner , Christoph Hellwig , "Darrick J. Wong" , linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, viro@zeniv.linux.org.uk Subject: Re: [PATCH] tmpfs: fix regressions from wider use of ZERO_PAGE Message-ID: <20220409050638.GB17755@lst.de> References: <9a978571-8648-e830-5735-1f4748ce2e30@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a978571-8648-e830-5735-1f4748ce2e30@google.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Stat-Signature: 1sowrybqe8gb5uiypxcnihiq6bh67531 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E149E180002 Authentication-Results: imf24.hostedemail.com; dkim=none; spf=none (imf24.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de; dmarc=none X-Rspam-User: X-HE-Tag: 1649480802-755872 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, Apr 08, 2022 at 01:38:41PM -0700, Hugh Dickins wrote: > + } else if (iter_is_iovec(to)) { > + /* > + * Copy to user tends to be so well optimized, but > + * clear_user() not so much, that it is noticeably > + * faster to copy the zero page instead of clearing. > + */ > + ret = copy_page_to_iter(ZERO_PAGE(0), offset, nr, to); Is the offset and length guaranteed to be less than PAGE_SIZE here? Either way I'd rather do this optimization in iov_iter_zero rather than hiding it in tmpfs.