From: Peter Zijlstra <peterz@infradead.org>
To: "pang.xunlei" <pang.xunlei@linaro.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Juri Lelli <juri.lelli@gmail.com>
Subject: Re: [PATCH 1/3] sched/cpupri: Deal with cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases
Date: Mon, 3 Nov 2014 11:50:40 +0100 [thread overview]
Message-ID: <20141103105040.GI12706@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <1415010620-6176-1-git-send-email-pang.xunlei@linaro.org>
On Mon, Nov 03, 2014 at 06:30:18PM +0800, pang.xunlei wrote:
> kernel/sched/idle_task.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/kernel/sched/idle_task.c b/kernel/sched/idle_task.c
> index 67ad4e7..3dc372e 100644
> --- a/kernel/sched/idle_task.c
> +++ b/kernel/sched/idle_task.c
> @@ -26,6 +26,15 @@ static void check_preempt_curr_idle(struct rq *rq, struct task_struct *p, int fl
> static struct task_struct *
> pick_next_task_idle(struct rq *rq, struct task_struct *prev)
> {
> +#ifdef CONFIG_SMP
> + struct cpupri *cp = &rq->rd->cpupri;
> + int currpri = cp->cpu_to_pri[rq->cpu];
> +
> + BUG_ON(currpri != CPUPRI_NORMAL);
> + /* Set CPUPRI_IDLE bitmap for this cpu */
> + cpupri_set(cp, rq->cpu, MAX_PRIO);
> +#endif
> +
This should really be idle_enter_rt() and implemented in
kernel/sched/rt.c.
> put_prev_task(rq, prev);
>
> schedstat_inc(rq, sched_goidle);
> @@ -47,6 +56,18 @@ dequeue_task_idle(struct rq *rq, struct task_struct *p, int flags)
>
> static void put_prev_task_idle(struct rq *rq, struct task_struct *prev)
> {
> +#ifdef CONFIG_SMP
> + struct cpupri *cp = &rq->rd->cpupri;
> + int currpri = cp->cpu_to_pri[rq->cpu];
> +
> + /*
> + * Set CPUPRI_NORMAL bitmap for this cpu when exiting from idle.
> + * RT tasks may be queued beforehand, so the judgement is needed.
> + */
> + if (currpri == CPUPRI_IDLE)
> + cpupri_set(cp, rq->cpu, MAX_RT_PRIO);
> +#endif
idle_exit_rt() and the same.
> idle_exit_fair(rq);
> rq_last_tick_reset(rq);
> }
Also, try and keep the deadline bits in sync with the rt semantics.
prev parent reply other threads:[~2014-11-03 10:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 10:30 [PATCH 1/3] sched/cpupri: Deal with cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases pang.xunlei
2014-11-03 10:30 ` [PATCH 2/3] sched/cpupri: Remove unnecessary definitions in cpupri.h pang.xunlei
2014-11-03 10:30 ` [PATCH 3/3] sched/rt: Optimize select_task_rq_rt() for non-RT curr task pang.xunlei
2014-11-03 10:50 ` Peter Zijlstra [this message]
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=20141103105040.GI12706@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=juri.lelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pang.xunlei@linaro.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