From patchwork Fri Apr 15 16:44:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12815206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA31AC433EF for ; Fri, 15 Apr 2022 16:53:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4244E6B0072; Fri, 15 Apr 2022 12:53:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D3C76B0073; Fri, 15 Apr 2022 12:53:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C2446B0074; Fri, 15 Apr 2022 12:53:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 1953C6B0072 for ; Fri, 15 Apr 2022 12:53:34 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C4A7923CCB for ; Fri, 15 Apr 2022 16:53:33 +0000 (UTC) X-FDA: 79359709506.04.7E5B09E Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf03.hostedemail.com (Postfix) with ESMTP id 3042020002 for ; Fri, 15 Apr 2022 16:53:32 +0000 (UTC) Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23ENtrXm019259 for ; Fri, 15 Apr 2022 09:53:32 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3fewgruu2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Apr 2022 09:53:31 -0700 Received: from twshared10896.25.frc3.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:11d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 15 Apr 2022 09:53:30 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id 36A735A45DCD; Fri, 15 Apr 2022 09:44:25 -0700 (PDT) From: Song Liu To: , , CC: , , , , , , , , Song Liu , Christoph Hellwig Subject: [PATCH v4 bpf 2/4] page_alloc: use vmalloc_huge for large system hash Date: Fri, 15 Apr 2022 09:44:11 -0700 Message-ID: <20220415164413.2727220-3-song@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220415164413.2727220-1-song@kernel.org> References: <20220415164413.2727220-1-song@kernel.org> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: JENs2Xn78_hIOOM306YIZ_OG-axCNo18 X-Proofpoint-ORIG-GUID: JENs2Xn78_hIOOM306YIZ_OG-axCNo18 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-15_06,2022-04-15_01,2022-02-23_01 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3042020002 X-Stat-Signature: cexaarwc5uset6tu1z4m7wpws8a1qexs Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none); spf=none (imf03.hostedemail.com: domain of "prvs=510404da6d=songliubraving@fb.com" has no SPF policy when checking 67.231.145.42) smtp.mailfrom="prvs=510404da6d=songliubraving@fb.com" X-Rspam-User: X-HE-Tag: 1650041612-575853 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: Use vmalloc_huge() in alloc_large_system_hash() so that large system hash (>= PMD_SIZE) could benefit from huge pages. Note that vmalloc_huge only allocates huge pages for systems with HAVE_ARCH_HUGE_VMALLOC. Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu Reviewed-by: Rik van Riel --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6e5b4488a0c5..edcba80ad5ec 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8919,7 +8919,7 @@ void *__init alloc_large_system_hash(const char *tablename, table = memblock_alloc_raw(size, SMP_CACHE_BYTES); } else if (get_order(size) >= MAX_ORDER || hashdist) { - table = __vmalloc(size, gfp_flags); + table = vmalloc_huge(size, gfp_flags); virt = true; if (table) huge = is_vm_area_hugepages(table);