public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: linux-kernel@vger.kernel.org
Cc: Lee Revell <rlrevell@joe-job.com>, Mark_H_Johnson@RAYTHEON.COM
Subject: [patch] voluntary-preempt-2.6.9-rc1-bk4-Q0
Date: Sat, 28 Aug 2004 14:03:09 +0200	[thread overview]
Message-ID: <20040828120309.GA17121@elte.hu> (raw)
In-Reply-To: <20040824061459.GA29630@elte.hu>


i've uploaded the -Q0 patch:

  http://redhat.com/~mingo/voluntary-preempt/voluntary-preempt-2.6.9-rc1-bk4-Q0

note that since -bk4 doesnt exist yet, i've uploaded a patch that brings
2.6.8.1 up to BK-curr:

  http://redhat.com/~mingo/voluntary-preempt/diff-bk-040828-2.6.8.1.bz2

apply this patch to 2.6.8.1 before applying the -Q0 patch.

Changes:

there are a number of fundamental changes in the -Q0, of both structural
and functional nature.

Structural changes:

Linus' current BK tree (what will be 2.6.9-rc1-bk4) has just merged most
of the might_sleep() improvements we did for -mm and a bunch of other
changes that were part of the voluntary-preempt patchset. So i've
started a pre-merge cleanup of the voluntary-preempt patchset, to be
able to merge as much of the remaining stuff upstream as possible. This
doesnt (necessarily) mean voluntary-preempt itself will be merged, it
means that the independent latency improvements move out of the
voluntary-preemption umbrella and will go upstream.

About the cleanup:

Firstly, the user controls have changed. There are now 4 independent
flags in /proc/sys/kernel/: kernel_preemption, voluntary_preemption,
softirq_preemption and hardirq_preemption - each default to a value of 1
(enabled). NOTE: levels 2,3 for voluntary_preemption is not valid
anymore, each of the flags can be 0 or 1. The flags control what their
name says, for best latencies one should keep all of them enabled.

