From: Juri Lelli <juri.lelli@arm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Luca Abeni <luca.abeni@santannapisa.it>,
Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: Re: [RFC][PATCH] sched/deadline: Remove if statement before clearing throttle and yielded
Date: Thu, 11 May 2017 15:01:16 +0100 [thread overview]
Message-ID: <20170511140116.4ojn67utqjp5x2j5@e106622-lin> (raw)
In-Reply-To: <20170510095044.6a04b2dc@gandalf.local.home>
Hi,
On 10/05/17 09:50, Steven Rostedt wrote:
> [
> This is an RFC as I didn't run any benchmarks. It just seemed a bit
> weird to me that we would add such a check instead of just clearing
> these variables out regardless.
> ]
>
> The function replenish_dl_entity() clears dl_throttled and dl_yielded,
> but checks first if they are set before doing so. As these variables
> are in the same cache locale of other variables being modified, there's
> no advantage in checking if they are set before clearing them. But
> having the compare takes slots away from the branch prediction.
>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index a2ce590..9748d33 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -423,10 +423,8 @@ static void replenish_dl_entity(struct sched_dl_entity *dl_se,
> dl_se->runtime = pi_se->dl_runtime;
> }
>
> - if (dl_se->dl_yielded)
> - dl_se->dl_yielded = 0;
> - if (dl_se->dl_throttled)
> - dl_se->dl_throttled = 0;
> + dl_se->dl_yielded = 0;
> + dl_se->dl_throttled = 0;
> }
Looks good to me.
Peter, any particular reason why you wanted to first check the values?
Best,
- Juri
next prev parent reply other threads:[~2017-05-11 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 13:50 Steven Rostedt
2017-05-11 14:01 ` Juri Lelli [this message]
2017-05-11 17:29 ` Daniel Bristot de Oliveira
2017-05-11 19:50 ` Peter Zijlstra
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=20170511140116.4ojn67utqjp5x2j5@e106622-lin \
--to=juri.lelli@arm.com \
--cc=bristot@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.abeni@santannapisa.it \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®