diff mbox series

cpu-hotplug: provide prototypes for arch CPU registration

Message ID E1qkoRr-0088Q8-Da@rmk-PC.armlinux.org.uk
State New
Headers show
Series cpu-hotplug: provide prototypes for arch CPU registration | expand

Commit Message

Russell King (Oracle) Sept. 25, 2023, 4:28 p.m. UTC
Provide common prototypes for arch_register_cpu() and
arch_unregister_cpu(). These are called by acpi_processor.c, with
weak versions, so the prototype for this is already set. It is
generally not necessary for function prototypes to be conditional
on preprocessor macros.

Some architectures (e.g. Loongarch) are missing the prototype for this,
and rather than add it to Loongarch's asm/cpu.h, lets do the job once
for everyone.

Since this covers everyone, remove the now unnecessary prototypes in
asm/cpu.h, and we also need to remove the 'static' from one of ia64's
arch_register_cpu() definitions.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
Changes since RFC v2:
 - drop ia64 changes, as ia64 has already been removed.

 arch/x86/include/asm/cpu.h  | 2 --
 arch/x86/kernel/topology.c  | 2 +-
 include/linux/cpu.h         | 2 ++
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Gavin Shan Sept. 25, 2023, 11:04 p.m. UTC | #1
Hi Russell,

On 9/26/23 02:28, Russell King (Oracle) wrote:
> Provide common prototypes for arch_register_cpu() and
> arch_unregister_cpu(). These are called by acpi_processor.c, with
> weak versions, so the prototype for this is already set. It is
> generally not necessary for function prototypes to be conditional
> on preprocessor macros.
> 
> Some architectures (e.g. Loongarch) are missing the prototype for this,
> and rather than add it to Loongarch's asm/cpu.h, lets do the job once
> for everyone.
> 
> Since this covers everyone, remove the now unnecessary prototypes in
> asm/cpu.h, and we also need to remove the 'static' from one of ia64's
> arch_register_cpu() definitions.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> Changes since RFC v2:
>   - drop ia64 changes, as ia64 has already been removed.
> 
>   arch/x86/include/asm/cpu.h  | 2 --
>   arch/x86/kernel/topology.c  | 2 +-
>   include/linux/cpu.h         | 2 ++
>   3 files changed, 3 insertions(+), 3 deletions(-)
> 

In Linux 6.6.rc3, the prototypes are still existing in arch/ia64/include/asm/cpu.h.
They may have been dropped in other ia64 or x86 git repository, which this patch
bases on.

In the commit message, 'static' from one of ia64's arch_register_cpu() definitions
is removed, but there is no changes related to ia64 in this patch. I guess that's
probably x86?

> diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
> index 3a233ebff712..25050d953eee 100644
> --- a/arch/x86/include/asm/cpu.h
> +++ b/arch/x86/include/asm/cpu.h
> @@ -28,8 +28,6 @@ struct x86_cpu {
>   };
>   
>   #ifdef CONFIG_HOTPLUG_CPU
> -extern int arch_register_cpu(int num);
> -extern void arch_unregister_cpu(int);
>   extern void soft_restart_cpu(void);
>   #endif
>   
> diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
> index ca004e2e4469..0bab03130033 100644
> --- a/arch/x86/kernel/topology.c
> +++ b/arch/x86/kernel/topology.c
> @@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
>   EXPORT_SYMBOL(arch_unregister_cpu);
>   #else /* CONFIG_HOTPLUG_CPU */
>   
> -static int __init arch_register_cpu(int num)
> +int __init arch_register_cpu(int num)
>   {
>   	return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
>   }

I think arch/ia64/kernel/topology.c may need same change, as stated in the commit log.
In linux 6.6.rc3, 'static' exists in arch/ia64/kernel/topology.c::arch_register_cpu().
Again, your patch may have been based on other git repository.

> diff --git a/include/linux/cpu.h b/include/linux/cpu.h
> index 0abd60a7987b..eb768a866fe3 100644
> --- a/include/linux/cpu.h
> +++ b/include/linux/cpu.h
> @@ -80,6 +80,8 @@ extern __printf(4, 5)
>   struct device *cpu_device_create(struct device *parent, void *drvdata,
>   				 const struct attribute_group **groups,
>   				 const char *fmt, ...);
> +extern int arch_register_cpu(int cpu);
> +extern void arch_unregister_cpu(int cpu);
>   #ifdef CONFIG_HOTPLUG_CPU
>   extern void unregister_cpu(struct cpu *cpu);
>   extern ssize_t arch_cpu_probe(const char *, size_t);