Similarly, there are 4 independent options for the .config:
CONFIG_PREEMPT, CONFIG_PREEMPT_VOLUNTARY, CONFIG_PREEMPT_SOFTIRQS and
CONFIG_PREEMPT_HARDIRQS. (In theory all of these options should compile
independently, but i've only tested all-enabled so far.)

Internally, the voluntary_ prefixed conditional reschedule variants were
replaced by the existing cond_resched(), cond_resched_lock(),
need_resched()/etc. infrastructure.

Functional changes:

i took another look at SMP latencies, the last larger chunk of code that
produced millisec-category latencies. CONFIG_PREEMPT tries to solve some
of the SMP issues but there were still lots of problems remaining: main
problem area is spinlocks nested at multiple levels. If a piece of code
(e.g. the MM or ext3's journalling code) does the following:

	spin_lock(&spinlock_1);
	...
	spin_lock(&spinlock_2);
	...

then even with CONFIG_PREEMPT enabled, current kernels may spin on
spinlock_2 indefinitely. A number of critical sections break their long
paths by using cond_resched_lock(), but this does not break the path on
SMP, because need_resched() is not set in the above case.

(The -mm kernel introduced a couple of patches that try to drop
spinlocks unconditionally at a high frequency: but besides being a
kludge it's also a performance problem, we keep
dropping/waiting/retaking locks quite frequently. That solution also
doesnt solve the problem of cond_resched_lock() not working on SMP.)

to solve the problem i've introduced a new spinlock field,
lock->break_lock, which signals towards the holding CPU that a
spinlock-break is requested by another CPU. This field is only set if a
CPU is spinning in __preempt_spin_lock [at any locking depth], so the
default overhead is zero. I've extended cond_resched_lock() to check for
this flag - in this case we can also save a reschedule. I've added the
lock_need_resched(lock) and need_lockbreak(lock) methods to check for
the need to break out of a critical section.

preliminary results on a dual x86 box show a dramatic reduction in
latencies on SMP - where there used to be 5-10 msec latencies there are
close-to-UP latencies now. But it needs more testing.

the -Q0 patch also adds a number of lock-breaks that are part of the -mm
tree: e.g. the PTY lock-break.

please re-send any patches that i havent merged yet, and re-report
latencies that still occur with -Q0.

	Ingo

  parent reply	other threads:[~2004-08-28 12:02 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-23 22:18 [patch] PPC/PPC64 port of voluntary preempt patch Scott Wood
2004-08-24  6:14 ` [patch] voluntary-preempt-2.6.8.1-P9 Ingo Molnar
2004-08-24 17:43   ` K.R. Foley
2004-08-24 20:32     ` Lee Revell
2004-08-24 20:53       ` Scott Wood
2004-08-24 19:20   ` K.R. Foley
2004-08-24 22:47   ` Lee Revell
2004-08-25  2:00   ` Lee Revell
2004-08-25  3:17   ` K.R. Foley
2004-08-25  3:22     ` Lee Revell
2004-08-25 14:34       ` K.R. Foley
2004-08-25 16:00       ` K.R. Foley
2004-08-25  3:26   ` K.R. Foley
2004-08-25  9:58   ` [patch] voluntary-preempt-2.6.8.1-P9 : oprofile latency at 3.3ms P.O. Gaillard
2004-08-26 21:39   ` [patch] voluntary-preempt-2.6.8.1-P9 Lee Revell
2004-08-27 16:54     ` Lee Revell
2004-08-28  7:37       ` Ingo Molnar
2004-08-28 15:10         ` Lee Revell
2004-08-28 12:14     ` Ingo Molnar
2004-08-30  9:27       ` voluntary-preempt-2.6.8.1-P9 : big latency when logging on console P.O. Gaillard
2004-08-30  9:41         ` Ingo Molnar
2004-08-30 12:25           ` P.O. Gaillard
2004-08-30  9:48       ` [patch] voluntary-preempt-2.6.8.1-P9 : a few submillisecond latencies P.O. Gaillard
2004-08-28 12:03   ` Ingo Molnar [this message]
2004-08-28 16:18     ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q0 Felipe Alfaro Solana
2004-08-28 16:50       ` K.R. Foley
2004-08-28 17:52         ` Lee Revell
2004-08-28 19:44           ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q2 Ingo Molnar
2004-08-28 20:01             ` Lee Revell
2004-08-28 20:04               ` Ingo Molnar
2004-08-28 20:08                 ` Lee Revell
2004-08-28 20:10             ` Daniel Schmitt
2004-08-28 20:31               ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q3 Ingo Molnar
2004-08-28 21:10                 ` Lee Revell
2004-08-28 21:13                   ` Ingo Molnar
2004-08-28 21:16                     ` Lee Revell
2004-08-28 23:51                       ` Lee Revell
2004-08-29  2:35                         ` Lee Revell
2004-08-29  5:43                           ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q4 Ingo Molnar
2004-08-29  6:57                             ` Lee Revell
2004-08-29 18:01                               ` Ingo Molnar
2004-08-29 19:06                               ` Ingo Molnar
2004-08-30  0:47                                 ` K.R. Foley
2004-08-30  3:42                                   ` K.R. Foley
2004-08-30 13:06                                   ` Alan Cox
2004-08-30 17:37                                     ` Ingo Molnar
2004-08-31 16:39                                     ` K.R. Foley
2004-08-30  9:06                             ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5 Ingo Molnar
2004-08-30 14:25                               ` Thomas Charbonnel
2004-08-30 18:00                                 ` Ingo Molnar
2004-08-31 19:23                                   ` Thomas Charbonnel
2004-08-31 19:30                                     ` Ingo Molnar
2004-08-31 19:45                                       ` Thomas Charbonnel
2004-08-31  6:40                               ` Lee Revell
2004-08-31  6:53                                 ` Ingo Molnar
2004-08-31 23:03                                   ` Lee Revell
2004-09-01 15:52                                     ` Martin Josefsson
2004-09-01 21:15                                       ` Lee Revell
2004-09-01 21:30                                       ` Lee Revell
2004-08-31  7:06                                 ` Ingo Molnar
2004-08-31 19:21                                   ` Lee Revell
2004-08-31 19:37                                     ` Ingo Molnar
2004-08-31 19:47                                       ` Lee Revell
2004-08-31 19:51                                         ` Ingo Molnar
2004-08-31 20:09                                           ` Ingo Molnar
2004-08-31 20:10                                             ` Lee Revell
2004-08-31 20:14                                               ` Ingo Molnar
2004-08-31 20:20                                                 ` Ingo Molnar
2004-08-31 20:34                                                   ` Lee Revell
2004-08-31 20:39                                                     ` Ingo Molnar
2004-08-31 20:41                                                       ` Lee Revell
2004-08-31 17:40                               ` Peter Zijlstra
2004-09-01  1:43                               ` Lee Revell
2004-09-01  2:30                               ` Lee Revell
2004-09-01  7:27                               ` Lee Revell
2004-09-01  8:29                               ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q6 Ingo Molnar
2004-09-01 13:51                                 ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q7 Ingo Molnar
2004-09-01 17:09                                   ` Thomas Charbonnel
2004-09-01 19:03                                     ` K.R. Foley
2004-09-01 20:11                                     ` Peter Zijlstra
2004-09-01 20:16                                       ` Lee Revell
2004-09-01 20:53                                       ` K.R. Foley
     [not found]                                   ` <41367E5D.3040605@cybsft.com>
2004-09-02  5:37                                     ` Ingo Molnar
2004-09-02  5:40                                       ` Ingo Molnar
2004-08-30 12:52                   ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q3 Ingo Molnar
2004-08-29  7:40                 ` Matt Heler
2004-08-24 19:51 ` [patch] PPC/PPC64 port of voluntary preempt patch Scott Wood
2004-08-26  3:17   ` Lee Revell
2004-08-26 16:38     ` Scott Wood
2004-08-27  1:18     ` Fernando Pablo Lopez-Lezcano
2004-08-28 12:36   ` Ingo Molnar
2004-08-28 13:01     ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q1 Ingo Molnar
2004-08-30  1:06       ` Fernando Pablo Lopez-Lezcano

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=20040828120309.GA17121@elte.hu \
    --to=mingo@elte.hu \
    --cc=Mark_H_Johnson@RAYTHEON.COM \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlrevell@joe-job.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