Netdev List
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Eric Dumazet <edumazet@google.com>
Cc: David Laight <david.laight.linux@gmail.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	 netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	 Eric Dumazet <eric.dumazet@gmail.com>,
	Paolo Abeni <pabeni@redhat.com>,
	 Nicolas Pitre <npitre@baylibre.com>,
	nathan@kernel.org, ajordanr@google.com
Subject: Re: [PATCH] compiler_types: Introduce inline_for_performance
Date: Fri, 17 Jul 2026 09:56:57 -0700	[thread overview]
Message-ID: <alpeswexV_jIgT5q@google.com> (raw)
In-Reply-To: <CANn89iJVQe=wedLheJmjZjOTJsWHijT0jZs=iRxKssJZbjAxHw@mail.gmail.com>

On Mon, Jan 19, 2026 at 11:33:29AM +0100, Eric Dumazet wrote:
> > Many __always_inline came because of clang's reluctance to inline
> > small things, even if the resulting code size is bigger and slower.
> >
> > It is a bit unclear, this seems to happen when callers are 'big
> > enough'.

Haha, yes, and I've read LLVM's inline cost model before and "a bit
unclear" is how I feel about it.  At this point, some of your Google
compatriots have even resorted to AI for inlining.

https://arxiv.org/pdf/2101.04808

> > noinstr (callers) functions are also a problem.
> >
> > Let's take the list_add() call from dev_gro_receive() : clang does not
> > inline it, for some reason.
> >
> > After adding __always_inline to list_add() and __list_add() we have
> > smaller and more efficient code,
> > for real workloads, not only benchmarks.

Yeah, ChromeOS is hitting this now, too.  They're deploying AutoFDO
where you collect traces with LBR (x86) / ETM,TRBE,BRBE,SPE (ARM) then
feed that back into the compiler.  Then they're getting modpost warnings
from section mismatches when constant propagation sinks addresses of
initdata globals into specialized copies of list_add that are then not
inlined (so not placed in .init).

https://github.com/ClangBuiltLinux/linux/issues/2173

I think list_add, __list_add, and probably __list_del_entry_valid should
be always_inline, possibly except for the different definitions when
CONFIG_LIST_HARDENED is set.

  parent reply	other threads:[~2026-07-17 16:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-18 15:24 [PATCH] compiler_types: Introduce inline_for_performance Eric Dumazet
2026-01-18 15:32 ` Florian Westphal
2026-01-18 15:39   ` Eric Dumazet
2026-01-18 18:36 ` kernel test robot
2026-01-18 22:33   ` David Laight
2026-01-18 19:47 ` Andrew Morton
2026-01-18 20:38   ` Eric Dumazet
2026-01-18 22:58   ` David Laight
2026-01-19  0:01     ` Andrew Morton
2026-01-19  9:33       ` David Laight
2026-01-19 10:25         ` Eric Dumazet
2026-01-19 10:33           ` Eric Dumazet
2026-01-19 10:50           ` David Laight
2026-07-17 16:56           ` Nick Desaulniers [this message]
2026-01-19 15:47     ` Nicolas Pitre
2026-01-19 19:03       ` David Laight
2026-01-19 19:44         ` Nicolas Pitre
2026-01-18 21:04 ` kernel test robot

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=alpeswexV_jIgT5q@google.com \
    --to=ndesaulniers@google.com \
    --cc=ajordanr@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=david.laight.linux@gmail.com \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=npitre@baylibre.com \
    --cc=pabeni@redhat.com \
    /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