From patchwork Wed Mar 30 22:56:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 12796446 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 BC720C433EF for ; Wed, 30 Mar 2022 23:02:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EADA6B0072; Wed, 30 Mar 2022 19:02:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 099618D0002; Wed, 30 Mar 2022 19:02:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA3F38D0001; Wed, 30 Mar 2022 19:02:24 -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 D9FFC6B0072 for ; Wed, 30 Mar 2022 19:02:24 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A918F22DB3 for ; Wed, 30 Mar 2022 23:02:24 +0000 (UTC) X-FDA: 79302578208.14.F0A752C Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf02.hostedemail.com (Postfix) with ESMTP id 2B5CC80036 for ; Wed, 30 Mar 2022 23:02:23 +0000 (UTC) Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 22UHKb66006179 for ; Wed, 30 Mar 2022 16:02:21 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3f4r98453m-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 30 Mar 2022 16:02:21 -0700 Received: from twshared29473.14.frc2.facebook.com (2620:10d:c085:108::4) by mail.thefacebook.com (2620:10d:c085:11d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 30 Mar 2022 16:02:20 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id ABE044764A96; Wed, 30 Mar 2022 15:56:45 -0700 (PDT) From: Song Liu To: , , , CC: , , , , , , , Song Liu Subject: [PATCH bpf 0/4] introduce HAVE_ARCH_HUGE_VMALLOC_FLAG for bpf_prog_pack Date: Wed, 30 Mar 2022 15:56:38 -0700 Message-ID: <20220330225642.1163897-1-song@kernel.org> X-Mailer: git-send-email 2.30.2 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: wjH3IpB0GHpPwjAzb8vzdo-2u8g0qQbi X-Proofpoint-GUID: wjH3IpB0GHpPwjAzb8vzdo-2u8g0qQbi 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.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-30_06,2022-03-30_01,2022-02-23_01 X-Stat-Signature: 9d3sx3ywpo4x96pq1r6e79kx4dtimr3p Authentication-Results: imf02.hostedemail.com; dkim=none; spf=none (imf02.hostedemail.com: domain of "prvs=50888507eb=songliubraving@fb.com" has no SPF policy when checking 67.231.145.42) smtp.mailfrom="prvs=50888507eb=songliubraving@fb.com"; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none) X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2B5CC80036 X-HE-Tag: 1648681343-27531 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: We prematurely enabled HAVE_ARCH_HUGE_VMALLOC for x86_64, which could cause issues [1], [2]. Fix this by with HAVE_ARCH_HUGE_VMALLOC_FLAG, which allows user of __vmalloc_node_range to ask for huge pages with a new flag VM_TRY_HUGE_VMAP. bpf_prog_pack is updated to use this __vmalloc_node_range with VM_TRY_HUGE_VMAP. [1] https://lore.kernel.org/lkml/5bd16e2c06a2df357400556c6ae01bb5d3c5c32a.camel@intel.com/ [2] https://lore.kernel.org/netdev/14444103-d51b-0fb3-ee63-c3f182f0b546@molgen.mpg.de/ Song Liu (4): x86: disable HAVE_ARCH_HUGE_VMALLOC vmalloc: introduce HAVE_ARCH_HUGE_VMALLOC_FLAG x86: select HAVE_ARCH_HUGE_VMALLOC_FLAG for X86_64 bpf: use __vmalloc_node_range() with VM_TRY_HUGE_VMAP for bpf_prog_pack arch/Kconfig | 9 +++++++++ arch/x86/Kconfig | 2 +- include/linux/vmalloc.h | 9 +++++++-- kernel/bpf/core.c | 21 ++++++++++++++++++--- mm/vmalloc.c | 28 +++++++++++++++++++--------- 5 files changed, 54 insertions(+), 15 deletions(-) --- 2.30.2