Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1112030ybh; Wed, 11 Mar 2020 17:53:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu2Hn2FbhwQKYuK+Ytadkhv8xDzS5jiHfcKM3m8vQoPXkSA2cQ8zSfKpvIvMGZSzV/Xb4fw X-Received: by 2002:a05:6820:173:: with SMTP id k19mr2199139ood.5.1583974381337; Wed, 11 Mar 2020 17:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583974381; cv=none; d=google.com; s=arc-20160816; b=uCc4Plgwugz6+SZ4SGMXcC31iQ5AiTxabYOKwGEUJw7sORuJYc0PmDn80UCZicfMi5 E/oGw3pbdaCRCG+IJ1RTP9KSHI7BESG+B/On8Mq1BU9uUsDVe6fOpY6xmsKXvgZuBnM6 AAlTefIPAGiFJqwIb4rUBDmZWw1h8SbJhjYYusUHr44QhHjvfOmwOANfrs7nAelqBMOV NUlQBAbxEzjqyE26aGTUeIYZsJUigvWT+42NZ+9UBdx+xhFePn1xjknJ+zKwSJ28rHnS YxvfZhJZpeeIpsfgb35QCIt+RX09vrc6xAD/6UQnfsvtXkgWDmikAL/Bo1kaPYO8DkEF GFuQ== 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=jviTemCQoG4loq3hQd+5FHbbiKg1cB/oX7b11ImYwKo=; b=xbzVjWD0ZqBGhWVW0zOaE1avDnUxy+MHHHGKMjvOEjsiOUi/3fK0TPTbP5LdvFEzCu 5ojfVdi+Q8WlDsYb+xV5ZGKIFk/nEfgNVQ74Wr/BC1/KedU2HpkIrmiGZylYpWnyYJUL cKJH4gang+AtRXgAKtGYCgQHcmQtjpMxt/UmCfoZUxIm2455jp43c352V4Sx3MwvfEfN /igShcIIxkgO62ct208IVxhxszw5mkV0sFwwQlzGmXp79q+hDFK+xp4lKmcZck+cOmqK al+fiKdmuODYeoUEPOhs/pCw821wBDIA1wX/yChzlXhExhJ38mShCgBmVhebDbhSsp/E qAhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=mINpcoIK; 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 s11si1738604oic.57.2020.03.11.17.52.46; Wed, 11 Mar 2020 17:53:01 -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=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=mINpcoIK; 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 S2387516AbgCLAwQ (ORCPT + 99 others); Wed, 11 Mar 2020 20:52:16 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:40438 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387404AbgCLAwQ (ORCPT ); Wed, 11 Mar 2020 20:52:16 -0400 Received: by mail-lj1-f196.google.com with SMTP id 19so4422507ljj.7 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=IttX/5NheLyxrvnaeeHUVUeTjPi0WICsse8bahmgON6o0dmGtcFEYRk7THPAYgT6xj /QIAkQSHDp2RaTwqLFijS9Hr4bzUm/C0L7s9dbR3FEY+ja3NkyGMyqYn4Yl3VZaHj5zb rc5XhFpzsy8qqUrRTXWhBBAXWMBij9GiDtWtK6hNjNmAZdbai89vfmUGM7Z+gnPUff2p /89LQyTeMrE1mihHpBAvwkIi4mKLvcesnmZO8gQ9lLYZk+fTQjerYmCF9IfowYSbSIyt XiTUTvPVsPiHLBGUFkwtYW4jD715Oa+I+f+V/yHmzDjZzpvD96UNNxLk1Jzv80YDeRz+ BB5w== X-Gm-Message-State: ANhLgQ3APN5LRkY794lw8ns9grxwGkJfGYR/sa4nIkYFIM7RidbucNJz gOqQhvJjvLNSCmdMN1QyLXC6ZQ== 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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