Thanks,
Gavin
Russell King (Oracle) Sept. 25, 2023, 11:17 p.m. UTC | #2
On Tue, Sep 26, 2023 at 09:04:46AM +1000, Gavin Shan wrote:
> Hi Russell,
> 
> On 9/26/23 02:28, Russell King (Oracle) wrote:
> > Provide common prototypes for arch_register_cpu() and
> > arch_unregister_cpu(). These are called by acpi_processor.c, with
> > weak versions, so the prototype for this is already set. It is
> > generally not necessary for function prototypes to be conditional
> > on preprocessor macros.
> > 
> > Some architectures (e.g. Loongarch) are missing the prototype for this,
> > and rather than add it to Loongarch's asm/cpu.h, lets do the job once
> > for everyone.
> > 
> > Since this covers everyone, remove the now unnecessary prototypes in
> > asm/cpu.h, and we also need to remove the 'static' from one of ia64's
> > arch_register_cpu() definitions.
> > 
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > ---
> > Changes since RFC v2:
> >   - drop ia64 changes, as ia64 has already been removed.
> > 
> >   arch/x86/include/asm/cpu.h  | 2 --
> >   arch/x86/kernel/topology.c  | 2 +-
> >   include/linux/cpu.h         | 2 ++
> >   3 files changed, 3 insertions(+), 3 deletions(-)
> > 
> 
> In Linux 6.6.rc3, the prototypes are still existing in arch/ia64/include/asm/cpu.h.

Correct, but I have been told that IA64 has been removed, so I removed
those changes from my patch.

> They may have been dropped in other ia64 or x86 git repository, which this patch
> bases on.

I have no idea which repository they have been dropped from. I only know
what tglx told me, and despite asking the question, I never got any
answer. So I've done the best I can with this patch. If kernel devs want
to state things in vague terms, and then go silent when asked questions
to elaborate, then that leads to guessing.

Maybe someone else should adapt this patch to apply to whatever tree it
is going to end up being applied to - because I have no idea _which_
tree it'll end up being applied to.
Russell King (Oracle) Oct. 3, 2023, 2:34 p.m. UTC | #3
On Tue, Sep 26, 2023 at 12:17:19AM +0100, Russell King (Oracle) wrote:
> On Tue, Sep 26, 2023 at 09:04:46AM +1000, Gavin Shan wrote:
> > Hi Russell,
> > 
> > On 9/26/23 02:28, Russell King (Oracle) wrote:
> > > Provide common prototypes for arch_register_cpu() and
> > > arch_unregister_cpu(). These are called by acpi_processor.c, with
> > > weak versions, so the prototype for this is already set. It is
> > > generally not necessary for function prototypes to be conditional
> > > on preprocessor macros.
> > > 
> > > Some architectures (e.g. Loongarch) are missing the prototype for this,
> > > and rather than add it to Loongarch's asm/cpu.h, lets do the job once
> > > for everyone.
> > > 
> > > Since this covers everyone, remove the now unnecessary prototypes in
> > > asm/cpu.h, and we also need to remove the 'static' from one of ia64's
> > > arch_register_cpu() definitions.
> > > 
> > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > > ---
> > > Changes since RFC v2:
> > >   - drop ia64 changes, as ia64 has already been removed.
> > > 
> > >   arch/x86/include/asm/cpu.h  | 2 --
> > >   arch/x86/kernel/topology.c  | 2 +-
> > >   include/linux/cpu.h         | 2 ++
> > >   3 files changed, 3 insertions(+), 3 deletions(-)
> > > 
> > 
> > In Linux 6.6.rc3, the prototypes are still existing in arch/ia64/include/asm/cpu.h.
> 
> Correct, but I have been told that IA64 has been removed, so I removed
> those changes from my patch.
> 
> > They may have been dropped in other ia64 or x86 git repository, which this patch
> > bases on.
> 
> I have no idea which repository they have been dropped from. I only know
> what tglx told me, and despite asking the question, I never got any
> answer. So I've done the best I can with this patch. If kernel devs want
> to state things in vague terms, and then go silent when asked questions
> to elaborate, then that leads to guessing.
> 
> Maybe someone else should adapt this patch to apply to whatever tree it
> is going to end up being applied to - because I have no idea _which_
> tree it'll end up being applied to.

So, is this how the Linux community is now dysfunctional?

