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  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]
Date:   Fri, 22 Mar 2019 15:38:01 +0100
From:   luca abeni <luca.abeni@...tannapisa.it>
To:     Juri Lelli <juri.lelli@...hat.com>
Cc:     "chengjian (D)" <cj.chengjian@...wei.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Li Bin <huawei.libin@...wei.com>,
        "Xiexiuqi (Xie XiuQi)" <xiexiuqi@...wei.com>, mingo@...hat.com,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: WARN ON at kernel/sched/deadline.c task_non_contending

Hi Juri,


On Fri, 22 Mar 2019 15:32:32 +0100 Juri Lelli <juri.lelli@...hat.com> wrote:
[...]
> > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> > index 6a73e41a2016..43901fa3f269 100644
> > --- a/kernel/sched/deadline.c
> > +++ b/kernel/sched/deadline.c
> > @@ -252,7 +252,6 @@ static void task_non_contending(struct
> > task_struct *p) if (dl_entity_is_special(dl_se))
> >  		return;
> >  
> > -	WARN_ON(hrtimer_active(&dl_se->inactive_timer));
> >  	WARN_ON(dl_se->dl_non_contending);
> >  
> >  	zerolag_time = dl_se->deadline -
> > @@ -269,7 +268,7 @@ static void task_non_contending(struct
> > task_struct *p)
> >  	 * If the "0-lag time" already passed, decrease the active
> >  	 * utilization now, instead of starting a timer
> >  	 */
> > -	if (zerolag_time < 0) {
> > +	if ((zerolag_time < 0) ||
> > hrtimer_active(&dl_se->inactive_timer)) { if (dl_task(p))
> >  			sub_running_bw(dl_se, dl_rq);
> >  		if (!dl_task(p) || p->state == TASK_DEAD) {
> > 
> > 
> > The idea is that if the timer is active, we leave dl_non_contending
> > set to 0 (so that the timer handler does nothing), and we
> > immediately decrease the running bw.
> > I think this is OK, because this situation can happen only if the
> > task blocks, wakes up while the timer handler is running, and then
> > immediately blocks again - while the timer handler is still
> > running. So, the "zero lag time" cannot be too much in the future.  
> 
> And if we get here and the handler is running it means that the
> handler is spinning on rq->lock waiting the dequeue to release it.
> So, this looks safe to me as well.
> 
> BTW, I could reproduce with Steve's deadline_test [1], and this seems
> to fix it.
> 
> Would you mind sending out a proper patch Luca?

Thanks for looking at this. I'll try to prepare and send a patch in
next week.



			Thanks,
				Luca

Powered by blists - more mailing lists