From patchwork Wed Apr 13 15:33:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12812202 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 56148C433EF for ; Wed, 13 Apr 2022 16:05:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA6FF6B0073; Wed, 13 Apr 2022 12:05:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D56A26B0074; Wed, 13 Apr 2022 12:05:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C46156B0075; Wed, 13 Apr 2022 12:05:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0248.hostedemail.com [216.40.44.248]) by kanga.kvack.org (Postfix) with ESMTP id B87FB6B0073 for ; Wed, 13 Apr 2022 12:05:43 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 710758249980 for ; Wed, 13 Apr 2022 16:05:43 +0000 (UTC) X-FDA: 79352331366.30.FBF16DF Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf12.hostedemail.com (Postfix) with ESMTP id D5D4E4000D for ; Wed, 13 Apr 2022 16:05:42 +0000 (UTC) Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23DEO090016444 for ; Wed, 13 Apr 2022 09:05:41 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3fe08arqyj-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 13 Apr 2022 09:05:41 -0700 Received: from twshared5730.23.frc3.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:21d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 13 Apr 2022 09:05:40 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id 859CE57504FB; Wed, 13 Apr 2022 08:33:46 -0700 (PDT) From: Song Liu To: , , , CC: , , , , , , , , , Song Liu Subject: [PATCH v3 bpf 2/4] page_alloc: use __vmalloc_huge for large system hash Date: Wed, 13 Apr 2022 08:33:38 -0700 Message-ID: <20220413153340.326834-3-song@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220413153340.326834-1-song@kernel.org> References: <20220413153340.326834-1-song@kernel.org> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: o6qDiJs1TObncYnfs43o4q6W6gYlQ3qp X-Proofpoint-ORIG-GUID: o6qDiJs1TObncYnfs43o4q6W6gYlQ3qp 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-13_02,2022-04-13_01,2022-02-23_01 X-Stat-Signature: suycm1dkgtdfba8n35hr571sg9xaf57y X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D5D4E4000D Authentication-Results: imf12.hostedemail.com; dkim=none; spf=none (imf12.hostedemail.com: domain of "prvs=51024983e5=songliubraving@fb.com" has no SPF policy when checking 67.231.145.42) smtp.mailfrom="prvs=51024983e5=songliubraving@fb.com"; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none) X-Rspam-User: X-HE-Tag: 1649865942-788061 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. Signed-off-by: Song Liu --- 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..20d38b8482c4 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);