From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Ard Biesheuvel <ardb@kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-arch <linux-arch@vger.kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Valentin Schneider <valentin.schneider@arm.com>,
Richard Henderson <rth@twiddle.net>,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
Matt Turner <mattst88@gmail.com>,
alpha <linux-alpha@vger.kernel.org>,
Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
linux-um <linux-um@lists.infradead.org>,
Brian Cain <bcain@codeaurora.org>,
linux-hexagon@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-m68k <linux-m68k@lists.linux-m68k.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>
Subject: Re: [patch 00/13] preempt: Make preempt count unconditional
Date: Tue, 15 Sep 2020 10:39:48 +0200 [thread overview]
Message-ID: <87bli75t7v.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <CAHk-=wj0eUuVQ=hRFZv_nY7g5ZLt7Fy3K7SMJL0ZCzniPtsbbg@mail.gmail.com>
On Mon, Sep 14 2020 at 15:24, Linus Torvalds wrote:
> On Mon, Sep 14, 2020 at 2:55 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>>
>> Yes it does generate better code, but I tried hard to spot a difference
>> in various metrics exposed by perf. It's all in the noise and I only
>> can spot a difference when the actual preemption check after the
>> decrement
>
> I'm somewhat more worried about the small-device case.
I just checked on one of my old UP ARM toys which I run at home. The .text
increase is about 2% (75k) and none of the tests I ran showed any
significant difference. Couldn't verify with perf though as the PMU on
that piece of art is unusable.
> That said, the diffstat certainly has its very clear charm, and I do
> agree that it makes things simpler.
>
> I'm just not convinced people should ever EVER do things like that "if
> (preemptible())" garbage. It sounds like somebody is doing seriously
> bad things.
OTOH, having a working 'preemptible()' or maybe better named
'can_schedule()' check makes tons of sense to make decisions about
allocation modes or other things.
We're currently looking through all of in_atomic(), in_interrupt()
etc. usage sites and quite some of them are historic and have the clear
intent of checking whether the code is called from task context or
hard/softirq context. Lots of them are completely broken or just work by
chance.
But there is clearly historic precendence that context checks are
useful, but they only can be useful if we have a consistent mechanism
which works everywhere.
Of course we could mandate that every interface which might be called
from one or the other context has a context argument or provides two
variants of the same thing. But I'm not really convinced whether that's
a win over having a consistent and reliable set of checks.
Thanks,
tglx
next prev parent reply other threads:[~2020-09-15 8:39 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 20:42 [patch 00/13] preempt: Make preempt count unconditional Thomas Gleixner
2020-09-14 20:42 ` [patch 01/13] lib/debug: Remove pointless ARCH_NO_PREEMPT dependencies Thomas Gleixner
2020-09-14 20:42 ` [patch 02/13] preempt: Make preempt count unconditional Thomas Gleixner
2020-09-14 20:42 ` [patch 03/13] preempt: Clenaup PREEMPT_COUNT leftovers Thomas Gleixner
2020-09-16 10:56 ` Valentin Schneider
2020-09-14 20:42 ` [patch 04/13] lockdep: " Thomas Gleixner
2020-09-15 16:11 ` Will Deacon
2020-09-14 20:42 ` [patch 05/13] mm/pagemap: " Thomas Gleixner
2020-09-15 0:52 ` kernel test robot
2020-09-14 20:42 ` [patch 06/13] locking/bitspinlock: " Thomas Gleixner
2020-09-15 16:10 ` Will Deacon
2020-09-14 20:42 ` [patch 07/13] uaccess: " Thomas Gleixner
2020-09-14 20:42 ` [patch 08/13] sched: " Thomas Gleixner
2020-09-16 10:56 ` Valentin Schneider
2020-09-14 20:42 ` [patch 09/13] ARM: " Thomas Gleixner
2020-09-14 20:42 ` [patch 10/13] xtensa: " Thomas Gleixner
2020-09-14 20:42 ` [patch 11/13] drm/i915: " Thomas Gleixner
2020-09-14 20:42 ` [patch 12/13] rcutorture: " Thomas Gleixner
2020-09-14 20:42 ` [patch 13/13] preempt: Remove PREEMPT_COUNT from Kconfig Thomas Gleixner
2020-09-14 20:54 ` [patch 00/13] preempt: Make preempt count unconditional Steven Rostedt
2020-09-14 20:59 ` Linus Torvalds
2020-09-14 21:55 ` Thomas Gleixner
2020-09-14 22:24 ` Linus Torvalds
2020-09-14 22:37 ` Linus Torvalds
2020-09-15 3:21 ` [PATCH] crypto: lib/chacha20poly1305 - Set SG_MITER_ATOMIC unconditionally Herbert Xu
2020-09-15 6:20 ` [patch 00/13] preempt: Make preempt count unconditional Ard Biesheuvel
2020-09-15 6:22 ` Herbert Xu
2020-09-15 6:39 ` Linus Torvalds
2020-09-15 7:24 ` Thomas Gleixner
2020-09-15 17:29 ` Linus Torvalds
2020-09-15 8:39 ` Thomas Gleixner [this message]
2020-09-15 17:35 ` Linus Torvalds
2020-09-15 19:57 ` Thomas Gleixner
2020-09-16 18:34 ` Linus Torvalds
2020-09-16 7:37 ` Daniel Vetter
2020-09-16 15:29 ` Paul E. McKenney
2020-09-16 18:32 ` Linus Torvalds
2020-09-16 20:43 ` Paul E. McKenney
2020-09-17 6:38 ` Ard Biesheuvel
2020-09-16 20:29 ` Daniel Vetter
2020-09-16 20:58 ` Paul E. McKenney
2020-09-16 21:43 ` Daniel Vetter
2020-09-16 22:39 ` Paul E. McKenney
2020-09-17 7:52 ` Daniel Vetter
2020-09-17 16:28 ` Paul E. McKenney
2020-09-29 8:19 ` Michal Hocko
2020-09-29 9:00 ` Daniel Vetter
2020-09-29 14:54 ` Michal Hocko
2020-09-16 19:23 ` Matthew Wilcox
2020-09-16 20:48 ` Paul E. McKenney
2020-09-15 17:25 ` Paul E. McKenney
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=87bli75t7v.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=anton.ivanov@cambridgegreys.com \
--cc=ardb@kernel.org \
--cc=bcain@codeaurora.org \
--cc=bigeasy@linutronix.de \
--cc=geert@linux-m68k.org \
--cc=herbert@gondor.apana.org.au \
--cc=ink@jurassic.park.msu.ru \
--cc=jdike@addtoit.com \
--cc=juri.lelli@redhat.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-um@lists.infradead.org \
--cc=mattst88@gmail.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=richard@nod.at \
--cc=rth@twiddle.net \
--cc=torvalds@linux-foundation.org \
--cc=valentin.schneider@arm.com \
/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;
as well as URLs for NNTP newsgroup(s).