[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dwhxxuil4zkesmyj6xviyyyfedrcd65h6qd4bplmcrsg36purj@f523i7t6nxag>
Date: Fri, 23 Jan 2026 14:45:06 -0500
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: SeongJae Park <sj@...nel.org>
Cc: kernel test robot <lkp@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
oe-kbuild-all@...ts.linux.dev,
Linux Memory Management List <linux-mm@...ck.org>,
maple-tree@...ts.infradead.org, linux-kernel@...r.kernel.org,
Suren Baghdasaryan <surenb@...gle.com>,
Matthew Wilcox <willy@...radead.org>,
Sidhartha Kumar <sidhartha.kumar@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, Alice Ryhl <aliceryhl@...gle.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Arnd Bergmann <arnd@...db.de>, Christian Kujau <lists@...dbynature.de>
Subject: Re: [PATCH v2 17/29] maple_tree: Start using maple copy node for
destination
* SeongJae Park <sj@...nel.org> [260122 00:55]:
> On Thu, 22 Jan 2026 09:44:37 +0800 kernel test robot <lkp@...el.com> wrote:
>
> > Hi Liam,
> >
> > kernel test robot noticed the following build errors:
> >
> > [auto build test ERROR on akpm-mm/mm-everything]
> > [also build test ERROR on next-20260121]
> > [cannot apply to akpm-mm/mm-nonmm-unstable soc/for-next linus/master v6.19-rc6]
> > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > And when submitting patch, we suggest to use '--base' as documented in
> > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> >
> > url: https://github.com/intel-lab-lkp/linux/commits/Liam-R-Howlett/maple_tree-Fix-mas_dup_alloc-sparse-warning/20260122-023746
> > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> > patch link: https://lore.kernel.org/r/20260121164526.2093265-18-Liam.Howlett%40oracle.com
> > patch subject: [PATCH v2 17/29] maple_tree: Start using maple copy node for destination
> > config: sparc-randconfig-002-20260122 (https://download.01.org/0day-ci/archive/20260122/202601220811.ac3t5OuP-lkp@intel.com/config)
> > compiler: sparc64-linux-gcc (GCC) 8.5.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260122/202601220811.ac3t5OuP-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@...el.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202601220811.ac3t5OuP-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> > In file included from ./arch/sparc/include/generated/asm/rwonce.h:1,
> > from include/linux/compiler.h:380,
> > from include/linux/array_size.h:5,
> > from include/linux/kernel.h:16,
> > from include/linux/maple_tree.h:11,
> > from lib/maple_tree.c:56:
> > lib/maple_tree.c: In function 'cp_dst_to_slots':
> > >> include/linux/rcupdate.h:555:36: error: dereferencing pointer to incomplete type 'struct maple_enode'
> > #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
> > ^~~~
> > include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE'
> > *(volatile typeof(x) *)&(x) = (val); \
> > ^~~
> > include/linux/rcupdate.h:1046:3: note: in expansion of macro 'WRITE_ONCE'
> > WRITE_ONCE(p, RCU_INITIALIZER(v)); \
> > ^~~~~~~~~~
> > include/linux/rcupdate.h:1046:17: note: in expansion of macro 'RCU_INITIALIZER'
> > WRITE_ONCE(p, RCU_INITIALIZER(v)); \
> > ^~~~~~~~~~~~~~~
> > lib/maple_tree.c:3155:3: note: in expansion of macro 'RCU_INIT_POINTER'
> > RCU_INIT_POINTER(cp->slot[d], mt_mk_node(mn, mt));
> > ^~~~~~~~~~~~~~~~
>
> Seems this issue depends on compiler version. I got similar error on my build
> test, which uses gcc 8.1.0. After increasing the version to 14.2.0, I don't
> get the build error.
>
> I also confirmed below simple change fixes the build error on my setup, and
> added to my tree as a temporal fix. I'm not familiar with maple tree code or
> clearly understanding exactly what gcc change caused the issue, so I'm unsure
> if my fix is a right one. I'm sharing that only for a reference, as anyway I
> have to make it and add to my tree as a temporal fix.
Thanks SJ.
I have translations in the code for void * to other types, but haven't
hit an issue the other way until now. These types are not fully defined
specifically to catch type errors, so it's ironic this breaks on old
compilers.
This fix looks good to me.
Thanks,
Liam
>
>
> Thanks,
> SJ
>
> [...]
> === >8 ===
> From 6b0051e419cc5129133f8eb94db7f44afd8170fa Mon Sep 17 00:00:00 2001
> From: SeongJae Park <sj@...nel.org>
> Date: Wed, 21 Jan 2026 21:24:08 -0800
> Subject: [PATCH] temporal build fix
>
> Link: https://lore.kernel.org/202601220811.ac3t5OuP-lkp@intel.com
> Signed-off-by: SeongJae Park <sj@...nel.org>
> ---
> lib/maple_tree.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index 2d840b9a360f8..7aafcec45c6f2 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -3152,7 +3152,7 @@ static inline void cp_dst_to_slots(struct maple_copy *cp, unsigned long min,
> * read-side operations that can view them until they are
> * inserted into the tree after an rcu_assign_pointer() call.
> */
> - RCU_INIT_POINTER(cp->slot[d], mt_mk_node(mn, mt));
> + RCU_INIT_POINTER(cp->slot[d], (void *)mt_mk_node(mn, mt));
> cp->pivot[d] = slot_max;
> if (mt_is_alloc(mas->tree)) {
> if (ma_is_leaf(mt)) {
> @@ -3375,7 +3375,8 @@ static bool spanning_ascend(struct maple_copy *cp, struct ma_state *mas,
> * the tree after an rcu_assign_pointer() call.
> */
> RCU_INIT_POINTER(cp->slot[0],
> - mt_mk_node(cp->dst[0].node, mt));
> + (void *)mt_mk_node(
> + cp->dst[0].node, mt));
> cp->height++;
> }
> WARN_ON_ONCE(cp->dst[0].node != mte_to_node(
> --
> 2.47.3
>
Powered by blists - more mailing lists