From: Thomas Hellstrom <thellstrom@vmware.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@elte.hu" <mingo@elte.hu>,
"venkatesh.pallipadi@intel.com" <venkatesh.pallipadi@intel.com>
Subject: Re: [PATCH] x86: Use clflush() instead of wbinvd() whenever possible when changing mapping
Date: Fri, 24 Jul 2009 13:14:12 +0200 [thread overview]
Message-ID: <4A699784.9020803@vmware.com> (raw)
In-Reply-To: <20090724105831.GB2045@basil.fritz.box>
Andi Kleen wrote:
> On Fri, Jul 24, 2009 at 12:21:50PM +0200, Thomas Hellstrom wrote:
>
>> Andi Kleen wrote:
>>
>>> Thomas Hellstrom <thellstrom@vmware.com> writes:
>>>
>>>
>>>
>>>> The current code uses wbinvd() when the area to flush is > 4MB. Although this
>>>> may be faster than using clflush() the effect of wbinvd() on irq latencies
>>>> may be catastrophical on systems with large caches. Therefore use clflush()
>>>>
>>>>
>>> may be? You seem to miss some hard data here.
>>>
>>>
>>>
>> Admittedly.
>>
>
> So was it motivated by a real problem?
>
No. It was motivated by the assumption that wbinvd() is just bad:
Qoute:
WBINVD is a very nasty operation. I was talking to some CPU people
and they really recommended to get rid of it as far as possible.
Stopping the CPU for msecs is just wrong and there are apparently even
some theoretical live lock situations. - It is not interruptible in
earlier VT versions and messes up real time in the hypervisor. Some
people were doing KVM on rt kernels and had latency spikes from that.
/Qoute
(I believe you wrote that ?)
>> However, the concept of flushing and invalidating the caches completely on
>> systems with many
>> processors and huge caches when we intend to only flush only small piece of
>> the cache also sounds like a big overkill.
>>
>
> The other CPUs will not block (just flush their caches in the background or
> in parallel), so the latency shouldn't scale with the number of sockets.
> Also number of cores also shouldn't impact it because these tend
> to have shared cache hierarchies.
>
> That's just a theory, but not necessarily a worse one than yours :-)
>
>
>> Furthermore, since the wbinvd() has been introduced as an optimization of
>> the general clflush() case, did somebody ever check the effects on systems
>> with many processors and huge caches?
>>
>
> Typically systems with large caches flush faster too.
>
>
OK. We should really test this at some point. I currently don't have the
hardware to do so.
> -Andi
>
>
/Thomas
next prev parent reply other threads:[~2009-07-24 11:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 7:53 [PATCH] x86: Use clflush() instead of wbinvd() whenever possible when changing mapping Thomas Hellstrom
2009-07-24 10:05 ` Andi Kleen
2009-07-24 10:21 ` Thomas Hellstrom
2009-07-24 10:58 ` Andi Kleen
2009-07-24 11:14 ` Thomas Hellstrom [this message]
2009-07-24 13:16 ` Andi Kleen
2009-07-30 9:07 ` Pavel Machek
2009-08-02 16:22 ` Thomas Hellström
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=4A699784.9020803@vmware.com \
--to=thellstrom@vmware.com \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=venkatesh.pallipadi@intel.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