From patchwork Wed Jun 9 12:13:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12309973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8A12C48BCF for ; Wed, 9 Jun 2021 12:16:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E2C0361351 for ; Wed, 9 Jun 2021 12:16:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2C0361351 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2695E6B0036; Wed, 9 Jun 2021 08:16:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F31D6B006E; Wed, 9 Jun 2021 08:16:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 046F96B0070; Wed, 9 Jun 2021 08:16:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id C3B7A6B0036 for ; Wed, 9 Jun 2021 08:16:08 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5BC648249980 for ; Wed, 9 Jun 2021 12:16:08 +0000 (UTC) X-FDA: 78234082416.14.1D877A4 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by imf02.hostedemail.com (Postfix) with ESMTP id 41A8541AD7A4 for ; Wed, 9 Jun 2021 12:16:04 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id e22so19264115pgv.10 for ; Wed, 09 Jun 2021 05:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wprdMWfJiXYwt+byCaL17b8Ql6JNBi5HmdAMUTjvSbc=; b=V+MbqtjhsFxJ9XUKWyH9b56cSIZdlel2+2J+6Y0VjDs0KVJP/tVYXUiqHSXhbQWa4T NRBvXHKhwwkgnNsJ2bpdbP5e+ZKvM0r9ZOiN5uvAa1qAzUX7T9Uh6JGu8eRp0iQ+6bTy 7/uGiQlRBK19yPMEh1VkiGnTTl34a1ApoBZ7crHxjUqUUAA/v7if1iJcadXbgv+11/rP oVXj4HDLmR4EgDnpECdZqNnw/ioCtWRUsmu83SLvWTqOURAOuK8a9LE/Uof55nQcCnYH +g3rUisaThQgqytwPQnm6x0cHrlXtbn5LZOWe5ZLY/dtsbYrL7pc0eutYOxZef60yA1M ZuMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wprdMWfJiXYwt+byCaL17b8Ql6JNBi5HmdAMUTjvSbc=; b=D2a/z2YNAzZO/UUFvSBktdrlqZsVJdXch4lA4zZkHEPlYeY61ggBSYuHe/01jvXMwe mI8VmUn6+HTJvDVFYsa/ZdVz+FPNCAfQYu/i70cJjMm4sXsJgp66HvcRjNldjzbIpbni u7n/L3A9kks23cef3ti5Cr2Q6j1UlrtxYs0u0X1OkvZcTTYb42YT4RECCTUeEiqLT0QQ p8vtzeiDz9LyfH1cAnhxaV4QscAwXm6WPuh7/+ppElRcS7z7q/J6HuMW1VRM+CwgBRX2 80Lg5aCOQ3ykQEIWVRZCzf4j5pxF2d2Ircvp56Qb83RBAx4Y2X7Ebjp8pTBTNZwJjvgX ZGcA== X-Gm-Message-State: AOAM530zEh5m//zQLDTc/dl/ZfarRJHSO91ztArOngcBT5OABmExgJbJ tsHL4kQBpCwZ+WAHqFss1SB2yw== X-Google-Smtp-Source: ABdhPJxOzhPyB/B/fwjQm3fVVbXISdPVlMybZd7K3dy83KhCsPp0ST1pBO2gb286LZ/N8Wmg3LYsRw== X-Received: by 2002:a05:6a00:23cf:b029:2d5:302e:dc77 with SMTP id g15-20020a056a0023cfb02902d5302edc77mr4973334pfc.63.1623240964882; Wed, 09 Jun 2021 05:16:04 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id h16sm13689224pfk.119.2021.06.09.05.15.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jun 2021 05:16:04 -0700 (PDT) From: Muchun Song To: mike.kravetz@oracle.com, akpm@linux-foundation.org, osalvador@suse.de, mhocko@suse.com, song.bao.hua@hisilicon.com, david@redhat.com, chenhuang5@huawei.com, bodeddub@amazon.com, corbet@lwn.net Cc: duanxiongchun@bytedance.com, fam.zheng@bytedance.com, zhengqi.arch@bytedance.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Muchun Song Subject: [PATCH 0/5] Split huge PMD mapping of vmemmap pages Date: Wed, 9 Jun 2021 20:13:05 +0800 Message-Id: <20210609121310.62229-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) MIME-Version: 1.0 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=V+Mbqtjh; spf=pass (imf02.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.179 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: 169g1epqi945oiogdygg6yxmua14q9tq X-Rspamd-Queue-Id: 41A8541AD7A4 X-Rspamd-Server: rspam06 X-HE-Tag: 1623240964-490503 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: In order to reduce the difficulty of code review in series[1]. We disable huge PMD mapping of vmemmap pages when that feature is enabled. In this series, we do not disable huge PMD mapping of vmemmap pages anymore. We will split huge PMD mapping when needed. [1] https://lore.kernel.org/linux-doc/20210510030027.56044-1-songmuchun@bytedance.com/ Muchun Song (5): mm: hugetlb: introduce helpers to preallocate/free page tables mm: hugetlb: introduce helpers to preallocate page tables from bootmem allocator mm: sparsemem: split the huge PMD mapping of vmemmap pages mm: sparsemem: use huge PMD mapping for vmemmap pages mm: hugetlb: introduce CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON Documentation/admin-guide/kernel-parameters.txt | 10 +- arch/x86/mm/init_64.c | 8 +- fs/Kconfig | 10 ++ include/linux/hugetlb.h | 28 ++---- include/linux/mm.h | 2 +- mm/hugetlb.c | 42 +++++++- mm/hugetlb_vmemmap.c | 126 +++++++++++++++++++++++- mm/hugetlb_vmemmap.h | 25 +++++ mm/memory_hotplug.c | 2 +- mm/sparse-vmemmap.c | 61 ++++++++++-- 10 files changed, 267 insertions(+), 47 deletions(-)