Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1253608pxb; Thu, 14 Apr 2022 01:45:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxx2pPIc+NVtC/YUZJCmut4TEFB8IeMd7maMGmUSuK6neQRLn9yPMs56y8kWKvu62b4LGMQ X-Received: by 2002:a17:90b:3a82:b0:1cb:9ba8:56a5 with SMTP id om2-20020a17090b3a8200b001cb9ba856a5mr2610912pjb.16.1649925940434; Thu, 14 Apr 2022 01:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649925940; cv=none; d=google.com; s=arc-20160816; b=VgD051n/q0AxgNSDcaltkpIdv+eeKsgBwp52rUZP22aMs+LG5ULscLhtvtiR6iWfiL wCFbAj/w5Yz7sWhV3zjipKOpu/afTDlevZU7FtZyX3eudeyn/I0g1cvv3YRGvl/Wjvrg 7SaHW0nBv0qQTaH//snJ9pWTgZ53s58PajSlie+Ok5+NZwbvGAbdY6SlEylUV3DKtQp5 Em1ogx1adUJOKtEp+TMfCs1qsVBu1xyA6W+ouB1B1SERMhoeCN/hPpqO98PNkeaPHfNH v4vmvoKTsPAuUYpnDLVzwGYK+zdk3FVNuCngx/HI2+UExPui20tikOGLbOtZeKd1NLnl oQdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RYArLPbSRQE8E13k3ycxmMoQnNRcq1Ic+NpsE4J+dOQ=; b=OPo4gC4SglLit4WKWnCrq7VZ/kwolM0rOq36HbrccGKMoyJ3d4Zwt/e8MuhTAn0wPR yNLbdm4cJvnirYPrUZANGlrQsIqpF7RWRQOYwyb2A5FggoXVFMHqGkFfreyIdoSJMCx0 7MHuE5eYYnfAG+VEmMuW0exYHuZs6KVK8HHv2ifyRMUPqk9FfC4NkEmlmtkpTCpWNQcn GNLPI4PF2GyymgmOM3m6b5IfqQdOwiFN0QcPdw6DmsLKxzJij0BnasAQ+vDYxC+wVAzg Y9IxxHGmApDK+QvTgRg5GG5haDC/CADVZjuJxY9q7gjDTn+1y/Sby54gJLsm+hxMv2yM Si3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vMzaRyZm; 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 n2-20020a63b442000000b0039da5aa4ed6si5991826pgu.710.2022.04.14.01.45.13; Thu, 14 Apr 2022 01:45:40 -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=@infradead.org header.s=casper.20170209 header.b=vMzaRyZm; 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 S235971AbiDMSJJ (ORCPT + 99 others); Wed, 13 Apr 2022 14:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233881AbiDMSJC (ORCPT ); Wed, 13 Apr 2022 14:09:02 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D7AD4C7A5; Wed, 13 Apr 2022 11:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RYArLPbSRQE8E13k3ycxmMoQnNRcq1Ic+NpsE4J+dOQ=; b=vMzaRyZmQeJIGHwv1m13Wm5unS s3ZTYmn9U4xKPzk44Q0g/u0dGqXES86OwZ1Ug1FlZ4Gg8SY/4PB8pK+ojDwrwQ+qfVTfcIdStZpCq dn32OxPcKjM/VvEY22ob50yqVN/B7Yow4fnHkU2iVyAgpCu1Fgh71ZP0IztEIy8ibfnA+6BL+YaKB 8+UCXRFsHA1WTfOQRgoML1NAxOSqHgyOW8XqCLYRn+FtSosvkYfDg7Ji22uJvZt/yAJqLxEHNriiS YM1wYeGLasScQ4LaGKJ8/lstaGm1Jk1WfaXWuKJWpoPWU4bZl0nmuks4rHwfP57ywTk+ZF+jmaeJy 78VBzJCg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nehNW-00ESOu-K7; Wed, 13 Apr 2022 18:06:06 +0000 Date: Wed, 13 Apr 2022 19:06:06 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: Hugh Dickins , 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: Re: making x86 clear_user not suck, was Re: [PATCH] tmpfs: fix regressions from wider use of ZERO_PAGE Message-ID: References: <9a978571-8648-e830-5735-1f4748ce2e30@google.com> <20220409050638.GB17755@lst.de> <20220412045757.GA5131@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220412045757.GA5131@lst.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Tue, Apr 12, 2022 at 06:57:57AM +0200, Christoph Hellwig wrote: > 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? Apparently that already happened, but it needs finishing up: https://lore.kernel.org/lkml/Yk9yBcj78mpXOOLL@zx2c4.com/