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=DKIM_SIGNED,DKIM_VALID, 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 5FCDCC0044D for ; Thu, 12 Mar 2020 00:52:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 48DD4206F7 for ; Thu, 12 Mar 2020 00:52:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="mINpcoIK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48DD4206F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BCAA56B0005; Wed, 11 Mar 2020 20:52:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B77D76B0006; Wed, 11 Mar 2020 20:52:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A19216B0007; Wed, 11 Mar 2020 20:52:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 837486B0005 for ; Wed, 11 Mar 2020 20:52:16 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5911B181AEF09 for ; Thu, 12 Mar 2020 00:52:16 +0000 (UTC) X-FDA: 76584883872.20.error76_30e5a8c4fd02a X-HE-Tag: error76_30e5a8c4fd02a X-Filterd-Recvd-Size: 5440 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Mar 2020 00:52:15 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id d23so4393966ljg.13 for ; Wed, 11 Mar 2020 17:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jviTemCQoG4loq3hQd+5FHbbiKg1cB/oX7b11ImYwKo=; b=mINpcoIK+4b3v9Rg+UsfGUJC+BnxdOWNswx8E/bmeQniVPwlqFle9Cbz3R0TeE2Xoz ikkp7rQ3idJh0Hw/ti+V+fRFIDmUdspWLDJ/c5NQDa96XE/5jLE+3W9nkDnArdOttYA5 eEEIzoYQWlew0ZfkOwr2h885H0iA2BHHU9WChmvCMT9lE3sg1985gaZtTRNUiPRAPTN4 gHhoTk+skODCQloG59p5R19zNB1UpPHzSEv3AuL0uDN4ZM0OEJtTmG/E3Std7qmGdlvE go23z1Mn6gwPqC3QzKer9BLg0n3rbPljZKFLa/yv/HtUgvJtj72NKB9iaYPaR7mhHrlH JO/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jviTemCQoG4loq3hQd+5FHbbiKg1cB/oX7b11ImYwKo=; b=JsINFQQ9Iy+0sQbY8JZg4vfuv1ABDpHz1uFNH++F8RsK95RNt6fc0w+8btQbbP6l/T G+CQcIGGNZWCkbmKT9NMsEGUHXKCzhw1Q9Vi/9sIQO9JgqLpMkbt676c80VO8tdXBYDk Y77unh4lxSixcmTtqs3KCHDelxFp/owTm1MMAc8EKD6vSU6kwNwwcwxy/0G4UnyHCwoK BOMWKcY3L18jUAsEM321Q0TILeQpBVb4/WOSIb4TYu4V+hJQvxWmXpp0YwXfAc4KKRkY G5/NiC7QQCxh2C8Q4BhUYZF2guDkQgELWZCW95Lyxl68kvpsle9C94pL1PDWs0Jdmiut Kv5A== X-Gm-Message-State: ANhLgQ20KlDivj4VT5TC/2L/hr2V+02mj0A9fQ4PYL/h0qgT9AVj0Exu ux48FwbVSSWwGFdmtrd47WAuxA== X-Google-Smtp-Source: ADFU+vudFHHLZPTM3dDvkwAob92FTevQrfdVZCd8MEV9E5gGuhf82oH55hfavYodNV69o87Zu/DoOQ== X-Received: by 2002:a2e:b792:: with SMTP id n18mr3698691ljo.268.1583974334223; Wed, 11 Mar 2020 17:52:14 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id o17sm10043314lfd.89.2020.03.11.17.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 17:52:13 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 60559100B95; Thu, 12 Mar 2020 03:52:12 +0300 (+03) Date: Thu, 12 Mar 2020 03:52:12 +0300 From: "Kirill A. Shutemov" To: Arvind Sankar Cc: Cannon Matthews , Matthew Wilcox , Andi Kleen , Michal Hocko , 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: <20200312005212.kb5utehkw3jaxcfx@box> References: <20200309000820.f37opzmppm67g6et@box> <20200309090630.GC8447@dhcp22.suse.cz> <20200309153831.GK1454533@tassilo.jf.intel.com> <20200309183704.GA1573@bombadil.infradead.org> <20200311005447.jkpsaghrpk3c4rwu@box> <20200311033552.GA3657254@rani.riverdale.lan> <20200311081607.3ahlk4msosj4qjsj@box> <20200311183240.GA3880414@rani.riverdale.lan> <20200311203246.GA3971914@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311203246.GA3971914@rani.riverdale.lan> 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 Wed, Mar 11, 2020 at 04:32:47PM -0400, Arvind Sankar wrote: > On Wed, Mar 11, 2020 at 02:32:41PM -0400, Arvind Sankar wrote: > > On Wed, Mar 11, 2020 at 11:16:07AM +0300, Kirill A. Shutemov wrote: > > > On Tue, Mar 10, 2020 at 11:35:54PM -0400, Arvind Sankar wrote: > > > > > > > > The rationale for MOVNTI instruction is supposed to be that it avoids > > > > cache pollution. Aside from the bench that shows MOVNTI to be faster for > > > > the move itself, shouldn't it have an additional benefit in not trashing > > > > the CPU caches? > > > > > > > > As string instructions improve, why wouldn't the same improvements be > > > > applied to MOVNTI? > > > > > > String instructions inherently more flexible. Implementation can choose > > > caching strategy depending on the operation size (cx) and other factors. > > > Like if operation is large enough and cache is full of dirty cache lines > > > that expensive to free up, it can choose to bypass cache. MOVNTI is more > > > strict on semantics and more opaque to CPU. > > > > But with today's processors, wouldn't writing 1G via the string > > operations empty out almost the whole cache? Or are there already > > optimizations to prevent one thread from hogging the L3? > > Also, currently the stringop is only done 4k at a time, so it would > likely not trigger any future cache-bypassing optimizations in any case. What I tried to say is that we need to be careful with this kind of optimizations. We need to see a sizable improvement on something beyond microbenchmark, ideally across multiple CPU microarchitectures. -- Kirill A. Shutemov