From patchwork Wed Mar 2 08:37:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12765616 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 64E7AC433F5 for ; Wed, 2 Mar 2022 08:38:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2A908D0003; Wed, 2 Mar 2022 03:38:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CD9438D0001; Wed, 2 Mar 2022 03:38:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC85C8D0003; Wed, 2 Mar 2022 03:38:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id ACB848D0001 for ; Wed, 2 Mar 2022 03:38:15 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6C32C8249980 for ; Wed, 2 Mar 2022 08:38:15 +0000 (UTC) X-FDA: 79198794150.26.B7E059D Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf14.hostedemail.com (Postfix) with ESMTP id A2204100008 for ; Wed, 2 Mar 2022 08:38:14 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id u16so1264736pfg.12 for ; Wed, 02 Mar 2022 00:38:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vuEh+AI7I41MHfBSDW5EnBJuRobxoamBcasQOIbr9mQ=; b=sfEqtVNUj5HIF8CigOLeWbLBoDWueQR0b20mz1nn9AqoSfduKJKT70rSGeiEqEzhBf yV1Cq1xlHEDEYGCnRq25O/4AaRGD9mZ0gtZ4DUciOazXXLhAranVxaL1KeGaflg+qegU dSXS2PGsDrKiJg/gHZklR4CF5f0SGkpS4IGSRievgS07uJDno19REjORMY7s2P06TST/ z/QfCQFFr8i+63CsYezyN+v2CtW25vdY8hGpoWdwVj1HaO/pxE8wqOqPcf09CFSStKeD NfTV9Nx69m00GA0AJXa1M3znvHypHqbYlfliibNuheLupZ2QhxMzmm5NdNSjPSk/9Pam /m+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vuEh+AI7I41MHfBSDW5EnBJuRobxoamBcasQOIbr9mQ=; b=aBS194ELnCCSPoZheGseFfhq59gyeyC4ds5tzYk1Vk/Rd9Wi5aouAf68If4/6ZKUFM vm/AJxR3ETqmzD2uletq1CVGy/LMI1es+fzww0eV7MiXRkQYmwviH/g+NTMXjJF+uVeZ yIewECGGEsv43oCEi201XBmnjykzTHevg3o4zpW60ErUEfpRx8n4926G5/xrOELTMWMw eSHFUDPOzgABipBIvffKxRKpbgrIQDMS9m1+tS9gXt7EBT0qv+UlN8XCe/YkU7nFqz4Q v00AqNF45DhHeV7jIX578g4Vqb2QkjN55A41Gn1MrgHqjlCAUhc1j5a8H/jCzMUmnXmI McQA== X-Gm-Message-State: AOAM533oiEkFlXKpVv+Inp5k800KgdJ6mMbdto7zs+rbc/Zco/4TozRv EpSdRlEcTHtqBh4blMAzqOCH7Q== X-Google-Smtp-Source: ABdhPJyU/gzUwFPTrqmH05EFsV7a1BMv2sPR5Joj21ZAEsQWWG5rtcN1Y9u5yF57S/oKVnjRhx/VQw== X-Received: by 2002:a05:6a00:2cd:b0:4e1:1989:5b7f with SMTP id b13-20020a056a0002cd00b004e119895b7fmr31678105pft.3.1646210293519; Wed, 02 Mar 2022 00:38:13 -0800 (PST) Received: from FVFYT0MHHV2J.bytedance.net ([61.120.150.70]) by smtp.gmail.com with ESMTPSA id 17-20020a056a00071100b004f0f941d1e8sm18705141pfl.24.2022.03.02.00.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 00:38:13 -0800 (PST) From: Muchun Song To: corbet@lwn.net, mike.kravetz@oracle.com, akpm@linux-foundation.org, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v2 0/3] add hugetlb_free_vmemmap sysctl Date: Wed, 2 Mar 2022 16:37:55 +0800 Message-Id: <20220302083758.32528-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: A2204100008 X-Stat-Signature: kshdietqp4azbektrikty3nnr76tp3zp Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=sfEqtVNU; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf14.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-HE-Tag: 1646210294-438965 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This series amis to add hugetlb_free_vmemmap sysctl to enable the feature of freeing vmemmap pages of HugeTLB pages. v2: - Fix compilation when !CONFIG_MHP_MEMMAP_ON_MEMORY reported by kernel test robot . - Move sysctl code from kernel/sysctl.c to mm/hugetlb_vmemmap.c. Muchun Song (3): mm: hugetlb: disable freeing vmemmap pages when struct page crosses page boundaries sysctl: allow to set extra1 to SYSCTL_ONE mm: hugetlb: add hugetlb_free_vmemmap sysctl Documentation/admin-guide/sysctl/vm.rst | 13 ++++++++++ include/linux/memory_hotplug.h | 9 +++++++ kernel/sysctl.c | 2 +- mm/hugetlb_vmemmap.c | 43 ++++++++++++++++++++++++++++++++- mm/hugetlb_vmemmap.h | 4 ++- mm/memory_hotplug.c | 5 ++++ 6 files changed, 73 insertions(+), 3 deletions(-)