public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@arm.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: Luca Abeni <luca.abeni@unitn.it>,
	Wanpeng li <wanpeng.li@hotmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] sched/deadline: fix earliest_dl.next logic
Date: Tue, 1 Dec 2015 11:30:36 +0000	[thread overview]
Message-ID: <20151201113036.GW20439@e106622-lin> (raw)
In-Reply-To: <CANRm+Czq7PFFtOA=iSkF1Csk_BVh=qPQ0+b=mN6muGWeBGMBwA@mail.gmail.com>

On 30/11/15 10:20, Wanpeng Li wrote:
> 2015-11-27 20:14 GMT+08:00 Luca Abeni <luca.abeni@unitn.it>:
> > Hi all,
> >
> > I ran some quick tests on this patch (because I was working on something
> > related), and it seems to me that it triggers a bug. Here are some
> > information:

[snip]

> >
> > Here is my understanding of the crash:
> > - schedule() invokes pick_next_task_dl() which wants to do a context switch
> > (by selecting
> >   for execution a new task "p" which is different from "prev")
> > - pick_next_task_dl() invokes put_prev, which puts the "prev" task in the
> > pushable tasks
> >   queue (WARNING! "prev" is still the "current" task in this rq, because the
> > scheduler is
> >   still running... I think this is the source of the issue)
> > - then, pick_next_task_dl() invokes dequeue_pushable_dl_task() on p, to
> > remove the selected
> >   task from the pushable tasks queue...
> > - ...But after your patch dequeue_pushable_dl_task() invokes
> > pick_next_pushable_dl_task().
> >   Which sees that the next pushable task is the "current" task (see above).
> > This happens
> >   becuase "prev" has already been inserted in the pushable tasks queue, and
> > can be the
> >   next pushable task... But "current" has not been updated yet.
> > - The BUG_ON() at line 1443 of deadline.c is just "BUG_ON(task_current(rq,
> > p))"
> 
> Thanks for your report and great analyse, Luca, you are right.
> 
> >
> > Summing up, I think pick_next_pushable_dl_task() cannot be called from
> > dequeue_pushable_dl_task() (at least, not without removing or modifying that
> > BUG_ON()).
> 
> Juri, how about remove this BUG_ON() just like rt class?
> 

It seems that we actually check the very same conditions for RT, as we
do for DL. The difference is that RT doesn't call pick_next_pushable
_task(). I think we can do the same, just checking and eventually using
the updated leftmost in dequeue_pushable_dl_task().

Thanks,

- Juri

  reply	other threads:[~2015-12-01 11:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BLU436-SMTP191B35D0444F8D6FA85AF5D801B0@phx.gbl>
     [not found] ` <BLU436-SMTP225E1976DA7ABB010CB48AB80060@phx.gbl>
2015-11-24  9:34   ` [PATCH v3] sched/deadline: fix earliest_dl.next logic Juri Lelli
2015-11-27 11:26 ` Juri Lelli
2015-11-27 12:14   ` Luca Abeni
2015-11-30  2:20     ` Wanpeng Li
2015-12-01 11:30       ` Juri Lelli [this message]
2015-12-01 12:14         ` Wanpeng Li
2015-12-02 10:42     ` Wanpeng Li
2015-12-02 10:47       ` Luca Abeni
2015-11-30  2:16   ` Wanpeng Li

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=20151201113036.GW20439@e106622-lin \
    --to=juri.lelli@arm.com \
    --cc=kernellwp@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@unitn.it \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=wanpeng.li@hotmail.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