Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2722628ybh; Mon, 9 Mar 2020 11:39:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtwqMSJF7TC+LjMNCDnd1Je7toBJZEKr1rYfBhWOKXOsqyPlgc/xyWFB+xf5xGuOw+XGIEp X-Received: by 2002:a9d:53cc:: with SMTP id i12mr9459705oth.11.1583779140908; Mon, 09 Mar 2020 11:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583779140; cv=none; d=google.com; s=arc-20160816; b=en66lBAytDEfBa3sR/PjRrBlpYSyzUpix/K+pDGNrWKvSy3hitREyikmwI5/WM7V7Z UQvHEIxll9frxHwyKAwKJEcPX7Rea8p/lCFO6zF55vKa36RuiEW+eCjhVvyu405nzf/5 UJDel2L88Bg6Rli46+EQWJDPb8vV1bgyVPW8o4pANvWwQSTdEil/XARQCjejstnBa0QS ibXZ+OtKkhoWFVBX8XciM9/ZtBjaeTOqlVuk5EBOgcT0/Zyvt85U0UKEpceGgzN8fFP+ fhe2QHq214cNuLPA/q8DxszJ4ixgHJZtBznwsaYKQHnyRnT96LvZRIaGLWSfuwq5W8B7 eX6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=KmL9v01Y7Y0oMfjm6X16Ug0l30XbHRppMW/KHHbJMNA=; b=cQ50yFg3hhPi00NSBhKpAuVYEcExNRGBgahdbHGA8PpUg/bszoinS0PTYSRDDIUTdl BjxGdBcbHaUsds9YWKbrgA7pMFVnrWB/94N04sxRux9I9CkFSUlIAs7a1zfS9kfiqKC9 ZQOBd+g/HBqJbYMLCQN0UvKVn1btYn5VQyVkzt2SyIeqEI+UqXJ06xW8nqpO3mgCl1Tg MVXZZVfYluKzHOP+itQHgZR4Hkb+3/AJCNKfF7HwoNY9amTMh9iiy87A34XJGfo2BuOE xUF7aMv3XGaEG2fQ1/7ISrcgY4DW1jaTZZeAxdMfRB52MEjOsHfB+vIHn1aJrOKA1PoW Egwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Cdjbkqx2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si3854398oix.239.2020.03.09.11.38.48; Mon, 09 Mar 2020 11:39:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Cdjbkqx2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727425AbgCIShV (ORCPT + 99 others); Mon, 9 Mar 2020 14:37:21 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56394 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727401AbgCIShV (ORCPT ); Mon, 9 Mar 2020 14:37:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=KmL9v01Y7Y0oMfjm6X16Ug0l30XbHRppMW/KHHbJMNA=; b=Cdjbkqx2vXTi3NkkdkaOC1YdIk BPAE2As3/CcJO/wmgya6KD8gYMvmqIYf8RlfVbPWhQ6gkulTDjhRac+kQXfPUQzHg6h07xNx18Cwk vYlOdFuy96VGd6S9Co90qEWVQRskeKhUnjt+fuMUNEkbT7cbCfh6QWz/hWzHAW1M8BnD3F4YhnDpB RHXdgRP1dYUgktpf0FbvcYrYIjYhtchjJoX93/AeoHH2Nr0d2ABpTsliJvd6xGWO+OIs93O51j31F oI5wp0fN1Eo0r+heCYT+E2Wek2pLFYbl++PS5NaPKP3PgdWJy6Z29fiybxpSxVAOtp/pDPCtCy2XK 6sR7w3gQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jBNGy-0004vS-Qe; Mon, 09 Mar 2020 18:37:04 +0000 Date: Mon, 9 Mar 2020 11:37:04 -0700 From: Matthew Wilcox To: Andi Kleen Cc: Michal Hocko , "Kirill A. Shutemov" , Cannon Matthews , Mike Kravetz , Andrew Morton , David Rientjes , Greg Thelen , Salman Qazi , linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] mm: clear 1G pages with streaming stores on x86 Message-ID: <20200309183704.GA1573@bombadil.infradead.org> References: <20200307010353.172991-1-cannonmatthews@google.com> <20200309000820.f37opzmppm67g6et@box> <20200309090630.GC8447@dhcp22.suse.cz> <20200309153831.GK1454533@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200309153831.GK1454533@tassilo.jf.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 09, 2020 at 08:38:31AM -0700, Andi Kleen wrote: > > Gigantic huge pages are a bit different. They are much less dynamic from > > the usage POV in my experience. Micro-optimizations for the first access > > tends to not matter at all as it is usually pre-allocation scenario. On > > the other hand, speeding up the initialization sounds like a good thing > > in general. It will be a single time benefit but if the additional code > > is not hard to maintain then I would be inclined to take it even with > > "artificial" numbers state above. There really shouldn't be other downsides > > except for the code maintenance, right? > > There's a cautious tale of the old crappy RAID5 XOR assembler functions which > were optimized a long time ago for the Pentium1, and stayed around, > even though the compiler could actually do a better job. > > String instructions are constantly improving in performance (Broadwell is > very old at this point) Most likely over time (and maybe even today > on newer CPUs) you would need much more sophisticated unrolled MOVNTI variants > (or maybe even AVX-*) to be competitive. Presumably you have access to current and maybe even some unreleased CPUs ... I mean, he's posted the patches, so you can test this hypothesis.