lkml.org 
[lkml]   [2020]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sched: Reenable interrupts in do sched_yield()
On Tue, 20 Oct 2020 20:02:55 +0200
Thomas Gleixner <tglx@linutronix.de> wrote:

> On Tue, Oct 20 2020 at 11:38, Steven Rostedt wrote:
> > On Tue, 20 Oct 2020 16:46:55 +0200
> > Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> >> - /*
> >> - * Since we are going to call schedule() anyway, there's
> >> - * no need to preempt or enable interrupts:
> >
> > I think the above comment still makes sense, just needs to be tweeked:
> >
> > /*
> > * Since we are going to call schedule() anyway, there's
> > * no need to allow preemption after releasing the rq lock.
> >> - */
> >
> > Especially, since we are now enabling interrupts, which is likely to
> > trigger a preemption.
>
> sched_preempt_enable_no_resched() still enables preemption. It just
> avoids the check. And it still allows preemption when an interrupt
> triggering preemption happens between sched_preempt_enable_no_resched()
> and __schedule() disabling preemption/interrupts.
>
> So no, your new variant is just differently bogus and misleading.

What I wrote wasn't exactly what I meant. What I meant to have:

/*
* Since we are going to call schedule() anyways, there's
* no need to do the preemption check when the rq_lock is released.
*/

That is, to document why we have the preempt_disable() before the unlock:

preempt_disable();
rq_unlock_irq(rq, &rf);
sched_preempt_enable_no_resched();


-- Steve

\
 
 \ /
  Last update: 2020-10-20 22:09    [W:0.088 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site