Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp499228ybz; Wed, 15 Apr 2020 12:48:13 -0700 (PDT) X-Google-Smtp-Source: APiQypJ4k/2iFa5/AQ+nd297ZozZ+UUNYpus7sF+X5Oe9cfcvObhavFpPDHEjVtCatinFfNo/Xjf X-Received: by 2002:a17:906:d0d2:: with SMTP id bq18mr6418970ejb.62.1586980093367; Wed, 15 Apr 2020 12:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586980093; cv=none; d=google.com; s=arc-20160816; b=yY2zccJq1fV97GZSxbcVWWAw0s+n4WPsVLEodaY2c0hwJ6xH5n5Iv6OrrWoVL5pNhn 1ICDBmJD0qVT45lbmCJYMJwWjMNWM1e6DUNBXgAj0fy7UhZauDOO/UP5iLGzNibYr3mr +4bpMQLV8pot48n5XiVx+6j0GjOA44Z/qNvHwyp8SFBiRNXe+fvLz/O75aRtmTbBGGFM 9Wjsp4zrMbqilnc9O0Czw+50fs6ii0dP2f1SDGoCGE858A+djeHhg0ww118R78CbzNG0 oUt3HosEznORzhp+ObxJBEG0wH7IplWItGGlBjfv5/VBbluVam8426kASS2EhOCgU/mv yLOQ== 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=mdGWbEV2x2kdC5wG9BfGG6AGALuiWCVT7ddOuw0GXRY=; b=D7nVxX10dGPId1BgODCSI31A1/xc/+lJ3J7NlrmZ8jbDE3/lFRwUNvNl9FL9NZVABl ZZwXrOLtzdinaEcoWLm4AchZwFspPyWRGiBKNywdIA1JgsNMggvWyHDieEAiCGh1O5a2 YEVjIbjLKZsLffOTCrXeSRiaHji0igPCc26w867kDoYpB2y8uIb5aqPb1efdqHa4a4tN lkYgW1l+Nk0n9b1lAPgYGHv763SYNKIoCUHj9brCSQmXCZOF92lsIqP8T2xiJiMbgiqn rvZQv++DtWQBBxm2UkLZWIqjZ+IShwBnIKYFmiBKERBaKZjXRG7Nka+7layZ4q/sNeqR 0UkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qLkt2QBy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb28si10861247edb.11.2020.04.15.12.47.49; Wed, 15 Apr 2020 12:48:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qLkt2QBy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406557AbgDNHXY (ORCPT + 99 others); Tue, 14 Apr 2020 03:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406537AbgDNHXW (ORCPT ); Tue, 14 Apr 2020 03:23:22 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D362FC0A3BDC for ; Tue, 14 Apr 2020 00:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mdGWbEV2x2kdC5wG9BfGG6AGALuiWCVT7ddOuw0GXRY=; b=qLkt2QBytR7Fe51p8cO9Vf1/b+ xVWJ54SX12vGaW73vd8QVrGX2oOs6tuvshDuNsiOG092Sk/g+URdUovwJaGYErHwBF5T8E6Lp2fHN /WmGdzZtBqaHcPvJJ3Nw6nEmmi7aFjVVA4oUO/cNoZpTLFvrmZI5F8EIVK8CLRuESs4y3wtOIzyZK ziMikLkYeLjZRLKMAEpxQUXD4SGIuTB75jdLgURHQtMtOZ1LZvIcplWcWz42HO/zoPsVHPFbsHoX6 yK2I/42COQYUkVKZqfG3oNqU3bkmZABO/wik26fvtLOpzEv4j87Fc3ohFq5uw9DHocMoxwNPcQZVy bemhMBGA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOFue-0002Dm-Hj; Tue, 14 Apr 2020 07:23:16 +0000 Date: Tue, 14 Apr 2020 00:23:16 -0700 From: Christoph Hellwig To: Nicholas Piggin Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, Catalin Marinas , x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings Message-ID: <20200414072316.GA5503@infradead.org> References: <20200413125303.423864-1-npiggin@gmail.com> <20200413125303.423864-5-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200413125303.423864-5-npiggin@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: > For platforms that define HAVE_ARCH_HUGE_VMAP and support PMD vmap mappings, > have vmalloc attempt to allocate PMD-sized pages first, before falling back > to small pages. Allocations which use something other than PAGE_KERNEL > protections are not permitted to use huge pages yet, not all callers expect > this (e.g., module allocations vs strict module rwx). > > This gives a 6x reduction in dTLB misses for a `git diff` (of linux), from > 45600 to 6500 and a 2.2% reduction in cycles on a 2-node POWER9. > > This can result in more internal fragmentation and memory overhead for a > given allocation. It can also cause greater NUMA unbalance on hashdist > allocations. > > There may be other callers that expect small pages under vmalloc but use > PAGE_KERNEL, I'm not sure if it's feasible to catch them all. An > alternative would be a new function or flag which enables large mappings, > and use that in callers. Why do we even use vmalloc in this case rather than just doing a huge page allocation? What callers are you intersted in?