[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210623111701.0850fac3@xhacker.debian>
Date: Wed, 23 Jun 2021 11:17:01 +0800
From: Jisheng Zhang <Jisheng.Zhang@...aptics.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: John Stultz <john.stultz@...aro.org>,
Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] timer: Use static_branch_likely() for
timers_nohz_active
Hi Thomas,
On Tue, 22 Jun 2021 17:19:20 +0200
Thomas Gleixner <tglx@...utronix.de> wrote:
>
> On Thu, May 13 2021 at 14:33, Jisheng Zhang wrote:
> > NOHZ is likely to be enabled, so use static_branch_likely() to
>
> Why is it likely to be enabled? Did you make a survey of the wider
> distro universe or what?
No, I didn't make any survey. I only checked debian and ubuntu kernel
image config file, both have CONFIG_NO_HZ_COMMON=y
So IMHO, if CONFIG_NO_HZ_COMMON=y, the static key timers_nohz_active is
true in most cases.
>
> > reflect this fact. This could improve the finally generated code
>
> could improve? Either it does or it does not.
Per include/linux/jump_label.h, if the timers_nohz_active is true,
it can save two jmp instructions.
* type\branch| likely (1) | unlikely (0)
* -----------+-----------------------+------------------
* | |
* true (1) | ... | ...
* | NOP | JMP L
* | <br-stmts> | 1: ...
* | L: ... |
* | |
* | | L: <br-stmts>
* | | jmp 1b
Thanks
Powered by blists - more mailing lists