From: Ingo Molnar <mingo@elte.hu>
To: Sven Dietrich <sdietrich@mvista.com>
Cc: Daniel Walker <dwalker@mvista.com>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, abatyrshin@ru.mvista.com,
amakarov@ru.mvista.com, emints@ru.mvista.com,
ext-rt-dev@mvista.com, hzhang@ch.mvista.com, yyang@ch.mvista.com,
"Witold. Jaworski@Unibw-Muenchen. De"
<witold.jaworski@unibw-muenchen.de>,
arnd.heursch@unibw-muenchen.de
Subject: Re: [ANNOUNCE] Linux 2.6 Real Time Kernel
Date: Tue, 12 Oct 2004 07:50:29 +0200 [thread overview]
Message-ID: <20041012055029.GB1479@elte.hu> (raw)
In-Reply-To: <EOEGJOIIAIGENMKBPIAECEIEDKAA.sdietrich@mvista.com>
* Sven Dietrich <sdietrich@mvista.com> wrote:
> > But, there is a 'correctness' _minimum_ set of spinlocks that _must_ be
> > raw spinlocks - this i tried to map in the -T4 patch. The patch does run
> > on SMP systems for example. (it was developed as an SMP kernel - in fact
> > i never compiled it as UP :-|.) If code has per-CPU or preemption
> > assumptions then there is no choice but to make it a raw spinlock, until
> > those assumptions are fixed.
> The grunt work is in identifying those problem areas and coming up
> with elegant, low-impact solutions. RCU locks is one example as
> mentioned before. We had a fix to serialize RCU access, but weren't
> happy with that. We were hoping to get some input on this, but these
> problems seem to show up more readily on slow systems (we are also
> testing with a bunch of old P1, P2 and K6 boxes all far sub 1 GHz)
identifying problem areas is near 100% automatic if you look at -T5: all
illegal sleeps and illegal smp_processor_id() assumptions are reported
when they happen. That's how i identified & fixed the core 90 locks in
the first wave, in just a couple of hours. The only minor annoyance when
doing a conversion is the inflexibility of SPIN_LOCK_UNLOCKED and
RW_LOCK_UNLOCKED initializer. If it werent for the initializers then a
'conversion' would be a matter of a 2-line change, the change of the
prototype and the change of the definition. Now it's a 3-line change
most of the time - still very fast and painless.
regarding RCU serialization - i think that is the way to go - i dont
think there is any sensible way to extend RCU to a fully preempted
model, RCU is all about per-CPU-ness and per-CPU-ness is quite limited
in a fully preemptible model.
could you send those RCU patches (no matter how incomplete/broken)? It's
the main issue that causes the dcache_lock to be raw still. (and a
number of dependent locks: fs-writeback.c, inode.c, etc.) We can make
those RCU changes not impact the normal !PREEMPT_REALTIME locking so it
might have a chance for upstream merging as well.
> I was making this observation: One can't look at an arbitrary piece of
> code and tell if it will be a spinlock or a mutex. One has to go look
> elsewhere. In the spin_undefs case one can look the top of the file
> and check for it, in the LOCK_OPS case, you have to call up the data
> structure declaration.
ok, i now understand what you mean. The way i drove it wasnt really via
code review but via: 'compile kernel, look at the bootlogs, fix the
first lock reported, repeat' iterations. This was much easier and much
more reliable than trying to figure out lock dependencies from the
source. The turnaround for a single lock was 2-3 minutes in the typical
case, allowing the conversion of 90 locks in a couple of hours.
> > > There are a whole lot of caveats and race conditions that have not yet
> > > been unearthed by the brief LKML testing. [...]
> >
> > actually, have you tried your patchset on an SMP box? As far as i can
> > see the locking in it ignores SMP issues _completely_, which makes the
> > choice of locks much less useful.
>
> We stated that its been tested minimally on SMP. That means we have
> had it up and running and found it to be unstable. I fully agree that
> SMP is the superset to get it working on, and that PMutex is not
> perfect at this point.
it's not just the problem of PMutex - i believe it's mainly the plain
inadequacy of the 30 raw locks you have identified - and identifying the
locks is the bigger work, not the semaphore implementation. I'm now at
90 locks (20% of all locking in this .config) and that's just to quiet
the DEBUG_PREEMPT violations on my testboxes.
and no matter how well UP works, to fix SMP one has to 'cover' all the
necessary locks first before fixing it, which (drastic) increase in raw
locks invalidates most of the UP efforts of getting rid of raw locks.
That's why i decided to go for SMP primarily - didnt see much point in
going for UP.
> We will take a look at the T5 patch and see what we can do about PI
> for the system semaphore, but I am not sure how portable it would be
> without also touching the assembly. FWIW PMutex is already based in
> part on the system semaphore, so we might get similar problems when
> porting elsewhere.
there are in-C variants of Linux mutexes and rw-semaphores in the kernel
source, so worst-case we could just make use of them in the
PREEMPT_REALTIME case. I'm not a big fan of assembly optimizations (or
having to touch assembly optimizations) at an early stage like this.
Ingo
next prev parent reply other threads:[~2004-10-12 5:49 UTC|newest]
Thread overview: 96+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-09 5:59 Sven-Thorsten Dietrich
2004-10-09 6:40 ` Lee Revell
2004-10-09 7:33 ` Daniel Walker
2004-10-09 7:42 ` Lee Revell
2004-10-09 23:40 ` Matthias Urlichs
2004-10-09 8:52 ` Lee Revell
2004-10-09 23:20 ` Dave Hansen
2004-10-09 23:24 ` Lee Revell
2004-10-09 10:51 ` Måns Rullgård
2004-10-09 13:15 ` Måns Rullgård
2004-10-09 21:20 ` Lee Revell
2004-10-09 21:35 ` Måns Rullgård
2004-10-09 21:37 ` Lee Revell
2004-10-09 21:45 ` Måns Rullgård
2004-10-09 21:55 ` Lee Revell
2004-10-09 22:21 ` Måns Rullgård
2004-10-09 23:52 ` Lee Revell
2004-10-10 0:05 ` Måns Rullgård
2004-10-10 0:45 ` Lee Revell
2004-10-10 1:05 ` Måns Rullgård
2004-10-10 1:09 ` Lee Revell
2004-10-10 0:43 ` Micha Feigin
2004-10-10 1:08 ` Måns Rullgård
2004-10-09 17:41 ` Karim Yaghmour
2004-10-09 18:30 ` Lee Revell
2004-10-09 21:26 ` stefan.eletzhofer
2004-10-09 19:30 ` Lee Revell
2004-10-09 19:38 ` Måns Rullgård
2004-10-09 21:38 ` stefan.eletzhofer
2004-10-09 19:47 ` Lee Revell
2004-10-09 20:11 ` Karim Yaghmour
2004-10-09 20:14 ` Lee Revell
2004-10-09 20:53 ` Karim Yaghmour
2004-10-09 20:59 ` Lee Revell
2004-10-09 20:20 ` Robert Love
2004-10-09 20:25 ` Lee Revell
2004-10-10 1:15 ` Lee Revell
2004-10-10 8:46 ` Ingo Molnar
2004-10-10 19:41 ` Daniel Walker
2004-10-10 19:46 ` Ingo Molnar
2004-10-10 21:20 ` Andrew Morton
2004-10-10 21:59 ` Ingo Molnar
2004-10-11 17:53 ` Daniel Walker
2004-10-11 20:49 ` Ingo Molnar
2004-10-11 21:44 ` Sven Dietrich
2004-10-11 21:54 ` Ingo Molnar
2004-10-11 23:05 ` Sven Dietrich
2004-10-12 5:50 ` Ingo Molnar [this message]
2004-10-14 5:09 ` Dipankar Sarma
2004-10-14 7:18 ` Ingo Molnar
2004-10-15 14:59 ` Paul E. McKenney
2004-10-15 15:45 ` Ingo Molnar
2004-10-15 16:40 ` Paul E. McKenney
2004-10-15 16:45 ` Paul E. McKenney
2004-10-17 17:12 ` Ingo Molnar
2004-10-12 18:50 ` Daniel Walker
2004-10-12 19:46 ` [Ext-rt-dev] " Thomas Gleixner
2004-10-12 20:31 ` Sven Dietrich
2004-10-12 20:37 ` Thomas Gleixner
2004-10-13 0:30 ` George Anzinger
2004-10-12 21:12 ` Bill Huey
2004-10-12 21:24 ` Bill Huey
2004-10-12 21:32 ` Thomas Gleixner
2004-10-12 23:13 ` Bill Huey
2004-10-12 21:41 ` Sven Dietrich
2004-10-12 22:57 ` Bill Huey
2004-10-12 23:17 ` Adam Heath
2004-10-12 23:36 ` Lee Revell
2004-10-12 23:25 ` Thomas Gleixner
2004-10-13 2:02 ` K.R. Foley
2004-10-13 13:39 ` Martijn Sipkema
2004-10-13 13:26 ` La Monte H.P. Yarroll
2004-10-13 15:04 ` Martijn Sipkema
2004-10-13 14:55 ` Kurt Wall
2004-10-13 14:52 ` Christoph Hellwig
2004-10-13 15:56 ` Lee Revell
2004-10-13 16:13 ` Robert Love
2004-10-13 17:14 ` Martijn Sipkema
2004-10-13 3:55 ` Bill Huey
2004-10-12 22:00 ` Thomas Gleixner
2004-10-12 22:36 ` Bill Huey
2004-10-12 23:10 ` Thomas Gleixner
2004-10-12 23:33 ` Bill Huey
2004-10-12 23:37 ` Thomas Gleixner
2004-10-12 23:52 ` Bill Huey
2004-10-13 0:59 ` Valdis.Kletnieks
2004-10-10 12:21 ` John Richard Moser
2004-10-10 17:26 ` Lee Revell
2004-10-10 18:45 ` John Richard Moser
2004-10-10 20:20 ` Ingo Molnar
2004-10-10 20:44 ` John Richard Moser
2004-10-10 17:29 ` Daniel Walker
2004-10-09 11:38 John Hedditch
2004-10-09 22:54 Sven Dietrich
2004-10-11 15:28 Vadim Lebedev
2004-10-11 15:50 ` Eugeny S. Mints
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=20041012055029.GB1479@elte.hu \
--to=mingo@elte.hu \
--cc=abatyrshin@ru.mvista.com \
--cc=akpm@osdl.org \
--cc=amakarov@ru.mvista.com \
--cc=arnd.heursch@unibw-muenchen.de \
--cc=dwalker@mvista.com \
--cc=emints@ru.mvista.com \
--cc=ext-rt-dev@mvista.com \
--cc=hzhang@ch.mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sdietrich@mvista.com \
--cc=witold.jaworski@unibw-muenchen.de \
--cc=yyang@ch.mvista.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
all inboxes | Powered by JetHome®