public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] timer: Use static_branch_likely() for timers_nohz_active
Date: Wed, 23 Jun 2021 11:17:01 +0800	[thread overview]
Message-ID: <20210623111701.0850fac3@xhacker.debian> (raw)
In-Reply-To: <87o8bydj0n.ffs@nanos.tec.linutronix.de>

Hi Thomas,

On Tue, 22 Jun 2021 17:19:20 +0200
Thomas Gleixner <tglx@linutronix.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

  reply	other threads:[~2021-06-23  3:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  6:33 [PATCH] timer: Use static_branch_likely() for timers_nohz_active Jisheng Zhang
2021-06-22 15:19 ` Thomas Gleixner
2021-06-23  3:17   ` Jisheng Zhang [this message]
2021-06-23 10:41   ` Jisheng Zhang

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=20210623111701.0850fac3@xhacker.debian \
    --to=jisheng.zhang@synaptics.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /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