All of lore.kernel.org
 help / color / mirror / Atom feed
* + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch
@ 2022-06-03 18:32 Andrew Morton
  2022-06-03 18:44 ` Matthew Wilcox
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2022-06-03 18:32 UTC (permalink / raw)
  To: mm-commits, willy, andriy.shevchenko, akpm


The patch titled
     Subject: include/linux/xarray.h: replace kernel.h with the necessary inclusions
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     xarray-replace-kernelh-with-the-necessary-inclusions.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/xarray-replace-kernelh-with-the-necessary-inclusions.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: include/linux/xarray.h: replace kernel.h with the necessary inclusions
Date: Fri, 3 Jun 2022 20:11:53 +0300

When kernel.h is used in the headers it adds a lot into dependency hell,
especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Link: https://lkml.kernel.org/r/20220603171153.48928-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/xarray.h |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/include/linux/xarray.h~xarray-replace-kernelh-with-the-necessary-inclusions
+++ a/include/linux/xarray.h
@@ -12,13 +12,18 @@
 #include <linux/bitmap.h>
 #include <linux/bug.h>
 #include <linux/compiler.h>
+#include <linux/err.h>
 #include <linux/gfp.h>
 #include <linux/kconfig.h>
-#include <linux/kernel.h>
+#include <linux/limits.h>
+#include <linux/lockdep.h>
+#include <linux/math.h>
 #include <linux/rcupdate.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
 
+#include <asm/bitsperlong.h>
+
 /*
  * The bottom two bits of the entry determine how the XArray interprets
  * the contents:
_

Patches currently in -mm which might be from andriy.shevchenko@linux.intel.com are

rbtree-replace-kernelh-with-the-necessary-inclusions.patch
xarray-replace-kernelh-with-the-necessary-inclusions.patch
kernelh-move-sysfs-related-macro-to-sysfsh.patch


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

* Re: + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch
  2022-06-03 18:32 + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch Andrew Morton
@ 2022-06-03 18:44 ` Matthew Wilcox
  2022-06-03 18:47   ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2022-06-03 18:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, andriy.shevchenko

On Fri, Jun 03, 2022 at 11:32:30AM -0700, Andrew Morton wrote:
> ------------------------------------------------------
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Subject: include/linux/xarray.h: replace kernel.h with the necessary inclusions
> Date: Fri, 3 Jun 2022 20:11:53 +0300
> 
> When kernel.h is used in the headers it adds a lot into dependency hell,
> especially when there are circular dependencies are involved.
> 
> Replace kernel.h inclusion with the list of what is really being used.
> 
> Link: https://lkml.kernel.org/r/20220603171153.48928-1-andriy.shevchenko@linux.intel.com
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

NAK, breaks the test suite.

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

* Re: + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch
  2022-06-03 18:44 ` Matthew Wilcox
@ 2022-06-03 18:47   ` Andrew Morton
  2022-06-03 18:48     ` Matthew Wilcox
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2022-06-03 18:47 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: mm-commits, andriy.shevchenko

On Fri, 3 Jun 2022 19:44:49 +0100 Matthew Wilcox <willy@infradead.org> wrote:

> On Fri, Jun 03, 2022 at 11:32:30AM -0700, Andrew Morton wrote:
> > ------------------------------------------------------
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Subject: include/linux/xarray.h: replace kernel.h with the necessary inclusions
> > Date: Fri, 3 Jun 2022 20:11:53 +0300
> > 
> > When kernel.h is used in the headers it adds a lot into dependency hell,
> > especially when there are circular dependencies are involved.
> > 
> > Replace kernel.h inclusion with the list of what is really being used.
> > 
> > Link: https://lkml.kernel.org/r/20220603171153.48928-1-andriy.shevchenko@linux.intel.com
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Cc: Matthew Wilcox <willy@infradead.org>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> NAK, breaks the test suite.

The test suite compiled OK for me?

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

* Re: + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch
  2022-06-03 18:47   ` Andrew Morton
