lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20141103105040.GI12706@worktop.programming.kicks-ass.net>
Date:	Mon, 3 Nov 2014 11:50:40 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	"pang.xunlei" <pang.xunlei@...aro.org>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Juri Lelli <juri.lelli@...il.com>
Subject: Re: [PATCH 1/3] sched/cpupri: Deal with
 cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