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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1342632866.11900.12.camel@gandalf.stny.rr.com>
Date:	Wed, 18 Jul 2012 13:34:26 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Ying Xue <ying.xue@...driver.com>
Cc:	linux-kernel@...r.kernel.org, linux-rt-users@...r.kernel.org,
	peterz@...radead.org, tglx@...utronix.de, mingo@...e.hu,
	yong.zhang0@...il.com
Subject: Re: [PATCH] sched/rt: Avoid updating RT entry timeout twice within
 one tick period

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@...dmis.org>

-- Steve

> 
> Signed-off-by: Ying Xue <ying.xue@...driver.com>
> Signed-off-by: Fan Du <fan.du@...driver.com>
> Reviewed-by: Yong Zhang <yong.zhang0@...il.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;


--
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