@ 2022-06-03 18:48     ` Matthew Wilcox
  2022-06-03 19:42       ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2022-06-03 18:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, andriy.shevchenko

On Fri, Jun 03, 2022 at 11:47:12AM -0700, Andrew Morton wrote:
> On Fri, 3 Jun 2022 19:44:49 +0100 Matthew Wilcox <willy@infradead.org> wrote:
> 
> > On Fri, Jun 03, 2022 at 11:32:30AM -0700, Andrew Morton wrote:
> > > ------------------------------------------------------
> > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Subject: include/linux/xarray.h: replace kernel.h with the necessary inclusions
> > > Date: Fri, 3 Jun 2022 20:11:53 +0300
> > > 
> > > When kernel.h is used in the headers it adds a lot into dependency hell,
> > > especially when there are circular dependencies are involved.
> > > 
> > > Replace kernel.h inclusion with the list of what is really being used.
> > > 
> > > Link: https://lkml.kernel.org/r/20220603171153.48928-1-andriy.shevchenko@linux.intel.com
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Cc: Matthew Wilcox <willy@infradead.org>
> > > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > 
> > NAK, breaks the test suite.
> 
> The test suite compiled OK for me?

I don't see a limits.h in tools/ ?

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

* Re: + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch
  2022-06-03 18:48     ` Matthew Wilcox
@ 2022-06-03 19:42       ` Andrew Morton
  2022-06-08 18:21         ` Matthew Wilcox
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2022-06-03 19:42 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: mm-commits, andriy.shevchenko

On Fri, 3 Jun 2022 19:48:57 +0100 Matthew Wilcox <willy@infradead.org> wrote:

> On Fri, Jun 03, 2022 at 11:47:12AM -0700, Andrew Morton wrote:
> > On Fri, 3 Jun 2022 19:44:49 +0100 Matthew Wilcox <willy@infradead.org> wrote:
> > 
> > > On Fri, Jun 03, 2022 at 11:32:30AM -0700, Andrew Morton wrote:
> > > > ------------------------------------------------------
> > > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > Subject: include/linux/xarray.h: replace kernel.h with the necessary inclusions
> > > > Date: Fri, 3 Jun 2022 20:11:53 +0300
> > > > 
> > > > When kernel.h is used in the headers it adds a lot into dependency hell,
> > > > especially when there are circular dependencies are involved.
> > > > 
> > > > Replace kernel.h inclusion with the list of what is really being used.
> > > > 
> > > > Link: https://lkml.kernel.org/r/20220603171153.48928-1-andriy.shevchenko@linux.intel.com
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > Cc: Matthew Wilcox <willy@infradead.org>
> > > > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > > 
> > > NAK, breaks the test suite.
> > 
> > The test suite compiled OK for me?
> 
> I don't see a limits.h in tools/ ?

It works, but I'm not sure why.

cc -H says:

.... ./linux/xarray.h
..... ./generated/map-shift.h
..... ./linux/../../../../include/linux/xarray.h
...... ../../include/linux/bitmap.h
....... ../../include/linux/find.h
...... ./linux/bug.h
....... ../../include/asm/bug.h
...... ./linux/kconfig.h
....... ./linux/../../../../include/linux/kconfig.h
........ ./generated/autoconf.h
.... ./linux/local_lock.h
. ../../../lib/xarray.c
.. ../../include/linux/export.h
.. ../../include/linux/slab.h
.. ./linux/xarray.h

xarray.h has

#include <linux/bitmap.h>
#include <linux/bug.h>
#include <linux/compiler.h>
#include <linux/err.h>
#include <linux/gfp.h>
#include <linux/kconfig.h>
#include <linux/limits.h>
#include <linux/lockdep.h>
#include <linux/math.h>
#include <linux/rcupdate.h>
#include <linux/spinlock.h>
#include <linux/types.h>

Perhaps some magic happened with cpp's recognition of include guards?

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

* Re: + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch
  2022-06-03 19:42       ` Andrew Morton
@ 2022-06-08 18:21         ` Matthew Wilcox
  2022-06-08 18:59           ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2022-06-08 18:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, andriy.shevchenko

