Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2135988imm; Sat, 13 Oct 2018 10:51:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV60lBI9WG4MXRYA/7viAww2kzjFwq8BiXCs4Fq2hm/wp8ENLh7dHn/9eWcBaeoi4/Chc23om X-Received: by 2002:a62:8891:: with SMTP id l139-v6mr10966033pfd.198.1539453081660; Sat, 13 Oct 2018 10:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539453081; cv=none; d=google.com; s=arc-20160816; b=b8jvax7vNCCnHUhr4y3ehbZ9Axv5ANGoy5S2YiATN2pdy5RSEF4p2DuvX3Xalts2B6 q8sYR8imfH8UZ35npP3nJ289ZAE4sfGTHy1NdWUSxr9eHLXf7a1ME+c0CSDmIwzG9C3y V/bWo9MraNg5zANhMK8hJxHnxA57AFEIRtCcKwswFwMM1Qbc/GP+Iu1u33qSCYgsTTSm yMk6KyYEp2iN675HbYpkBBP22LY4BVal5KNpOaNU3tXzkInwj72MWwcxIj+iZUdDMdWU yckpMrH72IufWw3Qgx6eJ3sSIZLV3Lf3aM37kI/l2pbU0YEVw94xZB4HPfvXc1Zae/iz KHYQ== 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:from:date:dkim-signature; bh=GoWsMygASIRyu7PZgD3N2dBBnQZB9nQ/7GbuLV2HYnY=; b=uIpLU+pT0f/hcwGIwMWVSzW7tSE3wLWnns4NwOb5a0Rsae1/fN/peB5khqsvBBId9T TUz5hL+Uxqoe6Ll91Ye4bzcQQys6wXMzAyLdGH6haGUd5Uc2W0KoPOEbXBi3tpX2b4TZ 0nuypHKPkuayV9LjWlZrzYhiuCc8gsREfwlinsu+3bS1NrBqXDuGpNLm4dqZ1mipvGDX KVrYlY3AibqBaiNc+EVXyTgR/cjuiLIFBGQqhWwf+XSRnpMiy+3rUBEyOVSBMJOmaKCC SlDxDSvKKwRQRDROhDcqPiUxdCVsPWVJJT6viVColt/1ScJGfEzQ4knlp0HZklxDdXil O6Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="gtX/3bFK"; 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 k5-v6si4659037pgo.312.2018.10.13.10.51.06; Sat, 13 Oct 2018 10:51:21 -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=@joelfernandes.org header.s=google header.b="gtX/3bFK"; 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 S1726954AbeJNB2r (ORCPT + 99 others); Sat, 13 Oct 2018 21:28:47 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37787 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbeJNB2q (ORCPT ); Sat, 13 Oct 2018 21:28:46 -0400 Received: by mail-pf1-f195.google.com with SMTP id j23-v6so7710170pfi.4 for ; Sat, 13 Oct 2018 10:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GoWsMygASIRyu7PZgD3N2dBBnQZB9nQ/7GbuLV2HYnY=; b=gtX/3bFKdysbo0S38lPP9ATjDdsTysp7ptOg+SsEzBQmc5jRhOODzCYik6fd+BjPNr xu2Vp+XyGO4o3VTbAkLtyvZfSWRtUUHxernM8wIzLOXHfZUYx/YsB2m5iu16tCWuQG1m dx/4Vn6wKESA5zdAVp2ssOawvrRQIiujDiDAU= 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:user-agent; bh=GoWsMygASIRyu7PZgD3N2dBBnQZB9nQ/7GbuLV2HYnY=; b=NwiFDaQdyyHRCWlnQffjTAD2o1Za2u9iEbLolgZ6O93SVgt3SR9fIxWvwCZcOsJ78M gGYbOXCgO8cv9IAi0kwB1P6rLaCXr2bWFydlhPfWh5mU1ZhdURz9BxRw+d3fHkwnaaxH E/5YqnYiLRVv36sL6WTy2QTa6qp/4RJL2VKE7YULBQU4asPWLLwhFqO2/nK124o74TTR nZ35ySrTGMs1fpvwz/jYMeZ0TaIpN0CPINPdikOS4BXDb8JXLVFOmV/Xzkax9ffGDEep jpCXBDJ/mi+/y3wZlFlEaefB7EaX9lldTgW7cCItUW7Y5MNWR4lg5acrWASKtEspFp2Y tXPg== X-Gm-Message-State: ABuFfogT1aPuCHThBXaWD8ecImWYkoBqucOzhkk0pD24GSEnry5LL7v5 HGsA9uOHhShX2rfGNIYg/guBtw== X-Received: by 2002:a63:f64f:: with SMTP id u15-v6mr10134944pgj.258.1539453041895; Sat, 13 Oct 2018 10:50:41 -0700 (PDT) Received: from localhost ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id t26-v6sm7479626pfa.158.2018.10.13.10.50.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Oct 2018 10:50:40 -0700 (PDT) Date: Sat, 13 Oct 2018 10:50:39 -0700 From: Joel Fernandes To: dancol@google.com Cc: David Miller , kirill@shutemov.name, linux-kernel , kernel-team@android.com, Minchan Kim , Ramon Pantin , Hugh Dickins , Lokesh Gidra , Michal Hocko , Andrew Morton , aryabinin@virtuozzo.com, luto@kernel.org, bp@alien8.de, catalin.marinas@arm.com, Chris Zankel , dave.hansen@linux.intel.com, elfring@users.sourceforge.net, fenghua.yu@intel.com, geert@linux-m68k.org, gxt@pku.edu.cn, deller@gmx.de, mingo@redhat.com, jejb@parisc-linux.org, jdike@addtoit.com, Jonas Bonn , Julia Lawall , kasan-dev@googlegroups.com, kvmarm@lists.cs.columbia.edu, lftan@altera.com, linux-alpha@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@linux-mips.org, linux-mm , linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, Max Filippov , nios2-dev@lists.rocketboards.org, Peter Zijlstra , richard@nod.at Subject: Re: [PATCH v2 2/2] mm: speed up mremap by 500x on large regions Message-ID: <20181013175039.GB213522@joelaf.mtv.corp.google.com> References: <20181012013756.11285-2-joel@joelfernandes.org> <20181012113056.gxhcbrqyu7k7xnyv@kshutemo-mobl1> <20181012125046.GA170912@joelaf.mtv.corp.google.com> <20181012.111836.1569129998592378186.davem@davemloft.net> <20181013013540.GA207108@joelaf.mtv.corp.google.com> <20181013014429.GB207108@joelaf.mtv.corp.google.com> <20181013021057.GA213522@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Oct 12, 2018 at 07:25:08PM -0700, Daniel Colascione wrote: [...] > > But anyway, I think this runtime detection thing is not needed. THP is > > actually expected to be as fast as this anyway, so if that's available then > > we should already be as fast. > > Ah, I think the commit message is confusing. (Or else I'm misreading > the patch now.) It's not quite that we're disabling the feature when > THP is enabled anywhere, but rather that we use the move_huge_pmd path > for huge PMDs and use the new code only for non-huge PMDs. (Right?) If > that's the case, the commit message shouldn't say "Incase THP is > enabled, the optimization is skipped". Even if THP is enabled on a > system generally, we might use the new PMD-moving code for mapping > types that don't support THP-ization, right? That is true. Ok, I guess I can update the commit message to be more accurate about that. > > This is for non-THP where THP cannot be enabled > > and there is still room for some improvement. Most/all architectures will be > > just fine with this. This flag is more of a safety-net type of thing where in > > the future if there is this one or two weird architectures that don't play > > well, then they can turn it off at the architecture level by not selecting > > the flag. See my latest patches for the per-architecture compile-time > > controls. Ideally we'd like to blanket turn it on on all, but this is just > > playing it extra safe as Kirill and me were discussing on other threads. > > Sure. I'm just pointing out that the 500x performance different turns > the operation into a qualitatively different feature, so if we expect > to actually ship a mainstream architecture without support for this > thing, we should make it explicit. If we're not, we shouldn't. We can make it explicit by enabling it in such a mainstream architecture is my point. Also if the optimization is not doing what its supposed to, then userspace will also just know by measuring the time. thanks, - Joel