Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp824158ybh; Wed, 11 Mar 2020 11:33:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvKIj+KG5AlykocYfYwpd2ii4QSR+tglJoWrX4VZXCmxxZJ0bndl5SYeKxX/wJ4hbvWxB/5 X-Received: by 2002:a05:6830:1e0d:: with SMTP id s13mr3291878otr.234.1583951625971; Wed, 11 Mar 2020 11:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583951625; cv=none; d=google.com; s=arc-20160816; b=BXhqRPJgNZqQvVjgunR7Pt0hNDpvn5EdpdlDHJNrOCtO83ipL5Hq4h3GQBpqYrJP8p TxvdXSDYKJ75VbQrB8TnVf+I1M2JpX/ALvPF6kp6BsrtZH44dR1ySinMibnZZFI83OwW 9so/cfdAH3mfo/ddqQFqF+9sTBDMJyAWXYVcQQ3ezn3AeOHdrcPA9KyKwAuBahCxJs80 eOgH89r18okmzLOjIybhS2hZmG2oSIIE3HvcG3v/HvBetFjdQA3NFFF1bXKpGraCxCEI njcLk6xMC/h0HiIJR6jw7+YgpUc81wpjpHTYAtW/S7Kq3lgVf3OKxwbjHZTgKEEJZxFm 0arg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=PMlJ0CCM2ETRao/Z/x1Z86bkEWgQuSAvpITBlu5A7Ik=; b=rVzFlmGlzsEtbe7Bhz0Lt9AW5jJyTWfhRW/AbmDyBhzx7QSPmfsrzR2zN3lHQwZBQJ SvfD6rc/Pv61X0eUppapyMnEsAm35UDWIii3h84UYi0qL/wtm4mJjdTQEFi4/uBOUJUI L+qZTk/OgEfpNuiWfKgJoG5a5gq67SHDFbh8qhg6O2tacnMBMFUmsjJcTWDmYf4iHt9q tHwxMLL6C72yCBEh9xUN4HHGGAzNDUGQ1lrd78IXSpXlGlmoJf/V89YBRfqCrHuqyS0X rS2Yq17J0IkUy8v6a6ez7KijMsk/jCHJ+d3mns6loaSlDVoahf4O1tJTX1HI6NmrI8ca jJcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GsHVNura; 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 l4si1493477otj.173.2020.03.11.11.33.34; Wed, 11 Mar 2020 11:33:45 -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=@gmail.com header.s=20161025 header.b=GsHVNura; 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 S1730846AbgCKScr (ORCPT + 99 others); Wed, 11 Mar 2020 14:32:47 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:40658 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730784AbgCKScq (ORCPT ); Wed, 11 Mar 2020 14:32:46 -0400 Received: by mail-qk1-f193.google.com with SMTP id m2so3084683qka.7 for ; Wed, 11 Mar 2020 11:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PMlJ0CCM2ETRao/Z/x1Z86bkEWgQuSAvpITBlu5A7Ik=; b=GsHVNura2eRqqet/zqMCRx+4UATBBNXBlkdjyf760G2mIglKf0RCQsU2N9XDzUtMID QOG6zFpKUeZhp6O3MYB9yzjPslgY4XcfmdM/hdPwv5gb8UV/IKebOp+1qOGbfdzUbBPw 9AR0C06BREbED/nGqz1/MikJY3hy6t/5at9PShhTx37TJf2aW491moWc/W0MZQUfSBsP vNpuR9okDgiyWAt8bpKK33D5Quc3CW1GlLXA3ov7/4oSEqyoKeP1Uu3Juf1/XHfbg0rM m2oeoGJS8K5ESND7Tz3zgE4yqVsVO5wLgraKFSg6iQlDt8VR/ZtS0TVptvtPiHFfYWf4 C+FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=PMlJ0CCM2ETRao/Z/x1Z86bkEWgQuSAvpITBlu5A7Ik=; b=eDt23OVp7mGDos2SjrYjiGeFHZ/3BGaLANjLQ4Uf6ESrLWVcL5ez87uzALh2cOcfiP yZvbqw0RP+3fXlhCgk+TCS+VxKtnZGVYhFJuCg9dfaQBzOG8jBua/9iX+neVvoeiAa2n IZuit8tDj03LnQkk84sGJUvao0xoTABZSGXvKFZFBDigIrHxcVMFJNTBXzKRu/5P9Eb+ IwnecAUKtWN+H8VDNPxrZGyb9M/yRUFi77dCyEX5KCx5vnABcrgX5h+LlUAbVLX08AZt N1IC+TIrPpPqqQlHnGQMiIaPDD6CRZw4yv54v15LhUX6LEbkAgtfwKeR+iU9jC0bxUhr kn+w== X-Gm-Message-State: ANhLgQ36TmpBLNoNzW2W5Pf/Es4uY6pRJb2w60pqkYxNsA58qy2F+HBM eM320MeHRY8YU3R4+R+M9oQ= X-Received: by 2002:a05:620a:1236:: with SMTP id v22mr4091581qkj.101.1583951563826; Wed, 11 Mar 2020 11:32:43 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id p191sm9264884qke.6.2020.03.11.11.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 11:32:43 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Wed, 11 Mar 2020 14:32:41 -0400 To: "Kirill A. Shutemov" Cc: Arvind Sankar , 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: <20200311183240.GA3880414@rani.riverdale.lan> References: <20200307010353.172991-1-cannonmatthews@google.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200311081607.3ahlk4msosj4qjsj@box> User-Agent: Mutt/1.10.1 (2018-07-13) 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 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? If we do want to just use the string operations, it seems like the clear_page routines should just call memset instead of duplicating it. > > And more importantly string instructions, unlike MOVNTI, is something that > generated often by compiler and used in standard libraries a lot. It is > and will be focus of optimization of CPU architects. > > -- > Kirill A. Shutemov