linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/slab: remove some unused functions
@ 2022-03-22  9:14 Miaohe Lin
  2022-04-01  6:16 ` Miaohe Lin
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Miaohe Lin @ 2022-03-22  9:14 UTC (permalink / raw)
  To: cl, penberg, rientjes, iamjoonsoo.kim, akpm, vbabka
  Cc: roman.gushchin, linux-mm, linux-kernel, linmiaohe

alternate_node_alloc and ____cache_alloc_node are always called when
CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also
forward declaration for alternate_node_alloc is unnecessary. Remove
it too.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/slab.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index d9dec7a8fd79..81301df47057 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -619,18 +619,6 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
 	return 0;
 }
 
-static inline void *alternate_node_alloc(struct kmem_cache *cachep,
-		gfp_t flags)
-{
-	return NULL;
-}
-
-static inline void *____cache_alloc_node(struct kmem_cache *cachep,
-		 gfp_t flags, int nodeid)
-{
-	return NULL;
-}
-
 static inline gfp_t gfp_exact_node(gfp_t flags)
 {
 	return flags & ~__GFP_NOFAIL;
@@ -639,7 +627,6 @@ static inline gfp_t gfp_exact_node(gfp_t flags)
 #else	/* CONFIG_NUMA */
 
 static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
-static void *alternate_node_alloc(struct kmem_cache *, gfp_t);
 
 static struct alien_cache *__alloc_alien_cache(int node, int entries,
 						int batch, gfp_t gfp)
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/slab: remove some unused functions
  2022-03-22  9:14 [PATCH] mm/slab: remove some unused functions Miaohe Lin
@ 2022-04-01  6:16 ` Miaohe Lin
  2022-04-01 10:29 ` David Hildenbrand
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Miaohe Lin @ 2022-04-01  6:16 UTC (permalink / raw)
  To: cl, penberg, rientjes, iamjoonsoo.kim, akpm, vbabka
  Cc: roman.gushchin, linux-mm, linux-kernel

On 2022/3/22 17:14, Miaohe Lin wrote:
> alternate_node_alloc and ____cache_alloc_node are always called when
> CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also
> forward declaration for alternate_node_alloc is unnecessary. Remove
> it too.
> 

friendly ping. :)

> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/slab.c | 13 -------------
>  1 file changed, 13 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index d9dec7a8fd79..81301df47057 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -619,18 +619,6 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
>  	return 0;
>  }
>  
> -static inline void *alternate_node_alloc(struct kmem_cache *cachep,
> -		gfp_t flags)
> -{
> -	return NULL;
> -}
> -
> -static inline void *____cache_alloc_node(struct kmem_cache *cachep,
> -		 gfp_t flags, int nodeid)
> -{
> -	return NULL;
> -}
> -
>  static inline gfp_t gfp_exact_node(gfp_t flags)
>  {
>  	return flags & ~__GFP_NOFAIL;
> @@ -639,7 +627,6 @@ static inline gfp_t gfp_exact_node(gfp_t flags)
>  #else	/* CONFIG_NUMA */
>  
>  static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
> -static void *alternate_node_alloc(struct kmem_cache *, gfp_t);
>  
>  static struct alien_cache *__alloc_alien_cache(int node, int entries,
>  						int batch, gfp_t gfp)
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/slab: remove some unused functions
  2022-03-22  9:14 [PATCH] mm/slab: remove some unused functions Miaohe Lin
  2022-04-01  6:16 ` Miaohe Lin
@ 2022-04-01 10:29 ` David Hildenbrand
  2022-04-04 12:49 ` Vlastimil Babka
  2022-04-04 19:10 ` Roman Gushchin
  3 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2022-04-01 10:29 UTC (permalink / raw)
  To: Miaohe Lin, cl, penberg, rientjes, iamjoonsoo.kim, akpm, vbabka
  Cc: roman.gushchin, linux-mm, linux-kernel

On 22.03.22 10:14, Miaohe Lin wrote:
> alternate_node_alloc and ____cache_alloc_node are always called when
> CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also
> forward declaration for alternate_node_alloc is unnecessary. Remove
> it too.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/slab.c | 13 -------------
>  1 file changed, 13 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index d9dec7a8fd79..81301df47057 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -619,18 +619,6 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
>  	return 0;
>  }
>  
> -static inline void *alternate_node_alloc(struct kmem_cache *cachep,
> -		gfp_t flags)
> -{
> -	return NULL;
> -}
> -
> -static inline void *____cache_alloc_node(struct kmem_cache *cachep,
> -		 gfp_t flags, int nodeid)
> -{
> -	return NULL;
> -}
> -
>  static inline gfp_t gfp_exact_node(gfp_t flags)
>  {
>  	return flags & ~__GFP_NOFAIL;
> @@ -639,7 +627,6 @@ static inline gfp_t gfp_exact_node(gfp_t flags)
>  #else	/* CONFIG_NUMA */
>  
>  static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
> -static void *alternate_node_alloc(struct kmem_cache *, gfp_t);
>  
>  static struct alien_cache *__alloc_alien_cache(int node, int entries,
>  						int batch, gfp_t gfp)

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/slab: remove some unused functions
  2022-03-22  9:14 [PATCH] mm/slab: remove some unused functions Miaohe Lin
  2022-04-01  6:16 ` Miaohe Lin
  2022-04-01 10:29 ` David Hildenbrand
@ 2022-04-04 12:49 ` Vlastimil Babka
  2022-04-06  2:38   ` Miaohe Lin
  2022-04-04 19:10 ` Roman Gushchin
  3 siblings, 1 reply; 6+ messages in thread
