From patchwork Thu Apr 14 19:59:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12813969 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 37E08C433F5 for ; Thu, 14 Apr 2022 20:04:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F4736B0073; Thu, 14 Apr 2022 16:04:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77AFD6B0074; Thu, 14 Apr 2022 16:04:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61B676B0075; Thu, 14 Apr 2022 16:04:55 -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 44C796B0073 for ; Thu, 14 Apr 2022 16:04:55 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1950D2385B for ; Thu, 14 Apr 2022 20:04:55 +0000 (UTC) X-FDA: 79356562950.03.520B10C Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by imf17.hostedemail.com (Postfix) with ESMTP id 8993A40004 for ; Thu, 14 Apr 2022 20:04:54 +0000 (UTC) Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23EDhxpv011962 for ; Thu, 14 Apr 2022 13:04:53 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3femrganwf-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 14 Apr 2022 13:04:53 -0700 Received: from twshared39027.37.frc1.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 14 Apr 2022 13:04:46 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id 3378359738B0; Thu, 14 Apr 2022 12:59:21 -0700 (PDT) From: Song Liu To: , , CC: , , , , , , , , Song Liu Subject: [PATCH v3 bpf RESEND 2/4] page_alloc: use __vmalloc_huge for large system hash Date: Thu, 14 Apr 2022 12:59:12 -0700 Message-ID: <20220414195914.1648345-3-song@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220414195914.1648345-1-song@kernel.org> References: <20220414195914.1648345-1-song@kernel.org> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: bPOBl7APxhmwnqGnTRs8lbqmb5TW4Cws X-Proofpoint-ORIG-GUID: bPOBl7APxhmwnqGnTRs8lbqmb5TW4Cws 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-14_05,2022-04-14_02,2022-02-23_01 X-Stat-Signature: hekr6pggyke4thh4chq9j6o8ype4zi73 X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none); spf=none (imf17.hostedemail.com: domain of "prvs=51035a5414=songliubraving@fb.com" has no SPF policy when checking 67.231.153.30) smtp.mailfrom="prvs=51035a5414=songliubraving@fb.com" X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 8993A40004 X-HE-Tag: 1649966694-562617 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 Reviewed-by: Christoph Hellwig --- 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);