linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: linux-kernel@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Julien Thierry <julien.thierry@arm.com>,
	linux-doc@vger.kernel.org
Subject: [RFC PATCH 3/3] sched/Documentation: Point out use of preempt_schedule_irq()
Date: Thu, 31 Jan 2019 18:23:39 +0000	[thread overview]
Message-ID: <20190131182339.9835-4-valentin.schneider@arm.com> (raw)
In-Reply-To: <20190131182339.9835-1-valentin.schneider@arm.com>

Since there are a few archs out there that call preempt_schedule_irq()
within a need_resched() loop, point out that it's not needed.

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: linux-doc@vger.kernel.org
---
 Documentation/scheduler/sched-arch.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/scheduler/sched-arch.txt b/Documentation/scheduler/sched-arch.txt
index a2f27bbf2cba..ae41a94da700 100644
--- a/Documentation/scheduler/sched-arch.txt
+++ b/Documentation/scheduler/sched-arch.txt
@@ -59,6 +59,16 @@ Your cpu_idle routines need to obey the following rules:
 arch/x86/kernel/process.c has examples of both polling and
 sleeping idle functions.
 
+Kernel preemption
+=================
+When returning from interrupt context, you should call either of
+preempt_schedule() or preempt_schedule_irq() if preemption is enabled
+and need_resched() is true.
+
+Note that, unlike preempt_schedule(), preempt_schedule_irq() handles the
+enabling and disabling of IRQs. Since it also loops on need_resched(),
+you don't need to have that loop in your arch code. See
+arch/arm64/kernel/entry.S for an example.
 
 Possible arch/ problems
 =======================
--
2.20.1


  parent reply	other threads:[~2019-01-31 18:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 18:23 [RFC PATCH 0/3] arm/arm64: entry: Remove need_resched() loop Valentin Schneider
2019-01-31 18:23 ` [RFC PATCH 1/3] arm64: entry: Remove unneeded " Valentin Schneider
2019-02-01  8:46   ` Julien Thierry
2019-02-01 10:21   ` Will Deacon
2019-02-04 16:55   ` Catalin Marinas
2019-01-31 18:23 ` [RFC PATCH 2/3] ARM: " Valentin Schneider
2019-02-01  8:49   ` Julien Thierry
2019-01-31 18:23 ` Valentin Schneider [this message]
2019-02-01  8:45   ` [RFC PATCH 3/3] sched/Documentation: Point out use of preempt_schedule_irq() Julien Thierry
2019-02-01 10:27     ` Valentin Schneider

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=20190131182339.9835-4-valentin.schneider@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=corbet@lwn.net \
    --cc=julien.thierry@arm.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --subject='Re: [RFC PATCH 3/3] sched/Documentation: Point out use of preempt_schedule_irq()' \
    /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

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox