lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 10 Oct 2023 11:46:08 +0800
From: Yajun Deng <yajun.deng@...ux.dev>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Eric Dumazet <edumazet@...gle.com>, mhiramat@...nel.org,
 dennis@...nel.org, tj@...nel.org, cl@...ux.com, mark.rutland@....com,
 davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 Alexander Lobakin <aleksander.lobakin@...el.com>,
 linux-trace-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc()


On 2023/10/9 22:28, Steven Rostedt wrote:
> On Mon, 9 Oct 2023 18:58:27 +0800
> Yajun Deng <yajun.deng@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