public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>, Nick Piggin <npiggin@suse.de>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Avi Kivity <avi@redhat.com>,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: [benchmark] 1% performance overhead of paravirt_ops on native kernels
Date: Thu, 4 Jun 2009 08:02:14 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0906040736350.4880@localhost.localdomain> (raw)
In-Reply-To: <200906041554.37102.rusty@rustcorp.com.au>



On Thu, 4 Jun 2009, Rusty Russell wrote:
> >
> > Turn off HIGHMEM64G, please (and HIGHMEM4G too, for that matter - you
> > can't compare it to a no-highmem case).
> 
> Thanks, your point is demonstrated below.  I don't think HIGHMEM4G is 
> unreasonable for a distro tho, so I turned that on instead.

Well, I agree that HIGHMEM4G is a _reasonable_ thing to turn on.

The thing I disagree with is that it's at all valid to then compare to 
some all-software feature thing. HIGHMEM doesn't expand any esoteric 
capability that some people might use - it's about regular RAM for regular 
users.

And don't get me wrong - I don't like HIGHMEM. I detest the damn thing. I 
hated having to merge it, and I still hate it. It's a stupid, ugly, and 
very invasive config option. It's just that it's there to support a 
stupid, ugly and very annoying fundamental hardware problem.

So I think your minimum and maximum configs should at least _match_ in 
HIGHMEM. Limiting memory to not actually having any (with "mem=880M") will 
avoid the TLB flushing impact of HIGHMEM, which is clearly going to be the 
_bulk_ of the overhead, but HIGHMEM is still going to be noticeable on at 
least some microbenchmarks.

In other words, it's a lot like CONFIG_SMP, but at least CONFIG_SMP has a 
damn better reason for existing today than CONFIG_HIGHMEM.

That said, I suspect that now your context-switch test is likely no longer 
dominated by that thing, so looking at your numbers:

> minimal config: ~0.001280
> maximal config: ~0.002500	(with actual high mem)
> maximum config: ~0.001925     (with mem=880M)

and I think that change from 0.001280 - 0.001925 (rough averages by 
eye-balling it, I didn't actually calculate anything) is still quite 
interesting, but I do wonder how much of it ends up being due to just code 
generation issues for CONFIG_HIGHMEM and CONFIG_SMP.

> So we're paying a 48% overhead; microbenchmarks always suffer as code is added, 
> and we've added a lot of code with these options.

I do agree that microbenchmarks are interesting, and tend to show these 
kinds of things clearly. It's just that when you look at the scheduler, 
for example, something like SMP support is a _big_ issue, and even if we 
get rid of the worst synchronization overhead with "maxcpus=1" at least 
removing the "lock" prefixes, I'm not sure how relevant it is to say that 
the scheduler is slower with SMP support.

(The same way I don't think it's relevant or interesting to see that it's 
slower with HIGHMEM).

They are simply so fundamental features that the two aren't comparable. 
Why would anybody compare a UP scheduler with a SMP scheduler? It's simply 
not the same problem. What does it mean to say that one is 48% slower? 
That's like saying that a squirrell is 48% juicier than an orange - maybe 
it's true, but anybody who puts the two in a blender to compare them is 
kind of sick. The comparison is ugly and pointless.

Now, other feature comparisons are way more interesting. For example, if 
statistics gathering is a noticeable portion of the 48%, then that really 
is a very relevant comparison, since scheduler statistics is something 
that is in no way "fundamental" to the hardware base, and most people 
won't care.

So comparing a "scheduler statistics" overhead vs "minimal config" 
overhead is very clearly a sane thing to do. Now we're talking about a 
feature that most people - even if it was somehow hardware related - 
wouldn't use or care about.

IOW, even if it were to use hardware features (say, something like 
oprofile, which is at least partly very much about exposing actual 
physical features of the hardware), if it's not fundamental to the whole 
usage for a huge percentage of people, then it's a "optional feature", and 
seeing slowdown is a big deal.

Something like CONFIG_HIGHMEM* or CONFIG_SMP is not really what I'd ever 
call "optional feature", although I hope to Dog that CONFIG_HIGHMEM can 
some day be considered that some day.

		Linus

  parent reply	other threads:[~2009-06-04 15:04 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14  0:16 Performance overhead of paravirt_ops on native identified Jeremy Fitzhardinge
2009-05-14  1:10 ` H. Peter Anvin
2009-05-14  8:25   ` Peter Zijlstra
2009-05-14 14:05     ` H. Peter Anvin
2009-05-14 17:36   ` Jeremy Fitzhardinge
2009-05-14 17:50     ` H. Peter Anvin
2009-05-14  8:05 ` [Xen-devel] Performance overhead of paravirt_ops on nativeidentified Jan Beulich
2009-05-14  8:33   ` Peter Zijlstra
2009-05-14 17:45   ` Jeremy Fitzhardinge
2009-05-15  8:10     ` Jan Beulich
2009-05-15 18:50       ` Jeremy Fitzhardinge
2009-05-18  7:19         ` Jan Beulich
2009-05-20 22:42           ` Jeremy Fitzhardinge
2009-05-15 18:18 ` [tip:x86/urgent] x86: Fix performance regression caused by paravirt_ops on native kernels tip-bot for Jeremy Fitzhardinge
2009-05-21 22:42 ` Performance overhead of paravirt_ops on native identified Chuck Ebbert
2009-05-21 22:48   ` Jeremy Fitzhardinge
2009-05-21 23:10     ` H. Peter Anvin
2009-05-22  1:26     ` Xin, Xiaohui
2009-05-22  3:39       ` H. Peter Anvin
2009-05-22  4:27       ` Jeremy Fitzhardinge
2009-05-22  5:59         ` Xin, Xiaohui
2009-05-22 16:33           ` H. Peter Anvin
2009-05-22 22:44             ` Jeremy Fitzhardinge
2009-05-22 22:47               ` H. Peter Anvin
2009-05-25  9:15 ` [benchmark] 1% performance overhead of paravirt_ops on native kernels Ingo Molnar
2009-05-26 18:42   ` Jeremy Fitzhardinge
2009-05-28  6:17     ` Nick Piggin
2009-05-28 20:57       ` Jeremy Fitzhardinge
2009-05-30 10:23       ` Ingo Molnar
2009-06-02 14:18         ` Chris Mason
2009-06-02 14:49           ` Ulrich Drepper
2009-06-02 15:03             ` Chris Mason
2009-06-02 15:22               ` Ulrich Drepper
2009-06-02 16:20                 ` Chris Mason
2009-06-02 18:13                   ` Pekka Enberg
2009-06-02 18:06               ` Pekka Enberg
2009-06-02 18:27                 ` Chris Mason
2009-06-03  6:33             ` Jeremy Fitzhardinge
2009-06-02 19:14           ` Thomas Gleixner
2009-06-02 19:51             ` Chris Mason
2009-06-03 12:38         ` Rusty Russell
2009-06-03 16:09           ` Linus Torvalds
     [not found]             ` <200906041554.37102.rusty@rustcorp.com.au>
2009-06-04 15:02               ` Linus Torvalds [this message]
2009-06-04 21:52                 ` Dave McCracken
2009-06-05  7:31                   ` Gerd Hoffmann
2009-06-05 14:31                     ` Rusty Russell
2009-06-06 18:54                   ` Anders K. Pedersen
2009-06-05  4:46                 ` Rusty Russell
2009-06-05 14:54                   ` Linus Torvalds
2009-06-07  0:53                     ` Rusty Russell
2009-06-08 14:53                       ` Linus Torvalds
2009-06-09  9:39                 ` Nick Piggin
2009-06-09 11:17                   ` Ingo Molnar
2009-06-09 12:10                     ` Nick Piggin
2009-06-09 12:25                       ` Ingo Molnar
2009-06-09 12:42                         ` Nick Piggin
2009-06-09 12:56                         ` Avi Kivity
2009-06-09 15:18                         ` Linus Torvalds
2009-06-09 23:33                         ` Paul Mackerras
2009-06-10  1:26                           ` Ingo Molnar
2009-06-09 15:07                       ` Linus Torvalds
2009-06-09 15:09                     ` H. Peter Anvin
2009-06-09 18:06                       ` Linus Torvalds
2009-06-09 18:07                         ` Linus Torvalds
2009-06-09 22:48                           ` Matthew Garrett
2009-06-09 22:54                             ` H. Peter Anvin
2009-06-09 14:54                   ` Linus Torvalds
2009-06-09 14:57                     ` Ingo Molnar
2009-06-09 15:55                       ` Avi Kivity
2009-06-09 15:38                     ` Nick Piggin
2009-06-09 16:00                       ` Linus Torvalds
2009-06-09 16:21                         ` Nick Piggin
2009-06-09 16:26                           ` Linus Torvalds
2009-06-09 16:45                             ` Nick Piggin
2009-06-09 17:08                               ` Linus Torvalds
2009-06-10  5:53                                 ` Nick Piggin
2009-06-17  9:40                                   ` Pavel Machek
2009-06-17  9:56                                     ` Nick Piggin
2009-06-10  6:29                             ` Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2009-06-04  6:58 Rusty Russell

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=alpine.LFD.2.01.0906040736350.4880@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=avi@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    --cc=rusty@rustcorp.com.au \
    --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