lkml.org 
[lkml]   [2019]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 3/3] sched/Documentation: Point out use of preempt_schedule_irq()
Date
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
\
 
 \ /
  Last update: 2019-01-31 19:25    [W:0.070 / U:4.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site