Someone sends a patch.
Thomas reviews, says it's a good idea and provides some feedback.
Author asks questions, gets ignored.
Author sends a patch taking in to account that previous feedback.
Someone else replies, contradicting the previous feedback.
Nothing else happens.

What a bloody sorry state of affairs.

Makes me wonder what the point of trying to contribute to the Linux
kernel outside of the areas I actually maintain anymore is.
Xin Li Oct. 3, 2023, 5:37 p.m. UTC | #4
On 10/3/2023 7:34 AM, Russell King (Oracle) wrote:
>>>>
>>>> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
>>>> ---
>>>> Changes since RFC v2:
>>>>    - drop ia64 changes, as ia64 has already been removed.
>>>>

If this is RFC v2, we put "RFC v2" in the subject, then people know you
are sending a newer version.  People are busy, and your patch could be 
skipped if it appears the same as a previous one.
Russell King (Oracle) Oct. 3, 2023, 6:09 p.m. UTC | #5
On Tue, Oct 03, 2023 at 10:37:02AM -0700, Xin Li wrote:
> On 10/3/2023 7:34 AM, Russell King (Oracle) wrote:
> > > > > 
> > > > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > > > > ---
> > > > > Changes since RFC v2:
> > > > >    - drop ia64 changes, as ia64 has already been removed.
> > > > > 
> 
> If this is RFC v2, we put "RFC v2" in the subject, then people know you
> are sending a newer version.

Sorry, but this is yet another illustration why the kernel process is
broken. Clearly, people do NOT bother reading what is actually written,
but instead make up in their minds something completely different.

This is *NOT* RFC v2. This is RFC v2:

https://lore.kernel.org/all/E1qgnh2-007ZRZ-WD@rmk-PC.armlinux.org.uk/

And what I wrote was "changes **** SINCE **** RFC v2". For those who
find English difficult, this means that what follows is the list of
changes that are in THIS posting that WERE NOT IN THE PREVIOUS POSTING
which was RFC v2.

Thanks for making me even more frustrated than I was.

> People are busy, and your patch could be
> skipped if it appears the same as a previous one.

Yet another reason why the kernel process is just completely broken.
"appears to be". Even when the changes are spelled out. Yes, right,
people don't have time to read. If that's the case, then it's a
waste of time adding a change log. It's a waste of time to add a
commit message. In fact, it's a total waste of time trying to
contribute to a rotten-to-the-core open source project that Linux
seems to have turned into.
Russell King (Oracle) Oct. 10, 2023, 4:23 p.m. UTC | #6
Okay, I give up. 15 days, still no real progress. I don't see any point
in submitting any further patches for the kernel outside of those areas
that I maintain. Clearly no one cares enough to bother (a) properly
reviewing the patch, (b) applying the patch that Thomas thought
"makes tons of sense."

If patches that "makes tons of sense" just get ignored, then what does
the future of the kernel hold? Crap, that's what, utter crap.

As I said, it seems that the Linux kernel process is basically totally
broken and rotten. If a six line patch that "makes tons of sense" can't
be applied, then there's basically no hope what so ever.

FFS.