From: Vlastimil Babka @ 2022-04-04 12:49 UTC (permalink / raw)
  To: Miaohe Lin, cl, penberg, rientjes, iamjoonsoo.kim, akpm
  Cc: roman.gushchin, linux-mm, linux-kernel

On 3/22/22 10:14, Miaohe Lin wrote:
> alternate_node_alloc and ____cache_alloc_node are always called when
> CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also
> forward declaration for alternate_node_alloc is unnecessary. Remove
> it too.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---

Adding to the slab tree, thanks.

Included also this move of declaration closer to its users:

diff --git a/mm/slab.c b/mm/slab.c
index 4ea12ddaa7db..90b16c7ae01a 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -626,8 +626,6 @@ static inline gfp_t gfp_exact_node(gfp_t flags)
 
 #else  /* CONFIG_NUMA */
 
-static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
-
 static struct alien_cache *__alloc_alien_cache(int node, int entries,
                                                int batch, gfp_t gfp)
 {
@@ -3043,6 +3041,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
 }
 
 #ifdef CONFIG_NUMA
+static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
+
 /*
  * Try allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set.
  *


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/slab: remove some unused functions
  2022-03-22  9:14 [PATCH] mm/slab: remove some unused functions Miaohe Lin
                   ` (2 preceding siblings ...)
  2022-04-04 12:49 ` Vlastimil Babka
@ 2022-04-04 19:10 ` Roman Gushchin
  3 siblings, 0 replies; 6+ messages in thread
From: Roman Gushchin @ 2022-04-04 19:10 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: cl, penberg, rientjes, iamjoonsoo.kim, akpm, vbabka, linux-mm,
	linux-kernel

On Tue, Mar 22, 2022 at 05:14:21PM +0800, Miaohe Lin wrote:
> alternate_node_alloc and ____cache_alloc_node are always called when
> CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also
> forward declaration for alternate_node_alloc is unnecessary. Remove
> it too.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/slab: remove some unused functions
  2022-04-04 12:49 ` Vlastimil Babka
@ 2022-04-06  2:38   ` Miaohe Lin
  0 siblings, 0 replies; 6+ messages in thread
From: Miaohe Lin @ 2022-04-06  2:38 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: roman.gushchin, linux-mm, linux-kernel, cl, penberg, rientjes,
	iamjoonsoo.kim, akpm

On 2022/4/4 20:49, Vlastimil Babka wrote:
> On 3/22/22 10:14, Miaohe Lin wrote:
>> alternate_node_alloc and ____cache_alloc_node are always called when
>> CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also
>> forward declaration for alternate_node_alloc is unnecessary. Remove
>> it too.
>>
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>> ---
> 
> Adding to the slab tree, thanks.
> 
> Included also this move of declaration closer to its users:

Many thanks for doing this. :)

> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 4ea12ddaa7db..90b16c7ae01a 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -626,8 +626,6 @@ static inline gfp_t gfp_exact_node(gfp_t flags)
>  
>  #else  /* CONFIG_NUMA */
>  
> -static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
> -
>  static struct alien_cache *__alloc_alien_cache(int node, int entries,
>                                                 int batch, gfp_t gfp)
>  {
> @@ -3043,6 +3041,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
>  }
>  
>  #ifdef CONFIG_NUMA
> +static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
> +
>  /*
>   * Try allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set.
>   *
> 
> .
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-06 14:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22  9:14 [PATCH] mm/slab: remove some unused functions Miaohe Lin
2022-04-01  6:16 ` Miaohe Lin
2022-04-01 10:29 ` David Hildenbrand
2022-04-04 12:49 ` Vlastimil Babka
2022-04-06  2:38   ` Miaohe Lin
2022-04-04 19:10 ` Roman Gushchin

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).