* + mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages.patch added to -mm tree
@ 2021-06-16 23:40 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-06-16 23:40 UTC (permalink / raw)
To: chenhuang5, corbet, david, duanxiongchun, mhocko, mike.kravetz,
mm-commits, osalvador, songmuchun
The patch titled
Subject: mm: sparsemem: use huge PMD mapping for vmemmap pages
has been added to the -mm tree. Its filename is
mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Muchun Song <songmuchun@bytedance.com>
Subject: mm: sparsemem: use huge PMD mapping for vmemmap pages
The preparation of splitting huge PMD mapping of vmemmap pages is ready,
so switch the mapping from PTE to PMD.
Link: https://lkml.kernel.org/r/20210616094915.34432-3-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Chen Huang <chenhuang5@huawei.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Xiongchun Duan <duanxiongchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
Documentation/admin-guide/kernel-parameters.txt | 7 ---
arch/x86/mm/init_64.c | 8 +---
include/linux/hugetlb.h | 25 +++-----------
mm/memory_hotplug.c | 2 -
4 files changed, 9 insertions(+), 33 deletions(-)
--- a/arch/x86/mm/init_64.c~mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages
+++ a/arch/x86/mm/init_64.c
@@ -34,7 +34,6 @@
#include <linux/gfp.h>
#include <linux/kcore.h>
#include <linux/bootmem_info.h>
-#include <linux/hugetlb.h>
#include <asm/processor.h>
#include <asm/bios_ebda.h>
@@ -1610,8 +1609,7 @@ int __meminit vmemmap_populate(unsigned
VM_BUG_ON(!IS_ALIGNED(start, PAGE_SIZE));
VM_BUG_ON(!IS_ALIGNED(end, PAGE_SIZE));
- if ((is_hugetlb_free_vmemmap_enabled() && !altmap) ||
- end - start < PAGES_PER_SECTION * sizeof(struct page))
+ if (end - start < PAGES_PER_SECTION * sizeof(struct page))
err = vmemmap_populate_basepages(start, end, node, NULL);
else if (boot_cpu_has(X86_FEATURE_PSE))
err = vmemmap_populate_hugepages(start, end, node, altmap);
@@ -1639,8 +1637,6 @@ void register_page_bootmem_memmap(unsign
pmd_t *pmd;
unsigned int nr_pmd_pages;
struct page *page;
- bool base_mapping = !boot_cpu_has(X86_FEATURE_PSE) ||
- is_hugetlb_free_vmemmap_enabled();
for (; addr < end; addr = next) {
pte_t *pte = NULL;
@@ -1666,7 +1662,7 @@ void register_page_bootmem_memmap(unsign
}
get_page_bootmem(section_nr, pud_page(*pud), MIX_SECTION_INFO);
- if (base_mapping) {
+ if (!boot_cpu_has(X86_FEATURE_PSE)) {
next = (addr + PAGE_SIZE) & PAGE_MASK;
pmd = pmd_offset(pud, addr);
if (pmd_none(*pmd))
--- a/Documentation/admin-guide/kernel-parameters.txt~mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages
+++ a/Documentation/admin-guide/kernel-parameters.txt
@@ -1572,13 +1572,6 @@
enabled.
Allows heavy hugetlb users to free up some more
memory (6 * PAGE_SIZE for each 2MB hugetlb page).
- This feauture is not free though. Large page
- tables are not used to back vmemmap pages which
- can lead to a performance degradation for some
- workloads. Also there will be memory allocation
- required when hugetlb pages are freed from the
- pool which can lead to corner cases under heavy
- memory pressure.
Format: { on | off (default) }
on: enable the feature
--- a/include/linux/hugetlb.h~mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages
+++ a/include/linux/hugetlb.h
@@ -895,20 +895,6 @@ static inline void huge_ptep_modify_prot
}
#endif
-#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
-extern bool hugetlb_free_vmemmap_enabled;
-
-static inline bool is_hugetlb_free_vmemmap_enabled(void)
-{
- return hugetlb_free_vmemmap_enabled;
-}
-#else
-static inline bool is_hugetlb_free_vmemmap_enabled(void)
-{
- return false;
-}
-#endif
-
#else /* CONFIG_HUGETLB_PAGE */
struct hstate {};
@@ -1063,13 +1049,14 @@ static inline void set_huge_swap_pte_at(
pte_t *ptep, pte_t pte, unsigned long sz)
{
}
-
-static inline bool is_hugetlb_free_vmemmap_enabled(void)
-{
- return false;
-}
#endif /* CONFIG_HUGETLB_PAGE */
+#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
+extern bool hugetlb_free_vmemmap_enabled;
+#else
+#define hugetlb_free_vmemmap_enabled false
+#endif
+
static inline spinlock_t *huge_pte_lock(struct hstate *h,
struct mm_struct *mm, pte_t *pte)
{
--- a/mm/memory_hotplug.c~mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages
+++ a/mm/memory_hotplug.c
@@ -1056,7 +1056,7 @@ bool mhp_supports_memmap_on_memory(unsig
* populate a single PMD.
*/
return memmap_on_memory &&
- !is_hugetlb_free_vmemmap_enabled() &&
+ !hugetlb_free_vmemmap_enabled &&
IS_ENABLED(CONFIG_MHP_MEMMAP_ON_MEMORY) &&
size == memory_block_size_bytes() &&
IS_ALIGNED(vmemmap_size, PMD_SIZE) &&
_
Patches currently in -mm which might be from songmuchun@bytedance.com are
mm-memcontrol-fix-root_mem_cgroup-charging.patch
mm-memcontrol-fix-page-charging-in-page-replacement.patch
mm-memcontrol-bail-out-early-when-mm-in-get_mem_cgroup_from_mm.patch
mm-memcontrol-remove-the-pgdata-parameter-of-mem_cgroup_page_lruvec.patch
mm-memcontrol-simplify-lruvec_holds_page_lru_lock.patch
mm-memcontrol-rename-lruvec_holds_page_lru_lock-to-page_matches_lruvec.patch
mm-memcontrol-simplify-the-logic-of-objcg-pinning-memcg.patch
mm-memcontrol-move-obj_cgroup_uncharge_pages-out-of-css_set_lock.patch
mm-vmscan-remove-noinline_for_stack.patch
mm-memory_hotplug-factor-out-bootmem-core-functions-to-bootmem_infoc.patch
mm-hugetlb-introduce-a-new-config-hugetlb_page_free_vmemmap.patch
mm-hugetlb-gather-discrete-indexes-of-tail-page.patch
mm-hugetlb-free-the-vmemmap-pages-associated-with-each-hugetlb-page.patch
mm-hugetlb-defer-freeing-of-hugetlb-pages.patch
mm-hugetlb-alloc-the-vmemmap-pages-associated-with-each-hugetlb-page.patch
mm-hugetlb-add-a-kernel-parameter-hugetlb_free_vmemmap.patch
mm-memory_hotplug-disable-memmap_on_memory-when-hugetlb_free_vmemmap-enabled.patch
mm-hugetlb-introduce-nr_free_vmemmap_pages-in-the-struct-hstate.patch
mm-sparsemem-split-the-huge-pmd-mapping-of-vmemmap-pages.patch
mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages.patch
mm-hugetlb-introduce-config_hugetlb_page_free_vmemmap_default_on.patch
mm-migrate-fix-missing-update-page_private-to-hugetlb_page_subpool.patch
mm-migrate-fix-missing-update-page_private-to-hugetlb_page_subpool-v2.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-16 23:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 23:40 + mm-sparsemem-use-huge-pmd-mapping-for-vmemmap-pages.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.