From patchwork Thu Apr 14 19:59:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12813970 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 691A6C433F5 for ; Thu, 14 Apr 2022 20:05:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF5F36B0074; Thu, 14 Apr 2022 16:04:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA5886B0075; Thu, 14 Apr 2022 16:04:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9BA46B0078; Thu, 14 Apr 2022 16:04:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id CC3FE6B0074 for ; Thu, 14 Apr 2022 16:04:59 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 96BD22385E for ; Thu, 14 Apr 2022 20:04:59 +0000 (UTC) X-FDA: 79356563118.20.5B74BF9 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf12.hostedemail.com (Postfix) with ESMTP id D76AD4000D for ; Thu, 14 Apr 2022 20:04:58 +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 23ED8fPt010914 for ; Thu, 14 Apr 2022 13:04:56 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3fdx3utjwu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 14 Apr 2022 13:04:55 -0700 Received: from twshared13345.18.frc3.facebook.com (2620:10d:c085:208::11) 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; Thu, 14 Apr 2022 13:04:55 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id 003D059738AA; Thu, 14 Apr 2022 12:59:18 -0700 (PDT) From: Song Liu To: , , CC: , , , , , , , , Song Liu Subject: [PATCH v3 bpf RESEND 0/4] vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP Date: Thu, 14 Apr 2022 12:59:10 -0700 Message-ID: <20220414195914.1648345-1-song@kernel.org> X-Mailer: git-send-email 2.30.2 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: PYoEjk224cAx_OT2FWPI5rY--WzbeFxL X-Proofpoint-GUID: PYoEjk224cAx_OT2FWPI5rY--WzbeFxL 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-14_05,2022-04-14_02,2022-02-23_01 X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: D76AD4000D X-Stat-Signature: wzg936nj1hk5kt9g7t3a4gmt897qqe84 Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none); spf=none (imf12.hostedemail.com: domain of "prvs=51035a5414=songliubraving@fb.com" has no SPF policy when checking 67.231.145.42) smtp.mailfrom="prvs=51035a5414=songliubraving@fb.com" X-HE-Tag: 1649966698-419522 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: Resend with a shorter CC list, as the original v3 didn't make through the mail list. :( 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