All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Kristian Benoit <kbenoit@opersys.com>
Cc: linux-kernel@vger.kernel.org, paulmck@us.ibm.com, bhuey@lnxw.com,
	tglx@linutronix.de, karim@opersys.com, pmarques@grupopie.com,
	bruce@andrew.cmu.edu, nickpiggin@yahoo.com.au, ak@muc.de,
	sdietrich@mvista.com, dwalker@mvista.com, hch@infradead.org,
	akpm@osdl.org, rpm@xenomai.org
Subject: Re: PREEMPT_RT and I-PIPE: the numbers, part 4
Date: Mon, 11 Jul 2005 07:24:13 +0200	[thread overview]
Message-ID: <20050711052413.GA13293@elte.hu> (raw)
In-Reply-To: <42CF05BE.3070908@opersys.com>


* Kristian Benoit <kbenoit@opersys.com> wrote:

[...]
> "plain" run:
> 
> Measurements   |   Vanilla   |  preempt_rt    |   ipipe
> ---------------+-------------+----------------+-------------
> fork           |      97us   |   91us (-6%)   |  101us (+4%)
> mmap           |     776us   |  629us (-19%)  |  794us (+2%)

some of you have wondered how it's possible that the PREEMPT_RT kernel 
is _faster_ than the vanilla kernel in these two metrics.

I've done some more profiling, and one reason is kmap_atomic(). As i 
pointed out in an earlier mail, in your tests you not only had HIGHMEM64 
enabled, but also HIGHPTE, which is a heavy kmap_atomic() user. [and 
which is an option meant for systems with 8GB or more RAM, not the 
typical embedded target.]

kmap_atomic() is a pretty preemption-unfriendly per-CPU construct, which 
under PREEMPT_RT had to be changed and was mapped into kmap(). The 
performance advantage comes from the caching built into kmap() and not 
having to do per-page invlpg calls. (which can be pretty slow, 
expecially on highmem64) The 'mapping kmap_atomic into kmap' technique 
is perfectly fine under PREEMPT_RT because all kernel code is 
preemptible, but it's not really possible in the vanilla kernel due to 
the fundamental non-preemptability of interrupts, the preempt-off-ness 
of the mmu_gather mechanism, the atomicity of the ->page_table_lock 
spinlock, etc.

so this is a case of 'fully preemptible beats non-preemptible due to 
flexibility', but it should be more of an exception than the rule, 
because generally the fully preemptible kernel tries to be 1:1 identical 
to the vanilla kernel. But it's an interesting phenomenon from a 
conceptual angle nevertheless.

	Ingo

      parent reply	other threads:[~2005-07-11  5:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-08 23:01 PREEMPT_RT and I-PIPE: the numbers, part 4 Kristian Benoit
2005-07-09  1:28 ` Karim Yaghmour
2005-07-09  7:19 ` Ingo Molnar
2005-07-09 15:39   ` Karim Yaghmour
2005-07-09 15:53     ` Karim Yaghmour
2005-07-09 15:53       ` Karim Yaghmour
2005-07-11  7:05     ` Ingo Molnar
2005-07-11 11:25       ` Karim Yaghmour
2005-07-09 17:22   ` Daniel Walker
2005-07-09 23:37     ` Bill Huey
2005-07-09  9:01 ` Paul Rolland
2005-07-09 14:47   ` Karim Yaghmour
2005-07-09 15:22   ` Ingo Molnar
2005-07-11  5:24 ` Ingo Molnar [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=20050711052413.GA13293@elte.hu \
    --to=mingo@elte.hu \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=bhuey@lnxw.com \
    --cc=bruce@andrew.cmu.edu \
    --cc=dwalker@mvista.com \
    --cc=hch@infradead.org \
    --cc=karim@opersys.com \
    --cc=kbenoit@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=paulmck@us.ibm.com \
    --cc=pmarques@grupopie.com \
    --cc=rpm@xenomai.org \
    --cc=sdietrich@mvista.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.