On Fri, Jun 03, 2022 at 12:42:05PM -0700, Andrew Morton wrote:
> On Fri, 3 Jun 2022 19:48:57 +0100 Matthew Wilcox <willy@infradead.org> wrote:
> 
> > On Fri, Jun 03, 2022 at 11:47:12AM -0700, Andrew Morton wrote:
> > > On Fri, 3 Jun 2022 19:44:49 +0100 Matthew Wilcox <willy@infradead.org> wrote:
> > > 
> > > > On Fri, Jun 03, 2022 at 11:32:30AM -0700, Andrew Morton wrote:
> > > > > ------------------------------------------------------
> > > > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > > Subject: include/linux/xarray.h: replace kernel.h with the necessary inclusions
> > > > > Date: Fri, 3 Jun 2022 20:11:53 +0300
> > > > > 
> > > > > When kernel.h is used in the headers it adds a lot into dependency hell,
> > > > > especially when there are circular dependencies are involved.
> > > > > 
> > > > > Replace kernel.h inclusion with the list of what is really being used.
> > > > > 
> > > > > Link: https://lkml.kernel.org/r/20220603171153.48928-1-andriy.shevchenko@linux.intel.com
> > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > > Cc: Matthew Wilcox <willy@infradead.org>
> > > > > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > > > 
> > > > NAK, breaks the test suite.
> > > 
> > > The test suite compiled OK for me?
> > 
> > I don't see a limits.h in tools/ ?
> 
> It works, but I'm not sure why.
> 
> cc -H says:
> 
> .... ./linux/xarray.h
> ..... ./generated/map-shift.h
> ..... ./linux/../../../../include/linux/xarray.h
> ...... ../../include/linux/bitmap.h
> ....... ../../include/linux/find.h
> ...... ./linux/bug.h
> ....... ../../include/asm/bug.h
> ...... ./linux/kconfig.h
> ....... ./linux/../../../../include/linux/kconfig.h
> ........ ./generated/autoconf.h
> .... ./linux/local_lock.h
> . ../../../lib/xarray.c
> .. ../../include/linux/export.h
> .. ../../include/linux/slab.h
> .. ./linux/xarray.h
> 
> xarray.h has
> 
> #include <linux/bitmap.h>
> #include <linux/bug.h>
> #include <linux/compiler.h>
> #include <linux/err.h>
> #include <linux/gfp.h>
> #include <linux/kconfig.h>
> #include <linux/limits.h>
> #include <linux/lockdep.h>
> #include <linux/math.h>
> #include <linux/rcupdate.h>
> #include <linux/spinlock.h>
> #include <linux/types.h>
> 
> Perhaps some magic happened with cpp's recognition of include guards?

I had some time to look at this now.  It's picking up
/usr/include/linux/limits.h on my machine which is provided by
linux-libc-dev.  That's a rather different set of constants from the ones
the kernel provides internally, which might cause problems later.  But I'm
not in a mood to go poking around the different locations that different
environments provide things in, so I think this patch is OK.

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

* Re: + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch
  2022-06-08 18:21         ` Matthew Wilcox
@ 2022-06-08 18:59           ` Andrew Morton
  2022-06-09 16:01             ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2022-06-08 18:59 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: mm-commits, andriy.shevchenko

On Wed, 8 Jun 2022 19:21:05 +0100 Matthew Wilcox <willy@infradead.org> wrote:

> > Perhaps some magic happened with cpp's recognition of include guards?
> 
> I had some time to look at this now.  It's picking up
> /usr/include/linux/limits.h on my machine which is provided by
> linux-libc-dev.  That's a rather different set of constants from the ones
> the kernel provides internally, which might cause problems later.  But I'm
> not in a mood to go poking around the different locations that different
> environments provide things in, so I think this patch is OK.

Thanks.

I don't think it's good to be replacing our limits.h with some random
system-provided one.  I'll drop the patch.


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

* Re: + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch
  2022-06-08 18:59           ` Andrew Morton
@ 2022-06-09 16:01             ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2022-06-09 16:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Matthew Wilcox, mm-commits

On Wed, Jun 08, 2022 at 11:59:32AM -0700, Andrew Morton wrote:
> On Wed, 8 Jun 2022 19:21:05 +0100 Matthew Wilcox <willy@infradead.org> wrote:
> 
> > > Perhaps some magic happened with cpp's recognition of include guards?
> > 
> > I had some time to look at this now.  It's picking up
> > /usr/include/linux/limits.h on my machine which is provided by
> > linux-libc-dev.  That's a rather different set of constants from the ones
> > the kernel provides internally, which might cause problems later.  But I'm
> > not in a mood to go poking around the different locations that different
> > environments provide things in, so I think this patch is OK.
> 
> Thanks.
> 
> I don't think it's good to be replacing our limits.h with some random
> system-provided one.  I'll drop the patch.

It's fine. Perhaps we will add a limits.h to the tools. I have to remember this
somewhere.

Thanks, Matthew, for the investigation and finding a root cause.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2022-06-09 16:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 18:32 + xarray-replace-kernelh-with-the-necessary-inclusions.patch added to mm-nonmm-unstable branch Andrew Morton
2022-06-03 18:44 ` Matthew Wilcox
2022-06-03 18:47   ` Andrew Morton
2022-06-03 18:48     ` Matthew Wilcox
2022-06-03 19:42       ` Andrew Morton
2022-06-08 18:21         ` Matthew Wilcox
2022-06-08 18:59           ` Andrew Morton
2022-06-09 16:01             ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.