Re: linux-next: build failure after merge of the net-next tree
From: Mina Almasry
Date: Fri Sep 13 2024 - 16:06:04 EST
On Fri, Sep 13, 2024 at 11:36 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Fri, 13 Sep 2024 09:27:17 -0700 Mina Almasry wrote:
> > diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> > index 5769fe6e4950..ea4005d2d1a9 100644
> > --- a/include/linux/page-flags.h
> > +++ b/include/linux/page-flags.h
> > @@ -239,8 +239,8 @@ static inline unsigned long _compound_head(const
> > struct page *page)
> > {
> > unsigned long head = READ_ONCE(page->compound_head);
> >
> > - if (unlikely(head & 1))
> > - return head - 1;
> > + if (unlikely(head & 1UL))
> > + return head & ~1UL;
> > return (unsigned long)page_fixed_fake_head(page);
> > }
> >
> > Other than that I think this is a correct fix. Jakub, what to do here.
> > Do I send this fix to the mm tree or to net-next?
>
> Yes, please, send this out and CC all the relevant people.
> We can decide which tree it will go into once its reviewed.
>
> Stephen, would you be willing to slap this on top of linux-next for now?
> I can't think of a better bandaid we could put in net-next,
> and it'd be sad to revert a major feature because of a compiler bug(?)
Change, got NAKed:
https://lore.kernel.org/netdev/ZuSQ9BT9Vg7O2kXv@xxxxxxxxxxxxxxxxxxxx/
But AFAICT we don't really need to do this inside of mm, affecting
things like compound_head. This equivalent change also makes the build
pass. Does this look good?
diff --git a/include/net/netmem.h b/include/net/netmem.h
index 8a6e20be4b9d..58f2120cd392 100644
--- a/include/net/netmem.h
+++ b/include/net/netmem.h
@@ -100,7 +100,15 @@ static inline netmem_ref net_iov_to_netmem(struct
net_iov *niov)
static inline netmem_ref page_to_netmem(struct page *page)
{
- return (__force netmem_ref)page;
+ /* page* exported from the mm stack would not have the LSB set, but the
+ * GCC 14 powerpc compiler will optimize reads into this pointer into
+ * unaligned reads as it sees address arthemetic in _compound_head().
+ *
+ * Explicitly clear the LSB until what looks like a GCC compiler issue
+ * is resolved.
+ */
+ DEBUG_NET_WARN_ON_ONCE((unsigned long)page & 1UL);
+ return (__force netmem_ref)page & ~1UL;
}
--
Thanks,
Mina