All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: Re: sched: Reenable interrupts in do sched_yield()
Date: Wed, 21 Oct 2020 10:07:14 -0400	[thread overview]
Message-ID: <20201021100714.5ba25a96@gandalf.local.home> (raw)
In-Reply-To: <87h7qo6ntx.fsf@nanos.tec.linutronix.de>

On Wed, 21 Oct 2020 09:27:22 +0200
Thomas Gleixner <tglx@linutronix.de> wrote:

> On Tue, Oct 20 2020 at 16:07, Steven Rostedt wrote:
> > On Tue, 20 Oct 2020 20:02:55 +0200
> > Thomas Gleixner <tglx@linutronix.de> wrote:
> > 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:  
> 
> which is pretty obvious, but I let Peter decide on that.

To us maybe, but I like to have comments that explain why things are done to
average people. ;-)

If I go to another kernel developer outside the core kernel, would they know
why there's a preempt_disable() there?


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


Not everyone knows that the rq_unlock_irq() would trigger a schedule if an
interrupt happened as soon as irqs were enabled again and need_resched was
set.

-- Steve

  reply	other threads:[~2020-10-21 14:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 14:46 sched: Reenable interrupts in do sched_yield() Thomas Gleixner
2020-10-20 15:38 ` Steven Rostedt
2020-10-20 18:02   ` Thomas Gleixner
2020-10-20 20:07     ` Steven Rostedt
2020-10-21  7:27       ` Thomas Gleixner
2020-10-21 14:07         ` Steven Rostedt [this message]
2020-12-23 12:02           ` Qais Yousef
2020-10-29 10:51 ` [tip: sched/core] sched: Reenable interrupts in do_sched_yield() tip-bot2 for Thomas Gleixner

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=20201021100714.5ba25a96@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.