* [rft, PATCH v1 1/1] cpumask: Don't use "proxy" headers
@ 2025-11-24 20:39 Andy Shevchenko
2025-11-24 21:17 ` Yury Norov
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-11-24 20:39 UTC (permalink / raw)
To: Thomas Huth, Yury Norov [NVIDIA], linux-kernel
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Rasmus Villemoes, Andy Shevchenko
Update header inclusions to follow IWYU (Include What You Use)
principle.
Note that kernel.h is discouraged to be included as it's written
at the top of that file.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
Not fully compile tested, might give some compilation errors
arch/x86/include/asm/cpumask.h | 2 ++
include/linux/cpumask.h | 12 +++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/cpumask.h b/arch/x86/include/asm/cpumask.h
index 70f6b60ad67b..9df9e9cde670 100644
--- a/arch/x86/include/asm/cpumask.h
+++ b/arch/x86/include/asm/cpumask.h
@@ -2,6 +2,8 @@
#ifndef _ASM_X86_CPUMASK_H
#define _ASM_X86_CPUMASK_H
#ifndef __ASSEMBLER__
+
+#include <linux/compiler.h>
#include <linux/cpumask.h>
extern void setup_cpu_local_masks(void);
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 66694ee8d86e..6abf3d7e9435 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -7,14 +7,16 @@
* set of CPUs in a system, one bit position per CPU number. In general,
* only nr_cpu_ids (<= NR_CPUS) bits are valid.
*/
-#include <linux/cleanup.h>
-#include <linux/kernel.h>
-#include <linux/bitmap.h>
-#include <linux/cpumask_types.h>
#include <linux/atomic.h>
-#include <linux/bug.h>
+#include <linux/bitmap.h>
+#include <linux/cleanup.h>
+#include <linux/cpumask_types.h>
#include <linux/gfp_types.h>
#include <linux/numa.h>
+#include <linux/threads.h>
+#include <linux/types.h>
+
+#include <asm/bug.h>
/**
* cpumask_pr_args - printf args to output a cpumask
--
2.50.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [rft, PATCH v1 1/1] cpumask: Don't use "proxy" headers
2025-11-24 20:39 [rft, PATCH v1 1/1] cpumask: Don't use "proxy" headers Andy Shevchenko
@ 2025-11-24 21:17 ` Yury Norov
2025-11-24 22:42 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: Yury Norov @ 2025-11-24 21:17 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Huth, linux-kernel, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Rasmus Villemoes
On Mon, Nov 24, 2025 at 09:39:59PM +0100, Andy Shevchenko wrote:
> Update header inclusions to follow IWYU (Include What You Use)
> principle.
>
> Note that kernel.h is discouraged to be included as it's written
> at the top of that file.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>
> Not fully compile tested, might give some compilation errors
>
> arch/x86/include/asm/cpumask.h | 2 ++
> include/linux/cpumask.h | 12 +++++++-----
> 2 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/include/asm/cpumask.h b/arch/x86/include/asm/cpumask.h
> index 70f6b60ad67b..9df9e9cde670 100644
> --- a/arch/x86/include/asm/cpumask.h
> +++ b/arch/x86/include/asm/cpumask.h
> @@ -2,6 +2,8 @@
> #ifndef _ASM_X86_CPUMASK_H
> #define _ASM_X86_CPUMASK_H
> #ifndef __ASSEMBLER__
> +
> +#include <linux/compiler.h>
> #include <linux/cpumask.h>
>
> extern void setup_cpu_local_masks(void);
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index 66694ee8d86e..6abf3d7e9435 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -7,14 +7,16 @@
> * set of CPUs in a system, one bit position per CPU number. In general,
> * only nr_cpu_ids (<= NR_CPUS) bits are valid.
> */
> -#include <linux/cleanup.h>
> -#include <linux/kernel.h>
I recall, removing kernel.h from cpumasks was a troublesome exercise
back then. But it may be my false memory.
Added this for testing in bitmap-for-next.
Thanks,
Yury
> -#include <linux/bitmap.h>
> -#include <linux/cpumask_types.h>
> #include <linux/atomic.h>
> -#include <linux/bug.h>
> +#include <linux/bitmap.h>
> +#include <linux/cleanup.h>
> +#include <linux/cpumask_types.h>
> #include <linux/gfp_types.h>
> #include <linux/numa.h>
> +#include <linux/threads.h>
> +#include <linux/types.h>
> +
> +#include <asm/bug.h>
>
> /**
> * cpumask_pr_args - printf args to output a cpumask
> --
> 2.50.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rft, PATCH v1 1/1] cpumask: Don't use "proxy" headers
2025-11-24 21:17 ` Yury Norov
@ 2025-11-24 22:42 ` Andy Shevchenko
2025-11-26 7:59 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-11-24 22:42 UTC (permalink / raw)
To: Yury Norov
Cc: Thomas Huth, linux-kernel, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Rasmus Villemoes
On Mon, Nov 24, 2025 at 04:17:51PM -0500, Yury Norov wrote:
> On Mon, Nov 24, 2025 at 09:39:59PM +0100, Andy Shevchenko wrote:
> > Not fully compile tested, might give some compilation errors
...
> > -#include <linux/cleanup.h>
> > -#include <linux/kernel.h>
>
> I recall, removing kernel.h from cpumasks was a troublesome exercise
> back then. But it may be my false memory.
Yeah, there are several headers that are too tangled together.
At least it builds on my configurations on x86_64.
> Added this for testing in bitmap-for-next.
Thanks, let's see how it will go. But note that it might fall the builds in
some cases.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rft, PATCH v1 1/1] cpumask: Don't use "proxy" headers
2025-11-24 22:42 ` Andy Shevchenko
@ 2025-11-26 7:59 ` Andy Shevchenko
2025-11-26 15:33 ` Yury Norov
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-11-26 7:59 UTC (permalink / raw)
To: Yury Norov
Cc: Thomas Huth, linux-kernel, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Rasmus Villemoes
On Tue, Nov 25, 2025 at 12:42:23AM +0200, Andy Shevchenko wrote:
> On Mon, Nov 24, 2025 at 04:17:51PM -0500, Yury Norov wrote:
> > On Mon, Nov 24, 2025 at 09:39:59PM +0100, Andy Shevchenko wrote:
>
> > > Not fully compile tested, might give some compilation errors
...
> > > -#include <linux/cleanup.h>
> > > -#include <linux/kernel.h>
> >
> > I recall, removing kernel.h from cpumasks was a troublesome exercise
> > back then. But it may be my false memory.
>
> Yeah, there are several headers that are too tangled together.
> At least it builds on my configurations on x86_64.
>
> > Added this for testing in bitmap-for-next.
>
> Thanks, let's see how it will go. But note that it might fall the builds in
> some cases.
So, we survived already a couple of Linux Next integration builds, I believe
we are quite okay with this change and if anything appears, it can be fixed
in a followups.
Thanks!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rft, PATCH v1 1/1] cpumask: Don't use "proxy" headers
2025-11-26 7:59 ` Andy Shevchenko
@ 2025-11-26 15:33 ` Yury Norov
0 siblings, 0 replies; 5+ messages in thread
From: Yury Norov @ 2025-11-26 15:33 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Huth, linux-kernel, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Rasmus Villemoes
On Wed, Nov 26, 2025 at 09:59:16AM +0200, Andy Shevchenko wrote:
> On Tue, Nov 25, 2025 at 12:42:23AM +0200, Andy Shevchenko wrote:
> > On Mon, Nov 24, 2025 at 04:17:51PM -0500, Yury Norov wrote:
> > > On Mon, Nov 24, 2025 at 09:39:59PM +0100, Andy Shevchenko wrote:
> >
> > > > Not fully compile tested, might give some compilation errors
>
> ...
>
> > > > -#include <linux/cleanup.h>
> > > > -#include <linux/kernel.h>
> > >
> > > I recall, removing kernel.h from cpumasks was a troublesome exercise
> > > back then. But it may be my false memory.
> >
> > Yeah, there are several headers that are too tangled together.
> > At least it builds on my configurations on x86_64.
> >
> > > Added this for testing in bitmap-for-next.
> >
> > Thanks, let's see how it will go. But note that it might fall the builds in
> > some cases.
>
> So, we survived already a couple of Linux Next integration builds, I believe
> we are quite okay with this change and if anything appears, it can be fixed
> in a followups.
Yeah. I'll just keep the patch in my branch, so hopefully it will land
in mainline in the next merge cycle.
Thanks,
Yury
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-11-26 15:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-24 20:39 [rft, PATCH v1 1/1] cpumask: Don't use "proxy" headers Andy Shevchenko
2025-11-24 21:17 ` Yury Norov
2025-11-24 22:42 ` Andy Shevchenko
2025-11-26 7:59 ` Andy Shevchenko
2025-11-26 15:33 ` Yury Norov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox