From patchwork Fri Apr 15 16:44:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12815200 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 8086BC433EF for ; Fri, 15 Apr 2022 16:49:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 00A906B0072; Fri, 15 Apr 2022 12:49:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED4FF6B0073; Fri, 15 Apr 2022 12:49:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D4FFA6B0074; Fri, 15 Apr 2022 12:49:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id C03456B0072 for ; Fri, 15 Apr 2022 12:49:50 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 99CC420FE2 for ; Fri, 15 Apr 2022 16:49:50 +0000 (UTC) X-FDA: 79359700140.11.BE1518D Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf11.hostedemail.com (Postfix) with ESMTP id D653B4000B for ; Fri, 15 Apr 2022 16:49:49 +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 23ENtp4D019126 for ; Fri, 15 Apr 2022 09:49:48 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3fewgrut7m-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Apr 2022 09:49:48 -0700 Received: from twshared10896.25.frc3.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:11d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 15 Apr 2022 09:49:35 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id B9C785A45DBE; Fri, 15 Apr 2022 09:44:20 -0700 (PDT) From: Song Liu To: , , CC: , , , , , , , , Song Liu Subject: [PATCH v4 bpf 0/4] vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP Date: Fri, 15 Apr 2022 09:44:09 -0700 Message-ID: <20220415164413.2727220-1-song@kernel.org> X-Mailer: git-send-email 2.30.2 X-FB-Internal: Safe X-Proofpoint-GUID: dNSri1WL9hHOIIMGMjWjc4EhKq3fVRR9 X-Proofpoint-ORIG-GUID: dNSri1WL9hHOIIMGMjWjc4EhKq3fVRR9 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-15_06,2022-04-15_01,2022-02-23_01 X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: D653B4000B X-Stat-Signature: c4gh416pbqkkdmznxpxr419e5ojh5spg Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none); spf=none (imf11.hostedemail.com: domain of "prvs=510404da6d=songliubraving@fb.com" has no SPF policy when checking 67.231.145.42) smtp.mailfrom="prvs=510404da6d=songliubraving@fb.com" X-HE-Tag: 1650041389-465365 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 v3 => v4: 1. Fix __weak module_alloc_huge; remove unused vmalloc_huge; rename __vmalloc_huge => vmalloc_huge. (Christoph Hellwig) 2. Use vzalloc (as it was before vmalloc_no_huge) and clean up comments in kvm_s390_pv_alloc_vm. 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 | 7 +------ arch/x86/kernel/module.c | 21 +++++++++++++++++++++ include/linux/moduleloader.h | 5 +++++ include/linux/vmalloc.h | 4 ++-- kernel/bpf/core.c | 7 ++++--- kernel/module.c | 8 ++++++++ mm/page_alloc.c | 2 +- mm/vmalloc.c | 17 ++++++++++------- 10 files changed, 55 insertions(+), 24 deletions(-) Signed-off-by: Nicholas Piggin --- 2.30.2