[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHS8izMV48MeqcFB3QS_TkHNLWkQb1CjFrMk+XSS4dVqO66t2w@mail.gmail.com>
Date: Fri, 13 Sep 2024 16:26:00 -0700
From: Mina Almasry <almasrymina@...gle.com>
To: Stanislav Fomichev <stfomichev@...il.com>
Cc: Matthew Wilcox <willy@...radead.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Jesper Dangaard Brouer <hawk@...nel.org>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Stephen Rothwell <sfr@...b.auug.org.au>,
Linux Next Mailing List <linux-next@...r.kernel.org>, Arnd Bergmann <arnd@...db.de>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH net-next v2] page_pool: fix build on powerpc with GCC 14
On Fri, Sep 13, 2024 at 3:27 PM Stanislav Fomichev <stfomichev@...il.com> wrote:
>
> On 09/13, Matthew Wilcox wrote:
> > On Fri, Sep 13, 2024 at 02:55:19PM -0700, Stanislav Fomichev wrote:
> > > On 09/13, Mina Almasry wrote:
> > > > Building net-next with powerpc with GCC 14 compiler results in this
> > > > build error:
> > > >
> > > > /home/sfr/next/tmp/ccuSzwiR.s: Assembler messages:
> > > > /home/sfr/next/tmp/ccuSzwiR.s:2579: Error: operand out of domain (39 is
> > > > not a multiple of 4)
> > > > make[5]: *** [/home/sfr/next/next/scripts/Makefile.build:229:
> > > > net/core/page_pool.o] Error 1
> > >
> > > Are we sure this is the only place where we can hit by this?
> >
> > It's a compilation error, so yes, we're sure.
>
> We also have netmem_compound_head() which does page_to_netmem(compound_head()).
> Wondering whether we'll eventually hit a similar issue over there.
A bit of a head scratcher why the compiler isn't running into the same
issue for netmem_compound_head.
The callsites of netmem_compound_head are in net/core/skbuff.c, in
skb_pp_frag_ref & napi_pp_put_page. Looking at the assembly generated,
looks like somehow the compiler completely optimized out the call in
napi_pp_put_page, and the call in skb_pp_frag_ref morphs into:
# net/core/skbuff.c:1047: return
napi_pp_put_page(page_to_netmem(virt_to_page(data)));
addis 9,2,.LC63@toc@ha # tmp158,,
ld 10,.LC63@toc@l(9) #, tmp140
# ./arch/powerpc/include/asm/page.h:230: return __pa(kaddr) >>
PAGE_SHIFT;
rldicl 9,31,48,20 #, _17, head,
# net/core/skbuff.c:1047: return
napi_pp_put_page(page_to_netmem(virt_to_page(data)));
sldi 9,9,6 #, _18, _17
# net/core/skbuff.c:1047: return
napi_pp_put_page(page_to_netmem(virt_to_page(data)));
ld 3,0(10) # vmemmap, vmemmap
# net/core/skbuff.c:1047: return
napi_pp_put_page(page_to_netmem(virt_to_page(data)));
add 3,3,9 #, vmemmap, _18
Since it's page_to_netmem(virt_to_page(data)) (not virt_to_head_page),
the we don't hit there right now. It's certainly possible to trigger
this in the future.
I think we could also READ_ONCE in netmem_compound_head for some
future proofness.
--
Thanks,
Mina
Powered by blists - more mailing lists