From: Eric Dumazet <edumazet@google.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: David Howells <dhowells@redhat.com>,
Jakub Kicinski <kuba@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
kernel test robot <oliver.sang@intel.com>,
oe-lkp@lists.linux.dev, lkp@intel.com, netdev@vger.kernel.org,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH] net: micro-optimize skb_datagram_iter
Date: Wed, 19 Jun 2024 16:56:15 +0200 [thread overview]
Message-ID: <CANn89iKukukmyL_FERQ25bBhkfv-_oUpOW_WFd4=GUFNsJN6OQ@mail.gmail.com> (raw)
In-Reply-To: <CANn89iLQ+9GYYn0pQpueFP+aYHnoWhqZSws6t6VCNoxs8pwL7w@mail.gmail.com>
On Wed, Jun 19, 2024 at 4:51 PM Eric Dumazet <edumazet@google.com> wrote:
>
> On Wed, Jun 19, 2024 at 3:54 PM Sagi Grimberg <sagi@grimberg.me> wrote:
> >
> >
> >
> > On 19/06/2024 15:46, David Howells wrote:
> > > Jakub Kicinski <kuba@kernel.org> wrote:
> > >
> > >> On Mon, 17 Jun 2024 09:29:53 +0300 Sagi Grimberg wrote:
> > >>>> Probably because kmap() returns page_address() for non-highmem pages
> > >>>> while kmap_local_page() actually returns a kmap address:
> > >>>>
> > >>>> if (!IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP) && !PageHighMem(page))
> > >>>> return page_address(page);
> > >>>> return __kmap_local_pfn_prot(page_to_pfn(page), prot);
> > >>>>
> > >>>> so if skb frags are always lowmem (are they?) this is a false positive.
> > >>> AFAIR these buffers are coming from the RX ring, so they should be
> > >>> coming from a page_frag_cache,
> > >>> so I want to say always low memory?
> > >>>
> > >>>> if they can be highmem, then you've uncovered a bug that nobody's
> > >>>> noticed because nobody's testing on 32-bit any more.
> > >>> Not sure, Jakub? Eric?
> > >> My uneducated guess would be that until recent(ish) sendpage rework
> > >> from David Howells all high mem pages would have been single pages.
> > > Um. I touched the Tx side, not the Rx side.
> > >
> > > I also don't know whether all high mem pages would be single pages. I'll have
> > > to defer that one to the MM folks.
> >
> > What prevents from gro to expand frags from crossing PAGE_SIZE?
> >
> > btw, at least from the code in skb_gro_receive() it appears that
> > page_address() is called directly,
> > which suggest that these netmem pages are lowmem?
>
> GRO should only be fed with lowmem pages.
>
> But the trace involves af_unix, not GRO ?
>
> I guess that with splice games, it is possible to add high order pages to skbs.
>
> I think skb_frag_foreach_page() could be used to fix this issue.
For reference, please look at
commit c613c209c3f351d47158f728271d0c73b6dd24c6
Author: Willem de Bruijn <willemb@google.com>
Date: Mon Jul 31 08:15:47 2017 -0400
net: add skb_frag_foreach_page and use with kmap_atomic
next prev parent reply other threads:[~2024-06-19 14:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 11:35 [PATCH] net: micro-optimize skb_datagram_iter Sagi Grimberg
2024-06-15 2:40 ` patchwork-bot+netdevbpf
2024-06-16 8:06 ` kernel test robot
2024-06-16 9:24 ` Sagi Grimberg
2024-06-16 21:51 ` David Laight
2024-06-16 21:53 ` Matthew Wilcox
2024-06-17 10:18 ` David Laight
2024-06-16 21:56 ` Matthew Wilcox
2024-06-17 6:29 ` Sagi Grimberg
2024-06-17 16:58 ` Jakub Kicinski
2024-06-18 6:37 ` Sagi Grimberg
2024-06-19 12:46 ` David Howells
2024-06-19 13:54 ` Sagi Grimberg
2024-06-19 14:51 ` Eric Dumazet
2024-06-19 14:56 ` Eric Dumazet [this message]
2024-06-19 15:25 ` Sagi Grimberg
2024-06-21 7:54 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANn89iKukukmyL_FERQ25bBhkfv-_oUpOW_WFd4=GUFNsJN6OQ@mail.gmail.com' \
--to=edumazet@google.com \
--cc=dhowells@redhat.com \
--cc=kuba@kernel.org \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=sagi@grimberg.me \
--cc=willemb@google.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).