linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yajun Deng <yajun.deng@linux.dev>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Eric Dumazet <edumazet@google.com>,
	mhiramat@kernel.org, dennis@kernel.org, tj@kernel.org,
	cl@linux.com, mark.rutland@arm.com, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc()
Date: Tue, 10 Oct 2023 11:46:08 +0800	[thread overview]
Message-ID: <7fbf47bf-c26c-8eeb-f803-b9f2bafa6364@linux.dev> (raw)
In-Reply-To: <20231009102833.1b0d35e3@gandalf.local.home>


On 2023/10/9 22:28, Steven Rostedt wrote:
> On Mon, 9 Oct 2023 18:58:27 +0800
> Yajun Deng <yajun.deng@linux.dev> wrote:
>
>>> C compiler decides to inline or not, depending on various factors.
>>>
>>> The most efficient (and small) code is generated by this_cpu_inc()
>>> version, allowing the compiler to inline it.
>>>
>>> If you copy/paste this_cpu_inc()  twenty times, then the compiler
>>> would  not inline the function anymore.
> Yes, if you want something to be visible by ftrace, it must not be inlined
> (as inlined functions are not function calls by definition). And as Eric
> stated, the compiler is perfectly allowed to inline something if it
> believes it will be more efficient. i.e. There may be code around the function
> call that could be more efficient if it wasn't change to parameters. If you
> want to make sure a function stays out of line, you must explicitly tell
> the compiler you want the function not to ever be inlined (hence the
> "noinline" attribute).


Thanks for the details.

>>
>> Got it. Thank you.
> Great.
>
> -- Steve

      reply	other threads:[~2023-10-10  3:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231007050621.1706331-1-yajun.deng@linux.dev>
     [not found] ` <CANn89iL-zUw1FqjYRSC7BGB0hfQ5uKpJzUba3YFd--c=GdOoGg@mail.gmail.com>
     [not found]   ` <917708b5-cb86-f233-e878-9233c4e6c707@linux.dev>
     [not found]     ` <CANn89i+navyRe8-AV=ehM3qFce2hmnOEKBqvK5Xnev7KTaS5Lg@mail.gmail.com>
     [not found]       ` <a53a3ff6-8c66-07c4-0163-e582d88843dd@linux.dev>
     [not found]         ` <CANn89i+u5dXdYm_0_LwhXg5Nw+gHXx+nPUmbYhvT=k9P4+9JRQ@mail.gmail.com>
     [not found]           ` <9f4fb613-d63f-9b86-fe92-11bf4dfb7275@linux.dev>
     [not found]             ` <CANn89iK7bvQtGD=p+fHaWiiaNn=u8vWrt0YQ26pGQY=kZTdfJw@mail.gmail.com>
     [not found]               ` <4a747fda-2bb9-4231-66d6-31306184eec2@linux.dev>
2023-10-09  3:07                 ` [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc() Yajun Deng
2023-10-09  7:53                   ` Eric Dumazet
2023-10-09  8:13                     ` Yajun Deng
2023-10-09  8:20                       ` Eric Dumazet
2023-10-09  8:36                         ` Yajun Deng
2023-10-09  9:30                           ` Eric Dumazet
2023-10-09  9:43                             ` Yajun Deng
2023-10-09 10:16                               ` Eric Dumazet
2023-10-09 10:58                                 ` Yajun Deng
2023-10-09 14:28                                   ` Steven Rostedt
2023-10-10  3:46                                     ` Yajun Deng [this message]

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=7fbf47bf-c26c-8eeb-f803-b9f2bafa6364@linux.dev \
    --to=yajun.deng@linux.dev \
    --cc=aleksander.lobakin@intel.com \
    --cc=cl@linux.com \
    --cc=davem@davemloft.net \
    --cc=dennis@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.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).