[05/20] cpu/hotplug: remove CPUHP_SLAB_PREPARE hooks

Message ID 20231113191340.17482-27-vbabka@suse.cz
State New
Headers
Series remove the SLAB allocator |

Commit Message

Vlastimil Babka Nov. 13, 2023, 7:13 p.m. UTC
  The CPUHP_SLAB_PREPARE hooks are only used by SLAB which is removed.
SLUB defines them as NULL, so we can remove those altogether.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 include/linux/slab.h | 8 --------
 kernel/cpu.c         | 5 -----
 2 files changed, 13 deletions(-)
  

Comments

Kees Cook Nov. 14, 2023, 4:20 a.m. UTC | #1
On Mon, Nov 13, 2023 at 08:13:46PM +0100, Vlastimil Babka wrote:
> The CPUHP_SLAB_PREPARE hooks are only used by SLAB which is removed.
> SLUB defines them as NULL, so we can remove those altogether.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> ---
>  include/linux/slab.h | 8 --------
>  kernel/cpu.c         | 5 -----
>  2 files changed, 13 deletions(-)
> 
> diff --git a/include/linux/slab.h b/include/linux/slab.h
> index d6d6ffeeb9a2..34e43cddc520 100644
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@ -788,12 +788,4 @@ size_t kmalloc_size_roundup(size_t size);
>  
>  void __init kmem_cache_init_late(void);
>  
> -#if defined(CONFIG_SMP) && defined(CONFIG_SLAB)
> -int slab_prepare_cpu(unsigned int cpu);
> -int slab_dead_cpu(unsigned int cpu);
> -#else
> -#define slab_prepare_cpu	NULL
> -#define slab_dead_cpu		NULL
> -#endif
> -
>  #endif	/* _LINUX_SLAB_H */
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 9e4c6780adde..530b026d95a1 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -2125,11 +2125,6 @@ static struct cpuhp_step cpuhp_hp_states[] = {
>  		.startup.single		= relay_prepare_cpu,
>  		.teardown.single	= NULL,
>  	},
> -	[CPUHP_SLAB_PREPARE] = {
> -		.name			= "slab:prepare",
> -		.startup.single		= slab_prepare_cpu,
> -		.teardown.single	= slab_dead_cpu,
> -	},
>  	[CPUHP_RCUTREE_PREP] = {
>  		.name			= "RCU/tree:prepare",
>  		.startup.single		= rcutree_prepare_cpu,

Should CPUHP_SLAB_PREPARE be removed from the enum too?
  
Vlastimil Babka Nov. 14, 2023, 8:12 p.m. UTC | #2
On 11/14/23 05:20, Kees Cook wrote:
> On Mon, Nov 13, 2023 at 08:13:46PM +0100, Vlastimil Babka wrote:
>> The CPUHP_SLAB_PREPARE hooks are only used by SLAB which is removed.
>> SLUB defines them as NULL, so we can remove those altogether.
>> 
>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
>> ---
>>  include/linux/slab.h | 8 --------
>>  kernel/cpu.c         | 5 -----
>>  2 files changed, 13 deletions(-)
>> 
>> diff --git a/include/linux/slab.h b/include/linux/slab.h
>> index d6d6ffeeb9a2..34e43cddc520 100644
>> --- a/include/linux/slab.h
>> +++ b/include/linux/slab.h
>> @@ -788,12 +788,4 @@ size_t kmalloc_size_roundup(size_t size);
>>  
>>  void __init kmem_cache_init_late(void);
>>  
>> -#if defined(CONFIG_SMP) && defined(CONFIG_SLAB)
>> -int slab_prepare_cpu(unsigned int cpu);
>> -int slab_dead_cpu(unsigned int cpu);
>> -#else
>> -#define slab_prepare_cpu	NULL
>> -#define slab_dead_cpu		NULL
>> -#endif
>> -
>>  #endif	/* _LINUX_SLAB_H */
>> diff --git a/kernel/cpu.c b/kernel/cpu.c
>> index 9e4c6780adde..530b026d95a1 100644
>> --- a/kernel/cpu.c
>> +++ b/kernel/cpu.c
>> @@ -2125,11 +2125,6 @@ static struct cpuhp_step cpuhp_hp_states[] = {
>>  		.startup.single		= relay_prepare_cpu,
>>  		.teardown.single	= NULL,
>>  	},
>> -	[CPUHP_SLAB_PREPARE] = {
>> -		.name			= "slab:prepare",
>> -		.startup.single		= slab_prepare_cpu,
>> -		.teardown.single	= slab_dead_cpu,
>> -	},
>>  	[CPUHP_RCUTREE_PREP] = {
>>  		.name			= "RCU/tree:prepare",
>>  		.startup.single		= rcutree_prepare_cpu,
> 
> Should CPUHP_SLAB_PREPARE be removed from the enum too?

Yep, will do, thanks!
  

Patch

diff --git a/include/linux/slab.h b/include/linux/slab.h
index d6d6ffeeb9a2..34e43cddc520 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -788,12 +788,4 @@  size_t kmalloc_size_roundup(size_t size);
 
 void __init kmem_cache_init_late(void);
 
-#if defined(CONFIG_SMP) && defined(CONFIG_SLAB)
-int slab_prepare_cpu(unsigned int cpu);
-int slab_dead_cpu(unsigned int cpu);
-#else
-#define slab_prepare_cpu	NULL
-#define slab_dead_cpu		NULL
-#endif
-
 #endif	/* _LINUX_SLAB_H */
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 9e4c6780adde..530b026d95a1 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -2125,11 +2125,6 @@  static struct cpuhp_step cpuhp_hp_states[] = {
 		.startup.single		= relay_prepare_cpu,
 		.teardown.single	= NULL,
 	},
-	[CPUHP_SLAB_PREPARE] = {
-		.name			= "slab:prepare",
-		.startup.single		= slab_prepare_cpu,
-		.teardown.single	= slab_dead_cpu,
-	},
 	[CPUHP_RCUTREE_PREP] = {
 		.name			= "RCU/tree:prepare",
 		.startup.single		= rcutree_prepare_cpu,