From patchwork Wed Apr 13 15:33:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12812188 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 C3987C43217 for ; Wed, 13 Apr 2022 15:49:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0031B6B0073; Wed, 13 Apr 2022 11:49:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EC9286B0074; Wed, 13 Apr 2022 11:49:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D42DE6B0075; Wed, 13 Apr 2022 11:49:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id C71396B0073 for ; Wed, 13 Apr 2022 11:49:44 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 9818E60B29 for ; Wed, 13 Apr 2022 15:49:44 +0000 (UTC) X-FDA: 79352291088.10.0EDD941 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by imf18.hostedemail.com (Postfix) with ESMTP id 18D251C0004 for ; Wed, 13 Apr 2022 15:49:43 +0000 (UTC) Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.1.2/8.16.1.2) with ESMTP id 23D3Yn5o017328 for ; Wed, 13 Apr 2022 08:49:43 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by m0089730.ppops.net (PPS) with ESMTPS id 3fdpr43jj5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 13 Apr 2022 08:49:43 -0700 Received: from twshared5730.23.frc3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::6) 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 08:49:42 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id D6ABA57504F3; Wed, 13 Apr 2022 08:33:42 -0700 (PDT) From: Song Liu To: , , , CC: , , , , , , , , , Song Liu Subject: [PATCH v3 bpf 0/4] vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP Date: Wed, 13 Apr 2022 08:33:36 -0700 Message-ID: <20220413153340.326834-1-song@kernel.org> X-Mailer: git-send-email 2.30.2 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: zWvCJ2Jw1hNLcO-CMqBRi_eGajmhCrET X-Proofpoint-GUID: zWvCJ2Jw1hNLcO-CMqBRi_eGajmhCrET X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 18D251C0004 X-Stat-Signature: wo8ui8yh1cbigozgs8i9nw46hqbdp81f Authentication-Results: imf18.hostedemail.com; dkim=none; spf=none (imf18.hostedemail.com: domain of "prvs=51024983e5=songliubraving@fb.com" has no SPF policy when checking 67.231.153.30) 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: 1649864983-204613 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: Changes v2 => v3: 1. Use __vmalloc_huge in alloc_large_system_hash. 2. Use EXPORT_SYMBOL_GPL for new functions. (Christoph Hellwig) 3. Add more description about the issues and changes.(Christoph Hellwig, Rick Edgecombe). Changes v1 => v2: 1. Add vmalloc_huge(). (Christoph Hellwig) 2. Add module_alloc_huge(). (Christoph Hellwig) 3. Add Fixes tag and Link tag. (Thorsten Leemhuis) Enabling HAVE_ARCH_HUGE_VMALLOC on x86_64 and use it for bpf_prog_pack has caused some issues [1], as many users of vmalloc are not yet ready to handle huge pages. To enable a more smooth transition to use huge page backed vmalloc memory, this set replaces VM_NO_HUGE_VMAP flag with an new opt-in flag, VM_ALLOW_HUGE_VMAP. More discussions about this topic can be found at [2]. Patch 1 removes VM_NO_HUGE_VMAP and adds VM_ALLOW_HUGE_VMAP. Patch 2 uses VM_ALLOW_HUGE_VMAP in bpf_prog_pack. [1] https://lore.kernel.org/lkml/20220204185742.271030-1-song@kernel.org/ [2] https://lore.kernel.org/linux-mm/20220330225642.1163897-1-song@kernel.org/ Song Liu (4): vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP page_alloc: use __vmalloc_huge for large system hash module: introduce module_alloc_huge bpf: use module_alloc_huge for bpf_prog_pack arch/Kconfig | 6 ++---- arch/powerpc/kernel/module.c | 2 +- arch/s390/kvm/pv.c | 2 +- arch/x86/kernel/module.c | 21 +++++++++++++++++++++ include/linux/moduleloader.h | 5 +++++ include/linux/vmalloc.h | 5 +++-- kernel/bpf/core.c | 7 ++++--- kernel/module.c | 5 +++++ mm/page_alloc.c | 2 +- mm/vmalloc.c | 34 ++++++++++++++++++++++++++++------ 10 files changed, 71 insertions(+), 18 deletions(-) --- 2.30.2