Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1442916imm; Fri, 12 Oct 2018 19:11:36 -0700 (PDT) X-Google-Smtp-Source: ACcGV603B9TrOF1keYJ+xpRuuBhF1qyS8qLDdvuE1wQvIs5AUtcs2jdZrkNle208mtEyDmIT3sHY X-Received: by 2002:a63:b709:: with SMTP id t9-v6mr7417686pgf.366.1539396696872; Fri, 12 Oct 2018 19:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539396696; cv=none; d=google.com; s=arc-20160816; b=YyBQdC1GaMGZ99T8yZjA54mD/JH/VNfCK6NP76dDn3WQAb/UkOYjTIkQDeqqCvuRd/ PDc0G9vJvh+jUmi55zLuOFdv2H7LFAoKiDXPOMM+LlePT2IX9j4+4864ms+VPyGZidrL AbqmBDwib3WKmSdbz89EEWFN87P7omafBiDV9iSfrDgCJNdzS3qAwjterZDEUhZOBVde zUgfDPiMGZy9YamTSMpnCylM3P/T4ZX99zSv7tX4ogcFnH0sZ/B/SvZ7Q2h17fWdpNHX HXyNsHnj3JGyxNzghvCW34kV95/+II7ABu3+LCVk62obhDHzlZ5F06xKbfm1D/9V0tts tx2w== 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=6XZWKP2pbysVG8F4WKX4YkunFpUXVJoneS2qWT0rIgM=; b=GbDdwfIccJLjcDEcboVHFlsm3RUujUn8iLOHRQBKprjY9Ax90UoDsdRDM2CvufL7mE 8tw9gRc8ve+6ULjUrKj667snXopIebPPNA1KXJUShs8rQLgLDCAgr5mJZmqq7vkPC1G4 e9J0bYpoMyt710snv8xmSelHrg9hf+Oy3d3tDwyoI6WTix8ij6tqrs64PaFq/XQ6AuIY rtrIjtvkE8GyqqiAJru15UxxaWyfwm8ylc1mTS/l/eRonUcKQMyezYgBbXa5eMV3f7bF w6AVFlUL4kAtlqls5oIm32UiEpUhlTe8tQOhsJeDRZIy6KCMUzGUiUqchCrRlHSftTNk U68Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=N2gi5ZnN; 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 t7-v6si2945302plo.191.2018.10.12.19.11.20; Fri, 12 Oct 2018 19:11:36 -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=N2gi5ZnN; 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 S1727094AbeJMJqQ (ORCPT + 99 others); Sat, 13 Oct 2018 05:46:16 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36346 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbeJMJqP (ORCPT ); Sat, 13 Oct 2018 05:46:15 -0400 Received: by mail-pf1-f194.google.com with SMTP id l81-v6so7046083pfg.3 for ; Fri, 12 Oct 2018 19:11:00 -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=6XZWKP2pbysVG8F4WKX4YkunFpUXVJoneS2qWT0rIgM=; b=N2gi5ZnNq30pQxOnEBYq6zdh6G0ns+SI6AVZkhimNQGD9yQOm5UYR6JGFwS2BUFCIW FauhTl3Q+WSZVHehFg8SNEE/bWYFsI9CNtDr8BWvee6Gq8YU62TJwxNiZpLSShCoUVdR L56i07BfoCPIOURgBXyQvQokxNKgq+N+jyEKk= 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=6XZWKP2pbysVG8F4WKX4YkunFpUXVJoneS2qWT0rIgM=; b=riiJ2CDuVEUWNwtsneifJVdbGTUJ69x38xvkU/mozGimUX0tAzvar/WMi5XSTSgq8u rZfpQjHlriv0sXUCtW+HNaejWteMHiUDU1A6YpE+iF0wRBAnjt/4hu6UdVr0uy+1Niu2 6LIUWxeeIxRSXIQbL57mUXrcYMK0ZD8X6CcIrtpXCj8/1gddpuUbwBRnNzRzVT/q8Rkm SwvVAeWaVA7Ksvjalq/lonFvYSh8uOpd4riDw9sbY5rP1K1SNNIBGkDHX1fTtKKDvne+ h8odN8zlcz4Bga8qHAf+yxGJQL1OBGMPEb3YYcK189pZwAm49XMmmHfqDfwvT/QOI8xq 0xTQ== X-Gm-Message-State: ABuFfoiApGcEZv0ngUrGwRkvclorLto7TU6Z1ZYwGlVIEwYATohbuZT7 tILWE22vMUeFqLZvM+lTi5pzPA== X-Received: by 2002:a65:5147:: with SMTP id g7-v6mr7890713pgq.252.1539396659739; Fri, 12 Oct 2018 19:10:59 -0700 (PDT) Received: from localhost ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id b29-v6sm4669490pfj.183.2018.10.12.19.10.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Oct 2018 19:10:58 -0700 (PDT) Date: Fri, 12 Oct 2018 19:10:57 -0700 From: Joel Fernandes To: Daniel Colascione Cc: David Miller , kirill@shutemov.name, linux-kernel , kernel-team@android.com, Minchan Kim , Ramon Pantin , hughd@google.com, Lokesh Gidra , Michal Hocko , Andrew Morton , aryabinin@virtuozzo.com, luto@kernel.org, bp@alien8.de, catalin.marinas@arm.com, chris@zankel.net, 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@southpole.se, Julia.Lawall@lip6.fr, 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, jcmvbkbc@gmail.com, 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: <20181013021057.GA213522@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> 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 06:54:33PM -0700, Daniel Colascione wrote: > I wonder whether it makes sense to expose to userspace somehow whether > mremap is "fast" for a particular architecture. If a feature relies on > fast mremap, it might be better for some userland component to disable > that feature entirely rather than blindly use mremap and end up > performing very poorly. If we're disabling fast mremap when THP is > enabled, the userland component can't just rely on an architecture > switch and some kind of runtime feature detection becomes even more > important. I hate to point out that its forbidden to top post on LKML :-) https://kernelnewbies.org/mailinglistguidelines So don't that Mr. Dan! :D 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. 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. thanks! - Joel