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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A03E9C10F27 for ; Mon, 9 Mar 2020 15:38:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7094C20578 for ; Mon, 9 Mar 2020 15:38:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7094C20578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 13BD06B0005; Mon, 9 Mar 2020 11:38:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0EC396B0006; Mon, 9 Mar 2020 11:38:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 001A26B0007; Mon, 9 Mar 2020 11:38:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id DA4656B0005 for ; Mon, 9 Mar 2020 11:38:35 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 97E1F824805A for ; Mon, 9 Mar 2020 15:38:35 +0000 (UTC) X-FDA: 76576230990.29.wax91_2dde15fce7b35 X-HE-Tag: wax91_2dde15fce7b35 X-Filterd-Recvd-Size: 2967 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Mar 2020 15:38:34 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2020 08:38:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,533,1574150400"; d="scan'208";a="440958564" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by fmsmga005.fm.intel.com with ESMTP; 09 Mar 2020 08:38:31 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 764EA301BCC; Mon, 9 Mar 2020 08:38:31 -0700 (PDT) Date: Mon, 9 Mar 2020 08:38:31 -0700 From: Andi Kleen To: Michal Hocko Cc: "Kirill A. Shutemov" , Cannon Matthews , Mike Kravetz , Andrew Morton , Matthew Wilcox , 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: <20200309153831.GK1454533@tassilo.jf.intel.com> References: <20200307010353.172991-1-cannonmatthews@google.com> <20200309000820.f37opzmppm67g6et@box> <20200309090630.GC8447@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200309090630.GC8447@dhcp22.suse.cz> 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: > 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. The best clear functions may also be different for different CPU generations. Using the string instructions has the advantage that all of this is abstracted from the kernel. -Andi