On Mon, Sep 25, 2023 at 05:28:39PM +0100, Russell King (Oracle) wrote:
> Provide common prototypes for arch_register_cpu() and
> arch_unregister_cpu(). These are called by acpi_processor.c, with
> weak versions, so the prototype for this is already set. It is
> generally not necessary for function prototypes to be conditional
> on preprocessor macros.
> 
> Some architectures (e.g. Loongarch) are missing the prototype for this,
> and rather than add it to Loongarch's asm/cpu.h, lets do the job once
> for everyone.
> 
> Since this covers everyone, remove the now unnecessary prototypes in
> asm/cpu.h, and we also need to remove the 'static' from one of ia64's
> arch_register_cpu() definitions.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> Changes since RFC v2:
>  - drop ia64 changes, as ia64 has already been removed.
> 
>  arch/x86/include/asm/cpu.h  | 2 --
>  arch/x86/kernel/topology.c  | 2 +-
>  include/linux/cpu.h         | 2 ++
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
> index 3a233ebff712..25050d953eee 100644
> --- a/arch/x86/include/asm/cpu.h
> +++ b/arch/x86/include/asm/cpu.h
> @@ -28,8 +28,6 @@ struct x86_cpu {
>  };
>  
>  #ifdef CONFIG_HOTPLUG_CPU
> -extern int arch_register_cpu(int num);
> -extern void arch_unregister_cpu(int);
>  extern void soft_restart_cpu(void);
>  #endif
>  
> diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
> index ca004e2e4469..0bab03130033 100644
> --- a/arch/x86/kernel/topology.c
> +++ b/arch/x86/kernel/topology.c
> @@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
>  EXPORT_SYMBOL(arch_unregister_cpu);
>  #else /* CONFIG_HOTPLUG_CPU */
>  
> -static int __init arch_register_cpu(int num)
> +int __init arch_register_cpu(int num)
>  {
>  	return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
>  }
> diff --git a/include/linux/cpu.h b/include/linux/cpu.h
> index 0abd60a7987b..eb768a866fe3 100644
> --- a/include/linux/cpu.h
> +++ b/include/linux/cpu.h
> @@ -80,6 +80,8 @@ extern __printf(4, 5)
>  struct device *cpu_device_create(struct device *parent, void *drvdata,
>  				 const struct attribute_group **groups,
>  				 const char *fmt, ...);
> +extern int arch_register_cpu(int cpu);
> +extern void arch_unregister_cpu(int cpu);
>  #ifdef CONFIG_HOTPLUG_CPU
>  extern void unregister_cpu(struct cpu *cpu);
>  extern ssize_t arch_cpu_probe(const char *, size_t);
> -- 
> 2.30.2
> 
>
Thomas Gleixner Oct. 11, 2023, 12:06 p.m. UTC | #7
On Tue, Oct 10 2023 at 17:23, Russell King wrote:
> Okay, I give up. 15 days, still no real progress. I don't see any point
> in submitting any further patches for the kernel outside of those areas
> that I maintain. Clearly no one cares enough to bother (a) properly
> reviewing the patch, (b) applying the patch that Thomas thought
> "makes tons of sense."
>
> If patches that "makes tons of sense" just get ignored, then what does
> the future of the kernel hold? Crap, that's what, utter crap.
>
> As I said, it seems that the Linux kernel process is basically totally
> broken and rotten. If a six line patch that "makes tons of sense" can't
> be applied, then there's basically no hope what so ever.

Oh well. I usually try to keep track of such stuff, but this one fell
through the cracks.

Shit happens and we are all human, no?

Sorry for the wrong information about ia64. The removal did not happen
because someone stepped up as a possible maintainer.

Thanks,

        tglx
Tomáš Glozar Oct. 11, 2023, 1:08 p.m. UTC | #8
Hello Thomas,

st 11. 10. 2023 v 14:06 odesílatel Thomas Gleixner <tglx@linutronix.de> napsal:
>
> Sorry for the wrong information about ia64. The removal did not happen
> because someone stepped up as a possible maintainer.
>

Does that mean that the removal patch will be reverted soon in
asm-generic and linux-next? Both have no ia64 as of now, and there are
already a few patches without ia64 part (e,g,
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git/commit/?id=2fd0ebad27bcd4c8fc61c61a98d4283c47054bcf).
Without the revert, patches affecting ia64 will conflict.

I am the person who volunteered to maintain the architecture. If the
removal was indeed cancelled, me and Frank Scheiner can start testing
and reviewing patches affecting ia64.

Thanks,

Tomas
diff mbox series

Patch

diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index 3a233ebff712..25050d953eee 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -28,8 +28,6 @@  struct x86_cpu {
 };
 
 #ifdef CONFIG_HOTPLUG_CPU
-extern int arch_register_cpu(int num);
-extern void arch_unregister_cpu(int);
 extern void soft_restart_cpu(void);
 #endif
 
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index ca004e2e4469..0bab03130033 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -54,7 +54,7 @@  void arch_unregister_cpu(int num)
 EXPORT_SYMBOL(arch_unregister_cpu);
 #else /* CONFIG_HOTPLUG_CPU */
 
-static int __init arch_register_cpu(int num)
+int __init arch_register_cpu(int num)
 {
 	return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
 }
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0abd60a7987b..eb768a866fe3 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -80,6 +80,8 @@  extern __printf(4, 5)
 struct device *cpu_device_create(struct device *parent, void *drvdata,
 				 const struct attribute_group **groups,
 				 const char *fmt, ...);
+extern int arch_register_cpu(int cpu);
+extern void arch_unregister_cpu(int cpu);
 #ifdef CONFIG_HOTPLUG_CPU
 extern void unregister_cpu(struct cpu *cpu);
 extern ssize_t arch_cpu_probe(const char *, size_t);