From patchwork Tue Jun 28 09:22:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12897948 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 0124CC433EF for ; Tue, 28 Jun 2022 09:23:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AC7D8E0003; Tue, 28 Jun 2022 05:23:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 833C88E0001; Tue, 28 Jun 2022 05:23:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6ADE28E0003; Tue, 28 Jun 2022 05:23:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 55FB08E0001 for ; Tue, 28 Jun 2022 05:23:50 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 27AC0347C4 for ; Tue, 28 Jun 2022 09:23:50 +0000 (UTC) X-FDA: 79627107420.23.0756353 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf11.hostedemail.com (Postfix) with ESMTP id EACE340036 for ; Tue, 28 Jun 2022 09:23:48 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id g10-20020a17090a708a00b001ea8aadd42bso12090270pjk.0 for ; Tue, 28 Jun 2022 02:23:48 -0700 (PDT) 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=PQkt4wjPT/v+iF+fXDGRisMQCM0vLDWYyifuIV/OGDo=; b=BGy1MI8xqjO6lduBhMa13lY37kGteP8POqCXl3BZdOwHo9Opp1aEltf4yPcfE+uJ+2 ITWTBRfi0L2QIwl4XxMjPM/RcSAjUuGie94NjWZ0TSq3iPSH3m7NdNUSnvWYoyrIqjjj wkMqlgUCZLwlmXIWSvSo8zk4PWzCIDtGfDBMK87KLwi0vavL57ofaJpo4R+pPLDm4og/ /DZrlTwoxGLTO8ZDdWHkX4l9IIH9xzMH+zfkDqNK6rp+Cx7gTAIZX1rtZGL5ZZQ0ZJV3 kibsGCfxlIe99uHGHgCQwvo15q+zI3SrLYIcHxMgWZNMnUMQuM9WX8Afa/Ic8O+hzH9K /2cg== 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=PQkt4wjPT/v+iF+fXDGRisMQCM0vLDWYyifuIV/OGDo=; b=pD/AGHJ/HDCt8Cbmlj8blhY+excTOfqoxBZjTBdrGluLuolPtIBq70qY7wI1zXgo+I Fr7X8MorPA0owfH7a0wyB37R0WAkmJX41xWvH0AtJ6hpyYuqqhh28Uo5i76GTGXfmtpW SZMMXgFSZzl6cKfCsNbwB5AyBRprvXVRZkDG9eWYzCenUhRGPhmZdnKX451t3Fs+XZVg WxQ29SWkT+nLDY5XzvLuk8JYlF5Axeo0pa2E6jSN9Cw0vGcpNOLv29DKhZP2OJHomUr4 lAmFoZhuQDfGVq4lgjaNlYBo4GVo4ep0qwOuJKUkaFbvgMAiky20+crBaNx2DIsOBCvH qoqA== X-Gm-Message-State: AJIora/8WyDZFs/e4CErBclht/V4lHq89mJRdOYXIG3JS4L/fDqagXzI WmSF1/j/MZm5C2SoQ5SRccZ2rw== X-Google-Smtp-Source: AGRyM1ue3KkVfkoriauuRkSduIpdUzZ8CoxO4+O4HV1szaRrCPOfb8vOnORTEmnfN6gQ6hitXaQo/A== X-Received: by 2002:a17:90b:1d0a:b0:1ee:de8e:9d58 with SMTP id on10-20020a17090b1d0a00b001eede8e9d58mr10347710pjb.39.1656408227811; Tue, 28 Jun 2022 02:23:47 -0700 (PDT) Received: from FVFYT0MHHV2J.bytedance.net ([139.177.225.245]) by smtp.gmail.com with ESMTPSA id mm9-20020a17090b358900b001ec729d4f08sm8780463pjb.54.2022.06.28.02.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 02:23:47 -0700 (PDT) From: Muchun Song To: mike.kravetz@oracle.com, david@redhat.com, akpm@linux-foundation.org, corbet@lwn.net Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, duanxiongchun@bytedance.com, Muchun Song Subject: [PATCH v2 0/8] Simplify hugetlb vmemmap and improve its readability Date: Tue, 28 Jun 2022 17:22:27 +0800 Message-Id: <20220628092235.91270-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=BGy1MI8x; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656408229; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=PQkt4wjPT/v+iF+fXDGRisMQCM0vLDWYyifuIV/OGDo=; b=hWNiIOR8wKiTRTq7t1A8VP2ihtjD8EYK6qK+Hq56R18Nn6jHav4ZgDZUneO66ReSZrcois df6GteeRR4kOz3jG0nYsnPl7wmlbLPrP7dbsBVo0/Fuj+kjbbi/o/ALDmwH49xmFLv347N NrM7IQG6HRdBgaugUM3bhK1w5Co9vqs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656408229; a=rsa-sha256; cv=none; b=6LdgvxpAyaM5eC8rUApXIiixXcigIuS5MVwtKo+4xl2oPQGURAJuH7hWCH5Wqtdf0WiHWM PkTdXzCefMpvZQeGj4R8A+guE/qzX/lBWw/fQiV82+m5AVLHedxjde3GFEhBPvp+iOzJK0 iDkDsIpdD/fJ83x9BYGJPn+BnjYUyKQ= X-Stat-Signature: jehhwuf1f96r8z9ipmqw8frqg833i164 X-Rspamd-Queue-Id: EACE340036 X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=BGy1MI8x; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656408228-16509 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: This series aims to simplify hugetlb vmemmap and improve its readability and is based on next-20220627. v2: - Collect Reviewed-ed and Acked-by. - Improve patch 6's log print. - Add patch 7 to improve vmemmap_dedup.rst. - Add patch 8 for cleanup. Muchun Song (8): mm: hugetlb_vmemmap: delete hugetlb_optimize_vmemmap_enabled() mm: hugetlb_vmemmap: optimize vmemmap_optimize_mode handling mm: hugetlb_vmemmap: introduce the name HVO mm: hugetlb_vmemmap: move vmemmap code related to HugeTLB to hugetlb_vmemmap.c mm: hugetlb_vmemmap: replace early_param() with core_param() mm: hugetlb_vmemmap: improve hugetlb_vmemmap code readability mm: hugetlb_vmemmap: move code comments to vmemmap_dedup.rst mm: hugetlb_vmemmap: use PTRS_PER_PTE instead of PMD_SIZE / PAGE_SIZE Documentation/admin-guide/kernel-parameters.txt | 7 +- Documentation/admin-guide/mm/hugetlbpage.rst | 4 +- Documentation/admin-guide/mm/memory-hotplug.rst | 4 +- Documentation/admin-guide/sysctl/vm.rst | 3 +- Documentation/vm/vmemmap_dedup.rst | 72 ++- arch/arm64/mm/flush.c | 13 +- fs/Kconfig | 12 +- include/linux/hugetlb.h | 7 +- include/linux/mm.h | 7 - include/linux/page-flags.h | 32 +- include/linux/sysctl.h | 4 + mm/hugetlb.c | 15 +- mm/hugetlb_vmemmap.c | 589 ++++++++++++++++++------ mm/hugetlb_vmemmap.h | 45 +- mm/sparse-vmemmap.c | 399 ---------------- 15 files changed, 567 insertions(+), 646 deletions(-) base-commit: aab35c3d5112df6e329a1a5a5a1881e5c4ca3821