public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency
@ 2024-09-05 12:17 Uros Bizjak
  2024-09-05 12:17 ` [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h> Uros Bizjak
  2024-09-05 12:40 ` [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Andy Shevchenko
  0 siblings, 2 replies; 8+ messages in thread
From: Uros Bizjak @ 2024-09-05 12:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uros Bizjak, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H. Peter Anvin, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Daniel Vetter, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Hans Verkuil,
	Mauro Carvalho Chehab, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Eric Biggers, Theodore Y. Ts'o,
	Jaegeuk Kim, Jason A. Donenfeld, Linus Torvalds, Hannes Reinecke,
	James E.J. Bottomley, Martin K. Petersen, Alexei Starovoitov,
	Daniel Borkmann, John Fastabend, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Andrew Morton,
	Brendan Higgins, David Gow, Rae Moar, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jiri Pirko,
	Petr Mladek, Steven Rostedt, Andy Shevchenko, Rasmus Villemoes,
	Sergey Senozhatsky, Stephen Hemminger, Jamal Hadi Salim,
	Cong Wang, Kent Overstreet, intel-gfx, dri-devel, linux-media,
	linux-mtd, linux-fscrypt, linux-scsi, bpf, linux-kselftest,
	kunit-dev

There were several attempts to resolve circular include dependency
after the addition of percpu.h: 1c9df907da83 ("random: fix circular
include dependency on arm64 after addition of percpu.h"), c0842fbc1b18
("random32: move the pseudo-random 32-bit definitions to prandom.h") and
finally d9f29deb7fe8 ("prandom: Remove unused include") that completely
removes inclusion of <linux/percpu.h>.

Due to legacy reasons, <linux/random.h> includes <linux/prandom.h>, but
with the commit entry remark:

--quote--
A further cleanup step would be to remove this from <linux/random.h>
entirely, and make people who use the prandom infrastructure include
just the new header file.  That's a bit of a churn patch, but grepping
for "prandom_" and "next_pseudo_random32" "struct rnd_state" should
catch most users.

But it turns out that that nice cleanup step is fairly painful, because
a _lot_ of code currently seems to depend on the implicit include of
<linux/random.h>, which can currently come in a lot of ways, including
such fairly core headfers as <linux/net.h>.

So the "nice cleanup" part may or may never happen.
--/quote--

__percpu tag is currently defined in include/linux/compiler_types.h,
so there is no direct need for the inclusion of <linux/percpu.h>.
However, in [1] we would like to repurpose __percpu tag as a named
address space qualifier, where __percpu macro uses defines from
<linux/percpu.h>.

This patch series is the "nice cleanup" part, and allows us to finally
include <linux/percpu.h> in prandom.h.

The whole series was tested by compiling the kernel for x86_64 allconfig
and some popular architectures, namely arm64 defconfig, powerpc defconfig
and loongarch defconfig.

[1] https://lore.kernel.org/lkml/20240812115945.484051-4-ubizjak@gmail.com/

Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: "Theodore Y. Ts'o" <tytso@mit.edu>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Hannes Reinecke <hare@suse.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Song Liu <song@kernel.org>
Cc: Yonghong Song <yonghong.song@linux.dev>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Stanislav Fomichev <sdf@fomichev.me>
Cc: Hao Luo <haoluo@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Rae Moar <rmoar@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Uros Bizjak <ubizjak@gmail.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linux-mtd@lists.infradead.org
Cc: linux-fscrypt@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Cc: bpf@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: kunit-dev@googlegroups.com

Uros Bizjak (18):
  x86/kaslr: Include <linux/prandom.h> instead of <linux/random.h>
  drm/i915/selftests: Include <linux/prandom.h> instead of
    <linux/random.h>
  drm/lib: Include <linux/prandom.h> instead of <linux/random.h>
  media: vivid: Include <linux/prandom.h> in vivid-vid-cap.c
  mtd: tests: Include <linux/prandom.h> instead of <linux/random.h>
  fscrypt: Include <linux/prandom.h> instead of <linux/random.h>
  scsi: libfcoe: Include <linux/prandom.h> instead of <linux/random.h>
  bpf: Include <linux/prandom.h> instead of <linux/random.h>
  lib/interval_tree_test.c: Include <linux/prandom.h> instead of
    <linux/random.h>
  kunit: string-stream-test: Include <linux/prandom.h> instead of
    <linux/random.h>
  random32: Include <linux/prandom.h> instead of <linux/random.h>
  lib/rbtree-test: Include <linux/prandom.h> instead of <linux/random.h>
  bpf/tests: Include <linux/prandom.h> instead of <linux/random.h>
  lib/test_parman: Include <linux/prandom.h> instead of <linux/random.h>
  lib/test_scanf: Include <linux/prandom.h> instead of <linux/random.h>
  netem: Include <linux/prandom.h> in sch_netem.c
  random: Do not include <linux/prandom.h>
  prandom: Include <linux/percpu.h>

 arch/x86/mm/kaslr.c                              | 2 +-
 drivers/gpu/drm/i915/selftests/i915_gem.c        | 2 +-
 drivers/gpu/drm/i915/selftests/i915_random.h     | 2 +-
 drivers/gpu/drm/i915/selftests/scatterlist.c     | 2 +-
 drivers/gpu/drm/lib/drm_random.h                 | 2 +-
 drivers/media/test-drivers/vivid/vivid-vid-cap.c | 1 +
 drivers/mtd/tests/oobtest.c                      | 2 +-
 drivers/mtd/tests/pagetest.c                     | 2 +-
 drivers/mtd/tests/subpagetest.c                  | 2 +-
 fs/crypto/keyring.c                              | 2 +-
 include/linux/prandom.h                          | 1 +
 include/linux/random.h                           | 7 -------
 include/scsi/libfcoe.h                           | 2 +-
 kernel/bpf/core.c                                | 2 +-
 lib/interval_tree_test.c                         | 2 +-
 lib/kunit/string-stream-test.c                   | 1 +
 lib/random32.c                                   | 2 +-
 lib/rbtree_test.c                                | 2 +-
 lib/test_bpf.c                                   | 2 +-
 lib/test_parman.c                                | 2 +-
 lib/test_scanf.c                                 | 2 +-
 net/sched/sch_netem.c                            | 1 +
 22 files changed, 21 insertions(+), 24 deletions(-)

-- 
2.46.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h>
  2024-09-05 12:17 [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Uros Bizjak
@ 2024-09-05 12:17 ` Uros Bizjak
  2024-09-06 15:10   ` Miquel Raynal
  2024-09-05 12:40 ` [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Andy Shevchenko
  1 sibling, 1 reply; 8+ messages in thread
From: Uros Bizjak @ 2024-09-05 12:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uros Bizjak, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd

Usage of pseudo-random functions requires inclusion of
<linux/prandom.h> header instead of <linux/random.h>.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: linux-mtd@lists.infradead.org
---
 drivers/mtd/tests/oobtest.c     | 2 +-
 drivers/mtd/tests/pagetest.c    | 2 +-
 drivers/mtd/tests/subpagetest.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/tests/oobtest.c b/drivers/mtd/tests/oobtest.c
index 13fed398937e..e1ee68f8b8f8 100644
--- a/drivers/mtd/tests/oobtest.c
+++ b/drivers/mtd/tests/oobtest.c
@@ -17,7 +17,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
-#include <linux/random.h>
+#include <linux/prandom.h>
 
 #include "mtd_test.h"
 
diff --git a/drivers/mtd/tests/pagetest.c b/drivers/mtd/tests/pagetest.c
index 8eb40b6e6dfa..6878700d2fc0 100644
--- a/drivers/mtd/tests/pagetest.c
+++ b/drivers/mtd/tests/pagetest.c
@@ -17,7 +17,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
-#include <linux/random.h>
+#include <linux/prandom.h>
 
 #include "mtd_test.h"
 
diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c
index 05250a080139..f34bbf033c4d 100644
--- a/drivers/mtd/tests/subpagetest.c
+++ b/drivers/mtd/tests/subpagetest.c
@@ -15,7 +15,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
-#include <linux/random.h>
+#include <linux/prandom.h>
 
 #include "mtd_test.h"
 
-- 
2.46.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency
  2024-09-05 12:17 [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Uros Bizjak
  2024-09-05 12:17 ` [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h> Uros Bizjak
@ 2024-09-05 12:40 ` Andy Shevchenko
  2024-09-05 13:03   ` Uros Bizjak
  1 sibling, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2024-09-05 12:40 UTC (permalink / raw)
  To: Uros Bizjak
  Cc: linux-kernel, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H. Peter Anvin, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Daniel Vetter, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Hans Verkuil,
	Mauro Carvalho Chehab, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Eric Biggers, Theodore Y. Ts'o,
	Jaegeuk Kim, Jason A. Donenfeld, Linus Torvalds, Hannes Reinecke,
	James E.J. Bottomley, Martin K. Petersen, Alexei Starovoitov,
	Daniel Borkmann, John Fastabend, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Andrew Morton,
	Brendan Higgins, David Gow, Rae Moar, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jiri Pirko,
	Petr Mladek, Steven Rostedt, Rasmus Villemoes, Sergey Senozhatsky,
	Stephen Hemminger, Jamal Hadi Salim, Cong Wang, Kent Overstreet,
	intel-gfx, dri-devel, linux-media, linux-mtd, linux-fscrypt,
	linux-scsi, bpf, linux-kselftest, kunit-dev

On Thu, Sep 05, 2024 at 02:17:08PM +0200, Uros Bizjak wrote:
> There were several attempts to resolve circular include dependency
> after the addition of percpu.h: 1c9df907da83 ("random: fix circular
> include dependency on arm64 after addition of percpu.h"), c0842fbc1b18
> ("random32: move the pseudo-random 32-bit definitions to prandom.h") and
> finally d9f29deb7fe8 ("prandom: Remove unused include") that completely
> removes inclusion of <linux/percpu.h>.
> 
> Due to legacy reasons, <linux/random.h> includes <linux/prandom.h>, but
> with the commit entry remark:
> 
> --quote--
> A further cleanup step would be to remove this from <linux/random.h>
> entirely, and make people who use the prandom infrastructure include
> just the new header file.  That's a bit of a churn patch, but grepping
> for "prandom_" and "next_pseudo_random32" "struct rnd_state" should
> catch most users.
> 
> But it turns out that that nice cleanup step is fairly painful, because
> a _lot_ of code currently seems to depend on the implicit include of
> <linux/random.h>, which can currently come in a lot of ways, including
> such fairly core headfers as <linux/net.h>.
> 
> So the "nice cleanup" part may or may never happen.
> --/quote--
> 
> __percpu tag is currently defined in include/linux/compiler_types.h,
> so there is no direct need for the inclusion of <linux/percpu.h>.
> However, in [1] we would like to repurpose __percpu tag as a named
> address space qualifier, where __percpu macro uses defines from
> <linux/percpu.h>.
> 
> This patch series is the "nice cleanup" part, and allows us to finally
> include <linux/percpu.h> in prandom.h.
> 
> The whole series was tested by compiling the kernel for x86_64 allconfig
> and some popular architectures, namely arm64 defconfig, powerpc defconfig
> and loongarch defconfig.

Obvious question(s) is(are):
1) have you seen the Ingo's gigantic patch series towards resolving issues with
the headers?
2) if not, please look at the preliminary work and take something from there, I
believe there are many useful changes already waiting for a couple of years to
be applied.

Because I haven't found any references nor mentions of that in the cover letter
here and explanation why it was not taking into consideration.

> [1] https://lore.kernel.org/lkml/20240812115945.484051-4-ubizjak@gmail.com/

-- 
With Best Regards,
Andy Shevchenko



______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency
  2024-09-05 12:40 ` [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Andy Shevchenko
@ 2024-09-05 13:03   ` Uros Bizjak
  2024-09-05 15:36     ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Uros Bizjak @ 2024-09-05 13:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-kernel, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H. Peter Anvin, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Daniel Vetter, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Hans Verkuil,
	Mauro Carvalho Chehab, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Eric Biggers, Theodore Y. Ts'o,
	Jaegeuk Kim, Jason A. Donenfeld, Linus Torvalds, Hannes Reinecke,
	James E.J. Bottomley, Martin K. Petersen, Alexei Starovoitov,
	Daniel Borkmann, John Fastabend, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Andrew Morton,
	Brendan Higgins, David Gow, Rae Moar, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jiri Pirko,
	Petr Mladek, Steven Rostedt, Rasmus Villemoes, Sergey Senozhatsky,
	Stephen Hemminger, Jamal Hadi Salim, Cong Wang, Kent Overstreet,
	intel-gfx, dri-devel, linux-media, linux-mtd, linux-fscrypt,
	linux-scsi, bpf, linux-kselftest, kunit-dev

On Thu, Sep 5, 2024 at 2:41 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Sep 05, 2024 at 02:17:08PM +0200, Uros Bizjak wrote:
> > There were several attempts to resolve circular include dependency
> > after the addition of percpu.h: 1c9df907da83 ("random: fix circular
> > include dependency on arm64 after addition of percpu.h"), c0842fbc1b18
> > ("random32: move the pseudo-random 32-bit definitions to prandom.h") and
> > finally d9f29deb7fe8 ("prandom: Remove unused include") that completely
> > removes inclusion of <linux/percpu.h>.
> >
> > Due to legacy reasons, <linux/random.h> includes <linux/prandom.h>, but
> > with the commit entry remark:
> >
> > --quote--
> > A further cleanup step would be to remove this from <linux/random.h>
> > entirely, and make people who use the prandom infrastructure include
> > just the new header file.  That's a bit of a churn patch, but grepping
> > for "prandom_" and "next_pseudo_random32" "struct rnd_state" should
> > catch most users.
> >
> > But it turns out that that nice cleanup step is fairly painful, because
> > a _lot_ of code currently seems to depend on the implicit include of
> > <linux/random.h>, which can currently come in a lot of ways, including
> > such fairly core headfers as <linux/net.h>.
> >
> > So the "nice cleanup" part may or may never happen.
> > --/quote--
> >
> > __percpu tag is currently defined in include/linux/compiler_types.h,
> > so there is no direct need for the inclusion of <linux/percpu.h>.
> > However, in [1] we would like to repurpose __percpu tag as a named
> > address space qualifier, where __percpu macro uses defines from
> > <linux/percpu.h>.
> >
> > This patch series is the "nice cleanup" part, and allows us to finally
> > include <linux/percpu.h> in prandom.h.
> >
> > The whole series was tested by compiling the kernel for x86_64 allconfig
> > and some popular architectures, namely arm64 defconfig, powerpc defconfig
> > and loongarch defconfig.
>
> Obvious question(s) is(are):
> 1) have you seen the Ingo's gigantic patch series towards resolving issues with
> the headers?
> 2) if not, please look at the preliminary work and take something from there, I
> believe there are many useful changes already waiting for a couple of years to
> be applied.
>
> Because I haven't found any references nor mentions of that in the cover letter
> here and explanation why it was not taking into consideration.

I am aware of the series, but the patch takes only a small bite of it
and specifically resolves the inclusion of <linux/prandom.h> from
linux/random.h. The series fixes the missing inclusion of
<linux/prandom.h> in files that use pseudo-random function and it was
not meant to be a general header cleanup. The end goal is to allow us
to include <linux/percpu.h> in linux/prandom.h - which uses __percpu
tag without the correct include.

Thus, the patch series is only tangentially connected to Ingo's patch series.

Best regards,
Uros.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency
  2024-09-05 13:03   ` Uros Bizjak
@ 2024-09-05 15:36     ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2024-09-05 15:36 UTC (permalink / raw)
  To: Uros Bizjak
  Cc: linux-kernel, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H. Peter Anvin, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Daniel Vetter, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Hans Verkuil,
	Mauro Carvalho Chehab, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Eric Biggers, Theodore Y. Ts'o,
	Jaegeuk Kim, Jason A. Donenfeld, Linus Torvalds, Hannes Reinecke,
	James E.J. Bottomley, Martin K. Petersen, Alexei Starovoitov,
	Daniel Borkmann, John Fastabend, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Andrew Morton,
	Brendan Higgins, David Gow, Rae Moar, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jiri Pirko,
	Petr Mladek, Steven Rostedt, Rasmus Villemoes, Sergey Senozhatsky,
	Stephen Hemminger, Jamal Hadi Salim, Cong Wang, Kent Overstreet,
	intel-gfx, dri-devel, linux-media, linux-mtd, linux-fscrypt,
	linux-scsi, bpf, linux-kselftest, kunit-dev

On Thu, Sep 05, 2024 at 03:03:24PM +0200, Uros Bizjak wrote:
> On Thu, Sep 5, 2024 at 2:41 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > On Thu, Sep 05, 2024 at 02:17:08PM +0200, Uros Bizjak wrote:
> > > There were several attempts to resolve circular include dependency
> > > after the addition of percpu.h: 1c9df907da83 ("random: fix circular
> > > include dependency on arm64 after addition of percpu.h"), c0842fbc1b18
> > > ("random32: move the pseudo-random 32-bit definitions to prandom.h") and
> > > finally d9f29deb7fe8 ("prandom: Remove unused include") that completely
> > > removes inclusion of <linux/percpu.h>.
> > >
> > > Due to legacy reasons, <linux/random.h> includes <linux/prandom.h>, but
> > > with the commit entry remark:
> > >
> > > --quote--
> > > A further cleanup step would be to remove this from <linux/random.h>
> > > entirely, and make people who use the prandom infrastructure include
> > > just the new header file.  That's a bit of a churn patch, but grepping
> > > for "prandom_" and "next_pseudo_random32" "struct rnd_state" should
> > > catch most users.
> > >
> > > But it turns out that that nice cleanup step is fairly painful, because
> > > a _lot_ of code currently seems to depend on the implicit include of
> > > <linux/random.h>, which can currently come in a lot of ways, including
> > > such fairly core headfers as <linux/net.h>.
> > >
> > > So the "nice cleanup" part may or may never happen.
> > > --/quote--
> > >
> > > __percpu tag is currently defined in include/linux/compiler_types.h,
> > > so there is no direct need for the inclusion of <linux/percpu.h>.
> > > However, in [1] we would like to repurpose __percpu tag as a named
> > > address space qualifier, where __percpu macro uses defines from
> > > <linux/percpu.h>.
> > >
> > > This patch series is the "nice cleanup" part, and allows us to finally
> > > include <linux/percpu.h> in prandom.h.
> > >
> > > The whole series was tested by compiling the kernel for x86_64 allconfig
> > > and some popular architectures, namely arm64 defconfig, powerpc defconfig
> > > and loongarch defconfig.
> >
> > Obvious question(s) is(are):
> > 1) have you seen the Ingo's gigantic patch series towards resolving issues with
> > the headers?
> > 2) if not, please look at the preliminary work and take something from there, I
> > believe there are many useful changes already waiting for a couple of years to
> > be applied.
> >
> > Because I haven't found any references nor mentions of that in the cover letter
> > here and explanation why it was not taking into consideration.
> 
> I am aware of the series, but the patch takes only a small bite of it
> and specifically resolves the inclusion of <linux/prandom.h> from
> linux/random.h. The series fixes the missing inclusion of
> <linux/prandom.h> in files that use pseudo-random function and it was
> not meant to be a general header cleanup. The end goal is to allow us
> to include <linux/percpu.h> in linux/prandom.h - which uses __percpu
> tag without the correct include.

Thank you for elaboration, it's all clear now.

> Thus, the patch series is only tangentially connected to Ingo's patch series.

-- 
With Best Regards,
Andy Shevchenko



______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h>
  2024-09-05 12:17 ` [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h> Uros Bizjak
@ 2024-09-06 15:10   ` Miquel Raynal
  2024-09-06 15:58     ` Uros Bizjak
  0 siblings, 1 reply; 8+ messages in thread
From: Miquel Raynal @ 2024-09-06 15:10 UTC (permalink / raw)
  To: Uros Bizjak, linux-kernel
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, linux-mtd

On Thu, 2024-09-05 at 12:17:13 UTC, Uros Bizjak wrote:
> Usage of pseudo-random functions requires inclusion of
> <linux/prandom.h> header instead of <linux/random.h>.
> 
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Richard Weinberger <richard@nod.at>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Cc: linux-mtd@lists.infradead.org

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h>
  2024-09-06 15:10   ` Miquel Raynal
@ 2024-09-06 15:58     ` Uros Bizjak
  2024-09-09  9:49       ` Miquel Raynal
  0 siblings, 1 reply; 8+ messages in thread
From: Uros Bizjak @ 2024-09-06 15:58 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: linux-kernel, Richard Weinberger, Vignesh Raghavendra, linux-mtd

On Fri, Sep 6, 2024 at 5:10 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> On Thu, 2024-09-05 at 12:17:13 UTC, Uros Bizjak wrote:
> > Usage of pseudo-random functions requires inclusion of
> > <linux/prandom.h> header instead of <linux/random.h>.
> >
> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> > Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> > Cc: Richard Weinberger <richard@nod.at>
> > Cc: Vignesh Raghavendra <vigneshr@ti.com>
> > Cc: linux-mtd@lists.infradead.org
>
> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel, is it possible to just ACK the patch for now? The series
touches many parts of the kernel, so I guess it is best to harvest
Acked-by:s in this stage of development and commit all the patches
some time after the merge window. This will avoid merge conflicts with
the series.

Thanks,
Uros.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h>
  2024-09-06 15:58     ` Uros Bizjak
@ 2024-09-09  9:49       ` Miquel Raynal
  0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2024-09-09  9:49 UTC (permalink / raw)
  To: Uros Bizjak
  Cc: linux-kernel, Richard Weinberger, Vignesh Raghavendra, linux-mtd

Hi Uros,

ubizjak@gmail.com wrote on Fri, 6 Sep 2024 17:58:39 +0200:

> On Fri, Sep 6, 2024 at 5:10 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > On Thu, 2024-09-05 at 12:17:13 UTC, Uros Bizjak wrote:  
> > > Usage of pseudo-random functions requires inclusion of
> > > <linux/prandom.h> header instead of <linux/random.h>.
> > >
> > > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> > > Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> > > Cc: Richard Weinberger <richard@nod.at>
> > > Cc: Vignesh Raghavendra <vigneshr@ti.com>
> > > Cc: linux-mtd@lists.infradead.org  
> >
> > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.  
> 
> Miquel, is it possible to just ACK the patch for now? The series
> touches many parts of the kernel, so I guess it is best to harvest
> Acked-by:s in this stage of development and commit all the patches
> some time after the merge window. This will avoid merge conflicts with
> the series.

Changing an include with a more specific include didn't look like a
dangerous change, but I'm fine dropping the patch. Please mention it
next time, because I didn't see it.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2024-09-09  9:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-05 12:17 [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Uros Bizjak
2024-09-05 12:17 ` [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h> Uros Bizjak
2024-09-06 15:10   ` Miquel Raynal
2024-09-06 15:58     ` Uros Bizjak
2024-09-09  9:49       ` Miquel Raynal
2024-09-05 12:40 ` [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Andy Shevchenko
2024-09-05 13:03   ` Uros Bizjak
2024-09-05 15:36     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox