mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>,
	David Vrabel <david.vrabel@citrix.com>,
	Mel Gorman <mgorman@suse.de>
Subject: Re: [Xen-devel] NUMA_BALANCING and Xen PV guest regression in 3.20-rc0
Date: Fri, 20 Feb 2015 13:29:21 +0200	[thread overview]
Message-ID: <20150220112921.GA15064@node.dhcp.inet.fi> (raw)
In-Reply-To: <54E710D8.9020605@citrix.com>

On Fri, Feb 20, 2015 at 10:47:52AM +0000, Andrew Cooper wrote:
> On 20/02/15 01:49, Linus Torvalds wrote:
> > On Thu, Feb 19, 2015 at 5:05 PM, Kirill A. Shutemov
> > <kirill@shutemov.name> wrote:
> >> I'm feeling I miss very basic background on how Xen works, but why does it
> >> set _PAGE_GLOBAL on userspace entries? It sounds strange to me.
> > It is definitely strange. I'm guessing that it's some ancient Xen hack
> > for the early Intel virtualization that used to have absolutely
> > horrendous vmenter/exit costs, including very much the TLB overhead. \
> >
> > These days, Intel has address space identifiers, and doesn't flush the
> > whole TLB on VM entry/exit, so it's probably pointless to play games
> > with the global bit.
> 
> It was introduced in 2006, but has nothing to do with VT-x
> 
> http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=6f562e72cdc4b7e1519e23be75f812aebbf41db3
> 
> As long mode drops segment limit checking, the only way to protect a
> 64bit PV kernel from its userspace (both of which run in ring3 on user
> pages) is to maintain two sets of pagetables and switch between them on
> guest kernel/user context switches.  The user set lack kernel mappings.
> 
> I can't comment about the performance impact of the patch (way before my
> time), but the justification was to try and reduce the overhead of guest
> context switches.

IIUC, it tries to reduce userspace->kernel switch in guest. It's still
hopeless: kernel mappings are always TLB-cold, right?

> > I get the feeling that a lot of Xen stuff is that kind of "legacy
> > hacks" that should just be cleaned up, but nobody has the energy or
> > the interest.
> 
> Time, mainly.
> 
> There certainly are areas which should be up for re-evaluation, given 9
> years of change in hardware.

Is Xen PV still widely used? I'm surprised that users can tolerate this
kind of overhead.

-- 
 Kirill A. Shutemov

  reply	other threads:[~2015-02-20 11:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 13:06 David Vrabel
2015-02-19 17:01 ` Mel Gorman
2015-02-23 15:13   ` [Xen-devel] " Dario Faggioli
2015-02-23 15:46     ` Mel Gorman
2015-02-19 23:09 ` Linus Torvalds
2015-02-20 10:28   ` [Xen-devel] " David Vrabel
2015-02-20  1:05 ` Kirill A. Shutemov
2015-02-20  1:49   ` Linus Torvalds
2015-02-20 10:47     ` [Xen-devel] " Andrew Cooper
2015-02-20 11:29       ` Kirill A. Shutemov [this message]
2015-02-20 11:54         ` Andrew Cooper

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=20150220112921.GA15064@node.dhcp.inet.fi \
    --to=kirill@shutemov.name \
    --cc=Xen-devel@lists.xen.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=torvalds@linux-foundation.org \
    /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

Powered by JetHome