From patchwork Mon Apr 11 23:35:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12809815 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 293ABC433F5 for ; Mon, 11 Apr 2022 23:41:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B7DF06B0073; Mon, 11 Apr 2022 19:41:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B2C616B0074; Mon, 11 Apr 2022 19:41:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F8426B0075; Mon, 11 Apr 2022 19:41:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 8E6B06B0073 for ; Mon, 11 Apr 2022 19:41:17 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 628A823E95 for ; Mon, 11 Apr 2022 23:41:17 +0000 (UTC) X-FDA: 79346221794.18.3107E1F Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf23.hostedemail.com (Postfix) with ESMTP id B7C89140008 for ; Mon, 11 Apr 2022 23:41:16 +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 23BMJuFP017716 for ; Mon, 11 Apr 2022 16:41:15 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3fb7ujmusf-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 11 Apr 2022 16:41:15 -0700 Received: from twshared29473.14.frc2.facebook.com (2620:10d:c085:108::4) by mail.thefacebook.com (2620:10d:c085:21d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 11 Apr 2022 16:41:14 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id D4EBE54B3C3C; Mon, 11 Apr 2022 16:35:51 -0700 (PDT) From: Song Liu To: , , CC: , , , , , , , , Song Liu Subject: [PATCH v2 bpf 0/3] vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP Date: Mon, 11 Apr 2022 16:35:45 -0700 Message-ID: <20220411233549.740157-1-song@kernel.org> X-Mailer: git-send-email 2.30.2 X-FB-Internal: Safe X-Proofpoint-GUID: 6ac_8sZ3wuloiACBtjDmY2j7DzVaRsfw X-Proofpoint-ORIG-GUID: 6ac_8sZ3wuloiACBtjDmY2j7DzVaRsfw 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.425,FMLib:17.11.64.514 definitions=2022-04-11_09,2022-04-11_01,2022-02-23_01 Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none); spf=none (imf23.hostedemail.com: domain of "prvs=51006abe8f=songliubraving@fb.com" has no SPF policy when checking 67.231.145.42) smtp.mailfrom="prvs=51006abe8f=songliubraving@fb.com" X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B7C89140008 X-Stat-Signature: hr5i4qonj48znidyc9mgfob4hdpwi7nd X-HE-Tag: 1649720476-356660 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 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 (3): vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP module: introduce module_alloc_huge bpf: use vmalloc with VM_ALLOW_HUGE_VMAP 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 | 4 ++-- kernel/bpf/core.c | 9 +++++---- kernel/module.c | 8 ++++++++ mm/vmalloc.c | 39 +++++++++++++++++++----------------- 9 files changed, 66 insertions(+), 30 deletions(-) --- 2.30.2