From patchwork Mon Apr 11 23:18:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12809770 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 D0FBDC433EF for ; Mon, 11 Apr 2022 23:35:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A24B26B0074; Mon, 11 Apr 2022 19:35:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AC8A6B0075; Mon, 11 Apr 2022 19:35:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FF2B6B0078; Mon, 11 Apr 2022 19:35:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 6BCB36B0074 for ; Mon, 11 Apr 2022 19:35:20 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2DD74A5BDE for ; Mon, 11 Apr 2022 23:35:20 +0000 (UTC) X-FDA: 79346206800.22.53EAE1A Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf31.hostedemail.com (Postfix) with ESMTP id 925E020002 for ; Mon, 11 Apr 2022 23:35:19 +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 23BMJkL4021381 for ; Mon, 11 Apr 2022 16:35:18 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3fb5fr599a-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 11 Apr 2022 16:35:18 -0700 Received: from twshared29473.14.frc2.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::4) 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:35:16 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id B2C3754AA3B6; Mon, 11 Apr 2022 16:18:15 -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:18:05 -0700 Message-ID: <20220411231808.667073-1-song@kernel.org> X-Mailer: git-send-email 2.30.2 X-FB-Internal: Safe X-Proofpoint-GUID: zzAUGLDlcLAu6-99sYIdSZpCqevE6tLp X-Proofpoint-ORIG-GUID: zzAUGLDlcLAu6-99sYIdSZpCqevE6tLp 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 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: et157brmau14qrpthyp631fuwtyj16pn Authentication-Results: imf31.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none); spf=none (imf31.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-Rspamd-Queue-Id: 925E020002 X-HE-Tag: 1649720119-13835 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