From: Valentin Schneider <valentin.schneider@arm.com>
To: Julien Thierry <julien.thierry@arm.com>, 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>,
linux-doc@vger.kernel.org
Subject: Re: [RFC PATCH 3/3] sched/Documentation: Point out use of preempt_schedule_irq()
Date: Fri, 1 Feb 2019 10:27:54 +0000 [thread overview]
Message-ID: <53775bec-67cf-3b5e-796f-0a09993d1628@arm.com> (raw)
In-Reply-To: <cd1b1ea6-7b5f-0468-1512-eaabba77a98a@arm.com>
On 01/02/2019 08:45, Julien Thierry wrote:
[...]
>> +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.
>> +
>
> I don't think preempt_schedule() is really an option for a return from
> interrupt. First thing preempt_schedule() does is:
>
> if (likely(!preemptible()))
> return;
>
> And preemptible() is:
>
> preempt_count() == 0 && !irqs_disabled()
>
> Generally on return from interrupt context interrupts are disabled, so
> we would never be preemptible() and preempt_schedule() would just do
> nothing.
>
> Unless I'm missing something.
>
No, I think you're right. The main reason I still mentioned it here is to
be conservative, although I must admit I've started confusing what we
have vs what we used to have since my dive into the history.
If I look at some archs that don't use preempt_schedule_irq() (e.g. alpha,
unicore32), they seem to be calling schedule() directly - but I don't see
any (*current*) user of preempt_schedule() on interrupt return.
preempt_schedule() still has this comment attached to it:
* this is the entry point to schedule() from in-kernel preemption
* off of preempt_enable. Kernel preemptions off return from interrupt
* occur there and call schedule directly.
So I might just remove the mention to preempt_schedule() in the doc and
also change the comment.
Thanks,
Valentin
prev parent reply other threads:[~2019-02-01 10:28 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 ` [RFC PATCH 3/3] sched/Documentation: Point out use of preempt_schedule_irq() Valentin Schneider
2019-02-01 8:45 ` Julien Thierry
2019-02-01 10:27 ` Valentin Schneider [this message]
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=53775bec-67cf-3b5e-796f-0a09993d1628@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 \
/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
all inboxes | Powered by JetHome®