From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEDC2C433E3 for ; Fri, 21 Aug 2020 15:38:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 93E36207DF for ; Fri, 21 Aug 2020 15:38:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mqf3QLSj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93E36207DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1D3798D0014; Fri, 21 Aug 2020 11:38:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 183668D0013; Fri, 21 Aug 2020 11:38:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0990C8D0014; Fri, 21 Aug 2020 11:38:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id E71018D0013 for ; Fri, 21 Aug 2020 11:38:35 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 98EBB824556B for ; Fri, 21 Aug 2020 15:38:35 +0000 (UTC) X-FDA: 77174982990.26.peace47_32084402703a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 613DE1804B667 for ; Fri, 21 Aug 2020 15:38:35 +0000 (UTC) X-HE-Tag: peace47_32084402703a X-Filterd-Recvd-Size: 4835 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Aug 2020 15:38:34 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id b11so1032855pld.7 for ; Fri, 21 Aug 2020 08:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kco/6vI1blM/NwfzBHIDs3oyI1qAQDpBfmbjozxRSNk=; b=Mqf3QLSjkioKMk0zBDuIglw6zdeZUKHZ1HQUwduW7GDONUqZycokbVPPLpKEOpQl4b PDAb2rY3stSYZvKhK1ciDdXI9QFuSd5868ZADYj2vkdJQuduZNKyrfw/bl/VOhAJoTHE 5SQ3KeiX1D57s96SJHQo5n9Kx3TDPfJxYN6T73LU2hqZcH37Y2pQK8ncVnOIHTCw+dH9 JH5LBDlhrptca3/0S5Ff7Fwp+Av93sdvs2f7yyKFqjraHST6wJ+2aZBaDb4HvmRbJ8cZ Ev10EsauM4bU6+fZB47gY9myTYHuYjfP5cXd8jqrKQ0astUglqR98D7equtA387ONVto 1OLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kco/6vI1blM/NwfzBHIDs3oyI1qAQDpBfmbjozxRSNk=; b=Gnt3f9CrVx/wvVSUG67X1ubib6rw5wVgW3Yr3BFjZDEkXt1gMh1Y6hV1neQaYKMHXf bj9s6NqMWaHCVqd7UWZjO/zQFTcx1LZaJki3JJzZVE8rX6nzuRaraEFrZcsQrD7qGD4B m+DMOa0+p5SnTYGyix6Mae1rw7QfypdohZEK+jNJ0n4jTKmYuE1CiHdeieNAKi0M0Pbu N24MF1cmzO92bm07q18IteWcFvnRgsB2k4GcakdZNJtYwJM9u8DPaqSC2l5PKSyWG40q NaPPX+vrftkl3Tt5AAXrd/GSzySpxkfDyrpR50s1pmfROb8Bhbr2PT4z+KAjUBHAunbl FQnw== X-Gm-Message-State: AOAM531ZyMf6/CgbDApmjtH+ZiCwxCMRN5J0K5OTlsWxE2Cbmkfcu2VD 4mFS/BNfRaRF3QIwzqYPVFY= X-Google-Smtp-Source: ABdhPJwru3LiGVN0/RGun5gHVd79iZu23NuOL+aXtjWUQONE0O/idm7t/GaI88fUhyFkLtAmK/d3Rw== X-Received: by 2002:a17:90a:ba05:: with SMTP id s5mr1612246pjr.114.1598024313966; Fri, 21 Aug 2020 08:38:33 -0700 (PDT) Received: from [10.1.10.11] (c-73-241-150-58.hsd1.ca.comcast.net. [73.241.150.58]) by smtp.gmail.com with ESMTPSA id q207sm2581667pgq.71.2020.08.21.08.38.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Aug 2020 08:38:33 -0700 (PDT) Subject: Re: [PATCH v6 11/12] mm/vmalloc: Hugepage vmalloc mappings To: Nicholas Piggin , linux-mm@kvack.org, Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Zefan Li , Jonathan Cameron , Christoph Hellwig , Christophe Leroy References: <20200821151216.1005117-1-npiggin@gmail.com> <20200821151216.1005117-12-npiggin@gmail.com> From: Eric Dumazet Message-ID: <1e001c2c-6c47-21a9-e920-caf78933b713@gmail.com> Date: Fri, 21 Aug 2020 08:38:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200821151216.1005117-12-npiggin@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 613DE1804B667 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 8/21/20 8:12 AM, Nicholas Piggin wrote: > Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALLOC > enables support on architectures that define HAVE_ARCH_HUGE_VMAP and > supports PMD sized vmap mappings. > > vmalloc will attempt to allocate PMD-sized pages if allocating PMD size or > larger, and fall back to small pages if that was unsuccessful. > > Allocations that do not use PAGE_KERNEL prot are not permitted to use huge > pages, because not all callers expect this (e.g., module allocations vs > strict module rwx). > > This reduces TLB misses by nearly 30x on a `git diff` workload on a 2-node > POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%. > > This can result in more internal fragmentation and memory overhead for a > given allocation, an option nohugevmalloc is added to disable at boot. > > Thanks for working on this stuff, I tried something similar in the past, but could not really do more than a hack. ( https://lkml.org/lkml/2016/12/21/285 ) Note that __init alloc_large_system_hash() is used at boot time, when NUMA policy is spreading allocations over all NUMA nodes. This means that on a dual node system, a hash table should be 50/50 spread. With your patch, if a hashtable is exactly the size of one huge page, the location of this hashtable will be not balanced, this might have some unwanted impact. Thanks !