* [PATCH v2 01/14] mips: fix comment about pgtable_init()
@ 2023-03-21 14:48 Mike Rapoport
2023-03-21 14:48 ` [PATCH v2 02/14] mm/page_alloc: add helper for checking if check_pages_enabled Mike Rapoport
2023-03-22 14:49 ` [PATCH v2 01/14] mips: fix comment about pgtable_init() Philippe Mathieu-Daudé
0 siblings, 2 replies; 5+ messages in thread
From: Mike Rapoport @ 2023-03-21 14:48 UTC (permalink / raw)
To: Andrew Morton
Cc: David Hildenbrand, Doug Berger, Matthew Wilcox, Mel Gorman,
Michal Hocko, Mike Rapoport, Thomas Bogendoerfer,
Vlastimil Babka, linux-kernel, linux-mips, linux-mm
From: "Mike Rapoport (IBM)" <rppt@kernel.org>
Comment about fixrange_init() says that its called from pgtable_init()
while the actual caller is pagetabe_init().
Update comment to match the code.
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
---
arch/mips/include/asm/fixmap.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/fixmap.h b/arch/mips/include/asm/fixmap.h
index beea14761cef..b037718d7e8b 100644
--- a/arch/mips/include/asm/fixmap.h
+++ b/arch/mips/include/asm/fixmap.h
@@ -70,7 +70,7 @@ enum fixed_addresses {
#include <asm-generic/fixmap.h>
/*
- * Called from pgtable_init()
+ * Called from pagetable_init()
*/
extern void fixrange_init(unsigned long start, unsigned long end,
pgd_t *pgd_base);
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 02/14] mm/page_alloc: add helper for checking if check_pages_enabled
2023-03-21 14:48 [PATCH v2 01/14] mips: fix comment about pgtable_init() Mike Rapoport
@ 2023-03-21 14:48 ` Mike Rapoport
2023-03-22 14:49 ` [PATCH v2 01/14] mips: fix comment about pgtable_init() Philippe Mathieu-Daudé
1 sibling, 0 replies; 5+ messages in thread
From: Mike Rapoport @ 2023-03-21 14:48 UTC (permalink / raw)
To: Andrew Morton
Cc: David Hildenbrand, Doug Berger, Matthew Wilcox, Mel Gorman,
Michal Hocko, Mike Rapoport, Thomas Bogendoerfer,
Vlastimil Babka, linux-kernel, linux-mips, linux-mm
From: "Mike Rapoport (IBM)" <rppt@kernel.org>
Instead of duplicating long static_branch_enabled(&check_pages_enabled)
wrap it in a helper function is_check_pages_enabled()
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
---
mm/page_alloc.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 87d760236dba..e1149d54d738 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -245,6 +245,11 @@ EXPORT_SYMBOL(init_on_free);
/* perform sanity checks on struct pages being allocated or freed */
static DEFINE_STATIC_KEY_MAYBE(CONFIG_DEBUG_VM, check_pages_enabled);
+static inline bool is_check_pages_enabled(void)
+{
+ return static_branch_unlikely(&check_pages_enabled);
+}
+
static bool _init_on_alloc_enabled_early __read_mostly
= IS_ENABLED(CONFIG_INIT_ON_ALLOC_DEFAULT_ON);
static int __init early_init_on_alloc(char *buf)
@@ -1443,7 +1448,7 @@ static __always_inline bool free_pages_prepare(struct page *page,
for (i = 1; i < (1 << order); i++) {
if (compound)
bad += free_tail_pages_check(page, page + i);
- if (static_branch_unlikely(&check_pages_enabled)) {
+ if (is_check_pages_enabled()) {
if (unlikely(free_page_is_bad(page + i))) {
bad++;
continue;
@@ -1456,7 +1461,7 @@ static __always_inline bool free_pages_prepare(struct page *page,
page->mapping = NULL;
if (memcg_kmem_online() && PageMemcgKmem(page))
__memcg_kmem_uncharge_page(page, order);
- if (static_branch_unlikely(&check_pages_enabled)) {
+ if (is_check_pages_enabled()) {
if (free_page_is_bad(page))
bad++;
if (bad)
@@ -2366,7 +2371,7 @@ static int check_new_page(struct page *page)
static inline bool check_new_pages(struct page *page, unsigned int order)
{
- if (static_branch_unlikely(&check_pages_enabled)) {
+ if (is_check_pages_enabled()) {
for (int i = 0; i < (1 << order); i++) {
struct page *p = page + i;
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 01/14] mips: fix comment about pgtable_init()
2023-03-21 14:48 [PATCH v2 01/14] mips: fix comment about pgtable_init() Mike Rapoport
2023-03-21 14:48 ` [PATCH v2 02/14] mm/page_alloc: add helper for checking if check_pages_enabled Mike Rapoport
@ 2023-03-22 14:49 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-22 14:49 UTC (permalink / raw)
To: Mike Rapoport, Andrew Morton
Cc: David Hildenbrand, Doug Berger, Matthew Wilcox, Mel Gorman,
Michal Hocko, Thomas Bogendoerfer, Vlastimil Babka, linux-kernel,
linux-mips, linux-mm
On 21/3/23 15:48, Mike Rapoport wrote:
> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
>
> Comment about fixrange_init() says that its called from pgtable_init()
> while the actual caller is pagetabe_init().
>
> Update comment to match the code.
>
> Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> ---
> arch/mips/include/asm/fixmap.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/fixmap.h b/arch/mips/include/asm/fixmap.h
> index beea14761cef..b037718d7e8b 100644
> --- a/arch/mips/include/asm/fixmap.h
> +++ b/arch/mips/include/asm/fixmap.h
> @@ -70,7 +70,7 @@ enum fixed_addresses {
> #include <asm-generic/fixmap.h>
>
> /*
> - * Called from pgtable_init()
> + * Called from pagetable_init()
I'm not sure about the usefulness of this comment; I suppose it
predates git-grep. Anyhow,
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> */
> extern void fixrange_init(unsigned long start, unsigned long end,
> pgd_t *pgd_base);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 00/14] mm: move core MM initialization to mm/mm_init.c
@ 2023-03-21 17:04 Mike Rapoport
2023-03-21 17:05 ` [PATCH v2 01/14] mips: fix comment about pgtable_init() Mike Rapoport
0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2023-03-21 17:04 UTC (permalink / raw)
To: Andrew Morton
Cc: David Hildenbrand, Doug Berger, Matthew Wilcox, Mel Gorman,
Michal Hocko, Mike Rapoport, Thomas Bogendoerfer,
Vlastimil Babka, linux-kernel, linux-mips, linux-mm
From: "Mike Rapoport (IBM)" <rppt@kernel.org>
Also in git:
https://git.kernel.org/rppt/h/mm-init/v2
v2:
* move init_cma_reserved_pageblock() from cma.c to mm_init.c
* rename init_mem_debugging_and_hardening() to
mem_debugging_and_hardening_init()
* inline pgtable_init() into mem_core_init()
* add Acked and Reviewed tags (thanks David, hopefully I've picked them
right)
v1: https://lore.kernel.org/all/20230319220008.2138576-1-rppt@kernel.org
This set moves most of the core MM initialization to mm/mm_init.c.
This largely includes free_area_init() and its helpers, functions used at
boot time, mm_init() from init/main.c and some of the functions it calls.
Aside from gaining some more space before mm/page_alloc.c hits 10k lines,
this makes mm/page_alloc.c to be mostly about buddy allocator and moves the
init code out of the way, which IMO improves maintainability.
Besides, this allows to move a couple of declarations out of include/linux
and make them private to mm/.
And as an added bonus there a slight decrease in vmlinux size.
For tinyconfig and defconfig on x86 I've got
tinyconfig:
text data bss dec hex filename
853206 289376 1200128 2342710 23bf36 a/vmlinux
853198 289344 1200128 2342670 23bf0e b/vmlinux
defconfig:
text data bss dec hex filename
26152959 9730634 2170884 38054477 244aa4d a/vmlinux
26152945 9730602 2170884 38054431 244aa1f b/vmlinux
Mike Rapoport (IBM) (14):
mips: fix comment about pgtable_init()
mm/page_alloc: add helper for checking if check_pages_enabled
mm: move most of core MM initialization to mm/mm_init.c
mm: handle hashdist initialization in mm/mm_init.c
mm/page_alloc: rename page_alloc_init() to page_alloc_init_cpuhp()
init: fold build_all_zonelists() and page_alloc_init_cpuhp() to mm_init()
init,mm: move mm_init() to mm/mm_init.c and rename it to mm_core_init()
mm: call {ptlock,pgtable}_cache_init() directly from mm_core_init()
mm: move init_mem_debugging_and_hardening() to mm/mm_init.c
init,mm: fold late call to page_ext_init() to page_alloc_init_late()
mm: move mem_init_print_info() to mm_init.c
mm: move kmem_cache_init() declaration to mm/slab.h
mm: move vmalloc_init() declaration to mm/internal.h
MAINTAINERS: extend memblock entry to include MM initialization
MAINTAINERS | 3 +-
arch/mips/include/asm/fixmap.h | 2 +-
include/linux/gfp.h | 7 +-
include/linux/mm.h | 9 +-
include/linux/page_ext.h | 2 -
include/linux/slab.h | 1 -
include/linux/vmalloc.h | 4 -
init/main.c | 74 +-
mm/cma.c | 1 +
mm/internal.h | 52 +-
mm/mm_init.c | 2547 +++++++++++++++++++++++++++
mm/page_alloc.c | 2981 +++-----------------------------
mm/slab.h | 1 +
13 files changed, 2856 insertions(+), 2828 deletions(-)
base-commit: 4018ab1f7cec061b8425737328edefebdc0ab832
--
2.35.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 01/14] mips: fix comment about pgtable_init()
2023-03-21 17:04 [PATCH v2 00/14] mm: move core MM initialization to mm/mm_init.c Mike Rapoport
@ 2023-03-21 17:05 ` Mike Rapoport
2023-03-22 11:36 ` Vlastimil Babka
0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2023-03-21 17:05 UTC (permalink / raw)
To: Andrew Morton
Cc: David Hildenbrand, Doug Berger, Matthew Wilcox, Mel Gorman,
Michal Hocko, Mike Rapoport, Thomas Bogendoerfer,
Vlastimil Babka, linux-kernel, linux-mips, linux-mm
From: "Mike Rapoport (IBM)" <rppt@kernel.org>
Comment about fixrange_init() says that its called from pgtable_init()
while the actual caller is pagetabe_init().
Update comment to match the code.
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
---
arch/mips/include/asm/fixmap.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/fixmap.h b/arch/mips/include/asm/fixmap.h
index beea14761cef..b037718d7e8b 100644
--- a/arch/mips/include/asm/fixmap.h
+++ b/arch/mips/include/asm/fixmap.h
@@ -70,7 +70,7 @@ enum fixed_addresses {
#include <asm-generic/fixmap.h>
/*
- * Called from pgtable_init()
+ * Called from pagetable_init()
*/
extern void fixrange_init(unsigned long start, unsigned long end,
pgd_t *pgd_base);
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 01/14] mips: fix comment about pgtable_init()
2023-03-21 17:05 ` [PATCH v2 01/14] mips: fix comment about pgtable_init() Mike Rapoport
@ 2023-03-22 11:36 ` Vlastimil Babka
0 siblings, 0 replies; 5+ messages in thread
From: Vlastimil Babka @ 2023-03-22 11:36 UTC (permalink / raw)
To: Mike Rapoport, Andrew Morton
Cc: David Hildenbrand, Doug Berger, Matthew Wilcox, Mel Gorman,
Michal Hocko, Thomas Bogendoerfer, linux-kernel, linux-mips,
linux-mm
On 3/21/23 18:05, Mike Rapoport wrote:
> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
>
> Comment about fixrange_init() says that its called from pgtable_init()
> while the actual caller is pagetabe_init().
>
> Update comment to match the code.
>
> Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
> Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> arch/mips/include/asm/fixmap.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/fixmap.h b/arch/mips/include/asm/fixmap.h
> index beea14761cef..b037718d7e8b 100644
> --- a/arch/mips/include/asm/fixmap.h
> +++ b/arch/mips/include/asm/fixmap.h
> @@ -70,7 +70,7 @@ enum fixed_addresses {
> #include <asm-generic/fixmap.h>
>
> /*
> - * Called from pgtable_init()
> + * Called from pagetable_init()
> */
> extern void fixrange_init(unsigned long start, unsigned long end,
> pgd_t *pgd_base);
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-03-22 14:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 14:48 [PATCH v2 01/14] mips: fix comment about pgtable_init() Mike Rapoport
2023-03-21 14:48 ` [PATCH v2 02/14] mm/page_alloc: add helper for checking if check_pages_enabled Mike Rapoport
2023-03-22 14:49 ` [PATCH v2 01/14] mips: fix comment about pgtable_init() Philippe Mathieu-Daudé
2023-03-21 17:04 [PATCH v2 00/14] mm: move core MM initialization to mm/mm_init.c Mike Rapoport
2023-03-21 17:05 ` [PATCH v2 01/14] mips: fix comment about pgtable_init() Mike Rapoport
2023-03-22 11:36 ` Vlastimil Babka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).