From: Oscar Salvador <osalvador@suse.de>
To: akpm@linux-foundation.org
Cc: bp@alien8.de, dave.hansen@linux.intel.com, david@redhat.com,
hpa@zytor.com, luto@kernel.org, mhocko@kernel.org,
mingo@redhat.com, mm-commits@vger.kernel.org,
peterz@infradead.org, tglx@linutronix.de, ziy@nvidia.com,
rdunlap@infradead.org
Subject: Re: + x86-vmemmap-handle-unpopulated-sub-pmd-ranges.patch added to -mm tree
Date: Tue, 6 Apr 2021 22:05:14 +0200 [thread overview]
Message-ID: <YGy++mSft7K4u+88@localhost.localdomain> (raw)
In-Reply-To: <20210310225856.PQWfPyaE4%akpm@linux-foundation.org>
On Wed, Mar 10, 2021 at 02:58:56PM -0800, akpm@linux-foundation.org wrote:
> ------------------------------------------------------
> From: Oscar Salvador <osalvador@suse.de>
> Subject: x86/vmemmap: handle unpopulated sub-pmd ranges
>
> When sizeof(struct page) is not a power of 2, sections do not span a PMD
> anymore and so when populating them some parts of the PMD will remain
> unused.
>
> Because of this, PMDs will be left behind when depopulating sections since
> remove_pmd_table() thinks that those unused parts are still in use.
>
> Fix this by marking the unused parts with PAGE_UNUSED, so memchr_inv()
> will do the right thing and will let us free the PMD when the last user of
> it is gone.
>
> This patch is based on a similar patch by David Hildenbrand:
>
> https://lore.kernel.org/linux-mm/20200722094558.9828-9-david@redhat.com/
>
> Link: https://lkml.kernel.org/r/20210309214050.4674-4-osalvador@suse.de
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: "H . Peter Anvin" <hpa@zytor.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Hi Andrew,
Could you squash the following on top?
It seems that we need to go back to the ifdef version as the IS_ENABLED
does not properly work and throws a warning.
Thanks a lot
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 13187a3debe9..bbef99622370 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1123,15 +1123,16 @@ remove_pmd_table(pmd_t *pmd_start, unsigned long addr, unsigned long end,
pmd_clear(pmd);
spin_unlock(&init_mm.page_table_lock);
pages++;
- } else if (IS_ENABLED(CONFIG_SPARSEMEM_VMEMMAP) &&
- vmemmap_pmd_is_unused(addr, next)) {
+ }
+#ifdef CONFIG_SPARSEMEM_VMEMMAP
+ else if (vmemmap_pmd_is_unused(addr, next)) {
free_hugepage_table(pmd_page(*pmd),
altmap);
spin_lock(&init_mm.page_table_lock);
pmd_clear(pmd);
spin_unlock(&init_mm.page_table_lock);
}
-
+#endif
continue;
}
--
Oscar Salvador
SUSE L3
next prev parent reply other threads:[~2021-04-06 20:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 22:58 + x86-vmemmap-handle-unpopulated-sub-pmd-ranges.patch added to -mm tree akpm
2021-04-06 20:05 ` Oscar Salvador [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-03-03 0:08 akpm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YGy++mSft7K4u+88@localhost.localdomain \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mhocko@kernel.org \
--cc=mingo@redhat.com \
--cc=mm-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=tglx@linutronix.de \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.