Re: [PATCH 5/5] lib/nodemask: inline next_node_in() and node_random()

From: Yury Norov
Date: Fri Jul 29 2022 - 12:48:57 EST


On Thu, Jul 28, 2022 at 8:46 PM Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
>
> On Sun, Jul 10, 2022 at 09:47:11PM -0700, Yury Norov wrote:
> > The functions are pretty thin wrappers around find_bit engine, and
> > keeping them in c-file prevents compiler from small_const_nbits()
> > optimization, which must take place for all systems with MAX_NUMNODES
> > less than BITS_PER_LONG (default is 16 for me).
> >
> > Moving them in header file doesn't blow up the kernel size:
> > add/remove: 1/2 grow/shrink: 9/5 up/down: 968/-88 (880)
> >
> > Signed-off-by: Yury Norov <yury.norov@xxxxxxxxx>
>
> This patch results in
>
> Building powerpc:allmodconfig ... failed
> --------------
> Error log:
> In file included from include/linux/nodemask.h:97,
> from include/linux/sched.h:22,
> from include/linux/sched/mm.h:7,
> from arch/powerpc/lib/feature-fixups.c:16:
> include/linux/random.h: In function 'add_latent_entropy':
> include/linux/random.h:25:46: error: 'latent_entropy' undeclared
>
> and many more similar errors when trying to compile ppc:allmodconfig.
>
> Guenter

Hi Guenter,

Thanks for testing. The fix is:

diff --git a/arch/powerpc/kernel/setup-common.c
b/arch/powerpc/kernel/setup-common.c
index eadaddccfe89..18c5fa5918bf 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -179,6 +179,7 @@ bool __must_check
arch_get_random_seed_long(unsigned long *v)

return false;
}
+EXPORT_SYMBOL(arch_get_random_seed_long);
#endif

I moved this export in and out while discussing the patch, and finally left the
branch in a broken state. Sorry that. Now fixed.

Thanks,
Yury