[v2,08/14] mm: call {ptlock,pgtable}_cache_init() directly from mm_core_init()

Message ID 20230321170513.2401534-9-rppt@kernel.org
State New
Headers
Series mm: move core MM initialization to mm/mm_init.c |

Commit Message

Mike Rapoport March 21, 2023, 5:05 p.m. UTC
  From: "Mike Rapoport (IBM)" <rppt@kernel.org>

and drop pgtable_init() as it has no real value and it's name is
misleading.

Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 6 ------
 mm/mm_init.c       | 3 ++-
 2 files changed, 2 insertions(+), 7 deletions(-)
  

Comments

Sergei Shtylyov March 22, 2023, 9:06 a.m. UTC | #1
On 3/21/23 8:05 PM, Mike Rapoport wrote:

> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
> 
> and drop pgtable_init() as it has no real value and it's name is

   Its name.

> misleading.
> 
> Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
[...]

MBR, Sergey
  
Mike Rapoport March 22, 2023, 10:08 a.m. UTC | #2
On Wed, Mar 22, 2023 at 12:06:18PM +0300, Sergei Shtylyov wrote:
> On 3/21/23 8:05 PM, Mike Rapoport wrote:
> 
> > From: "Mike Rapoport (IBM)" <rppt@kernel.org>
> > 
> > and drop pgtable_init() as it has no real value and it's name is
> 
>    Its name.

oops :)

Andrew, can you replace this patch with the updated version, please?
 
From 52420723c9bfa84aa48f666330e96f9e5b2f3248 Mon Sep 17 00:00:00 2001
From: "Mike Rapoport (IBM)" <rppt@kernel.org>
Date: Sat, 18 Mar 2023 13:55:28 +0200
Subject: [PATCH v3] mm: call {ptlock,pgtable}_cache_init() directly from
 mm_core_init()

and drop pgtable_init() as it has no real value and its name is
misleading.

Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 6 ------
 mm/mm_init.c       | 3 ++-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2d7f095136fc..c3c67d8bc833 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2782,12 +2782,6 @@ static inline bool ptlock_init(struct page *page) { return true; }
 static inline void ptlock_free(struct page *page) {}
 #endif /* USE_SPLIT_PTE_PTLOCKS */
 
-static inline void pgtable_init(void)
-{
-	ptlock_cache_init();
-	pgtable_cache_init();
-}
-
 static inline bool pgtable_pte_page_ctor(struct page *page)
 {
 	if (!ptlock_init(page))
diff --git a/mm/mm_init.c b/mm/mm_init.c
index bba73f1fb277..f1475413394d 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -2584,7 +2584,8 @@ void __init mm_core_init(void)
 	 */
 	page_ext_init_flatmem_late();
 	kmemleak_init();
-	pgtable_init();
+	ptlock_cache_init();
+	pgtable_cache_init();
 	debug_objects_mem_init();
 	vmalloc_init();
 	/* If no deferred init page_ext now, as vmap is fully initialized */
  
David Hildenbrand March 22, 2023, 11:18 a.m. UTC | #3
On 22.03.23 11:08, Mike Rapoport wrote:
> On Wed, Mar 22, 2023 at 12:06:18PM +0300, Sergei Shtylyov wrote:
>> On 3/21/23 8:05 PM, Mike Rapoport wrote:
>>
>>> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
>>>
>>> and drop pgtable_init() as it has no real value and it's name is
>>
>>     Its name.
> 
> oops :)
> 
> Andrew, can you replace this patch with the updated version, please?
>   
>  From 52420723c9bfa84aa48f666330e96f9e5b2f3248 Mon Sep 17 00:00:00 2001
> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
> Date: Sat, 18 Mar 2023 13:55:28 +0200
> Subject: [PATCH v3] mm: call {ptlock,pgtable}_cache_init() directly from
>   mm_core_init()
> 
> and drop pgtable_init() as it has no real value and its name is
> misleading.
> 
> Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
> ---
>   include/linux/mm.h | 6 ------
>   mm/mm_init.c       | 3 ++-
>   2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 2d7f095136fc..c3c67d8bc833 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2782,12 +2782,6 @@ static inline bool ptlock_init(struct page *page) { return true; }
>   static inline void ptlock_free(struct page *page) {}
>   #endif /* USE_SPLIT_PTE_PTLOCKS */
>   
> -static inline void pgtable_init(void)
> -{
> -	ptlock_cache_init();
> -	pgtable_cache_init();
> -}
> -
>   static inline bool pgtable_pte_page_ctor(struct page *page)
>   {
>   	if (!ptlock_init(page))
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index bba73f1fb277..f1475413394d 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -2584,7 +2584,8 @@ void __init mm_core_init(void)
>   	 */
>   	page_ext_init_flatmem_late();
>   	kmemleak_init();
> -	pgtable_init();
> +	ptlock_cache_init();
> +	pgtable_cache_init();
>   	debug_objects_mem_init();
>   	vmalloc_init();
>   	/* If no deferred init page_ext now, as vmap is fully initialized */

Reviewed-by: David Hildenbrand <david@redhat.com>
  
Vlastimil Babka March 22, 2023, 4:27 p.m. UTC | #4
On 3/22/23 11:08, Mike Rapoport wrote:
> On Wed, Mar 22, 2023 at 12:06:18PM +0300, Sergei Shtylyov wrote:
>> On 3/21/23 8:05 PM, Mike Rapoport wrote:
>> 
>> > From: "Mike Rapoport (IBM)" <rppt@kernel.org>
>> > 
>> > and drop pgtable_init() as it has no real value and it's name is
>> 
>>    Its name.
> 
> oops :)
> 
> Andrew, can you replace this patch with the updated version, please?
>  
> From 52420723c9bfa84aa48f666330e96f9e5b2f3248 Mon Sep 17 00:00:00 2001
> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
> Date: Sat, 18 Mar 2023 13:55:28 +0200
> Subject: [PATCH v3] mm: call {ptlock,pgtable}_cache_init() directly from
>  mm_core_init()
> 
> and drop pgtable_init() as it has no real value and its name is
> misleading.
> 
> Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  include/linux/mm.h | 6 ------
>  mm/mm_init.c       | 3 ++-
>  2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 2d7f095136fc..c3c67d8bc833 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2782,12 +2782,6 @@ static inline bool ptlock_init(struct page *page) { return true; }
>  static inline void ptlock_free(struct page *page) {}
>  #endif /* USE_SPLIT_PTE_PTLOCKS */
>  
> -static inline void pgtable_init(void)
> -{
> -	ptlock_cache_init();
> -	pgtable_cache_init();
> -}
> -
>  static inline bool pgtable_pte_page_ctor(struct page *page)
>  {
>  	if (!ptlock_init(page))
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index bba73f1fb277..f1475413394d 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -2584,7 +2584,8 @@ void __init mm_core_init(void)
>  	 */
>  	page_ext_init_flatmem_late();
>  	kmemleak_init();
> -	pgtable_init();
> +	ptlock_cache_init();
> +	pgtable_cache_init();
>  	debug_objects_mem_init();
>  	vmalloc_init();
>  	/* If no deferred init page_ext now, as vmap is fully initialized */
  

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2d7f095136fc..c3c67d8bc833 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2782,12 +2782,6 @@  static inline bool ptlock_init(struct page *page) { return true; }
 static inline void ptlock_free(struct page *page) {}
 #endif /* USE_SPLIT_PTE_PTLOCKS */
 
-static inline void pgtable_init(void)
-{
-	ptlock_cache_init();
-	pgtable_cache_init();
-}
-
 static inline bool pgtable_pte_page_ctor(struct page *page)
 {
 	if (!ptlock_init(page))
diff --git a/mm/mm_init.c b/mm/mm_init.c
index bba73f1fb277..f1475413394d 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -2584,7 +2584,8 @@  void __init mm_core_init(void)
 	 */
 	page_ext_init_flatmem_late();
 	kmemleak_init();
-	pgtable_init();
+	ptlock_cache_init();
+	pgtable_cache_init();
 	debug_objects_mem_init();
 	vmalloc_init();
 	/* If no deferred init page_ext now, as vmap is fully initialized */