Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp320994pxb; Tue, 12 Apr 2022 02:49:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzdEp4HT+SkqkVqiZWY4XEF05kvk8F5XHwK1dTbL5v8hEik6Lkww4YMHGN6Jfkr1298hzq X-Received: by 2002:a05:6402:5245:b0:419:5437:fc6b with SMTP id t5-20020a056402524500b004195437fc6bmr37512676edd.282.1649756990319; Tue, 12 Apr 2022 02:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649756990; cv=none; d=google.com; s=arc-20160816; b=kAejwAF17RncRuezZV1OfCu8dzFrxONr/Q9kEJ3RbLwS2vfOdGCH6+G8kd2QyjQMaO 5O00fGoouDixyWZJzzHtO3G9LEbH/S+/9EaWYxAtNDGDBvugDqKzlbD2Q2seRbvaIEBJ g9oovS6pa1tWbBviAYkE7WBI+W9gdXG8ie0PNHW4KiHj+texbrehyEUo20AaYn+OQhcn YvaFp8IpGPkyimdZLhOtGe/XLrc87v4zV+mVmWhrq2jFf9+g8rRxBQP2ApPCcBaO4ZNW KA5Dabbol09fB149jCoBo7vzwR6fY2tstXVOYxR5bWlgfUQmbSL3S0nrn5O1nJpxzhTB KEOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=eoWEQwITPQWLaaL3Nj8aCaPiUrS52jAOKOU/omSt/t8=; b=NnPBH+iesU0zv0zWLnxhyUinJJHXaUMlJbpYDdFyf30L66bwESUdbWUfqAGSGta/ip Q3owtk4ltJimfYTPMHsgwFM3OGK7jy3bEj7k3/SgqkwyrztohxRnzQunVh3RJ96TF40O 9CVWshvJRRdd13aDcI4rWe+t/1YtG7qWP8IbsqnvLDIE4EpBEjUnvM7WLy3m+Bf0zTM6 H3/h+ROiArGXMpSXWw5kpOZYV4y27u/FAPOU6nLV17VfK/EZeSTwVqTxNP2v9N+WEWGK 5O8XWa8We/U97m4g7UZEx/gyWubcNMl43OqDpLVRj6L2u2FVb29SRFIENE7/TQpbyehP 4lag== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a50d902000000b0041d146db4e2si8734584edj.488.2022.04.12.02.49.16; Tue, 12 Apr 2022 02:49:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347247AbiDLFAU (ORCPT + 99 others); Tue, 12 Apr 2022 01:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241228AbiDLFAT (ORCPT ); Tue, 12 Apr 2022 01:00:19 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C11AA33EAF; Mon, 11 Apr 2022 21:58:02 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 4103168AA6; Tue, 12 Apr 2022 06:57:58 +0200 (CEST) Date: Tue, 12 Apr 2022 06:57:57 +0200 From: Christoph Hellwig To: Hugh Dickins Cc: Christoph Hellwig , Andrew Morton , Chuck Lever III , Mark Hemment , Patrice CHOTARD , Mikulas Patocka , Lukas Czerner , "Darrick J. Wong" , "Jason A. Donenfeld" , Borislav Petkov , 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, x86@kernel.org Subject: making x86 clear_user not suck, was Re: [PATCH] tmpfs: fix regressions from wider use of ZERO_PAGE Message-ID: <20220412045757.GA5131@lst.de> References: <9a978571-8648-e830-5735-1f4748ce2e30@google.com> <20220409050638.GB17755@lst.de> 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Fri, Apr 08, 2022 at 11:08:29PM -0700, Hugh Dickins wrote: > > > > Either way I'd rather do this optimization in iov_iter_zero rather > > than hiding it in tmpfs. > > Let's see what others say. I think we would all prefer clear_user() to be > enhanced, and hack around it neither here in tmpfs nor in iov_iter_zero(). > But that careful work won't get done by magic, nor by me. I agree with that. > And iov_iter_zero() has to deal with a wider range of possibilities, > when pulling in cache lines of ZERO_PAGE(0) will be less advantageous, > than in tmpfs doing a large dd - the case I'm aiming not to regress here > (tmpfs has been copying ZERO_PAGE(0) like this for years). Maybe. OTOH I'd hate to have iov_iter_zero not used much because it sucks too much. So how can we entice someone with the right knowledge to implement a decent clear_user for x86?