From: Steven Rostedt <rostedt@goodmis.org>
To: Ying Xue <ying.xue@windriver.com>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
peterz@infradead.org, tglx@linutronix.de, mingo@elte.hu,
yong.zhang0@gmail.com
Subject: Re: [PATCH] sched/rt: Avoid updating RT entry timeout twice within one tick period
Date: Wed, 18 Jul 2012 13:34:26 -0400 [thread overview]
Message-ID: <1342632866.11900.12.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1342508623-2887-1-git-send-email-ying.xue@windriver.com>
On Tue, 2012-07-17 at 15:03 +0800, Ying Xue wrote:
> To solve the issue, we prevent the timeout value from increasing twice
> within one tick time by remembering the jiffies value of lastly updating
> the timeout. As long as the RT task's jiffies is different with the
> global jiffies value, we allow its timeout to be updated.
Peter, I'm fine with this change. Do you want to pick it up. It looks
like it can affect mainline as well.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
>
> Signed-off-by: Ying Xue <ying.xue@windriver.com>
> Signed-off-by: Fan Du <fan.du@windriver.com>
> Reviewed-by: Yong Zhang <yong.zhang0@gmail.com>
> ---
> include/linux/sched.h | 1 +
> kernel/sched/rt.c | 6 +++++-
> 2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 4a1f493..f0656a2 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1199,6 +1199,7 @@ struct sched_entity {
> struct sched_rt_entity {
> struct list_head run_list;
> unsigned long timeout;
> + unsigned long watchdog_stamp;
> unsigned int time_slice;
>
> struct sched_rt_entity *back;
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 573e1ca..8240d4f 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -1976,7 +1976,11 @@ static void watchdog(struct rq *rq, struct task_struct *p)
> if (soft != RLIM_INFINITY) {
> unsigned long next;
>
> - p->rt.timeout++;
> + if (p->rt.watchdog_stamp != jiffies) {
> + p->rt.timeout++;
> + p->rt.watchdog_stamp = jiffies;
> + }
> +
> next = DIV_ROUND_UP(min(soft, hard), USEC_PER_SEC/HZ);
> if (p->rt.timeout > next)
> p->cputime_expires.sched_exp = p->se.sum_exec_runtime;
next prev parent reply other threads:[~2012-07-18 17:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-17 7:03 Ying Xue
2012-07-18 17:34 ` Steven Rostedt [this message]
2013-01-25 10:39 ` [tip:sched/core] " tip-bot for Ying Xue
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=1342632866.11900.12.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=ying.xue@windriver.com \
--cc=yong.zhang0@gmail.com \
/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®