From: Kun Cheng <chengkunck@gmail.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Frediano Ziglio <freddy77@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Could Xen hyperviosr be able to invoke Linux systemcalls?
Date: Tue, 18 Aug 2015 01:18:27 +0000	[thread overview]
Message-ID: <CAO3v1VSgGosc33KWbPA+abaUrmfbXrKqzOw16D8j8vhtC9vG5w@mail.gmail.com> (raw)
In-Reply-To: <1439839526.4239.18.camel@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 4484 bytes --]
On Tue, Aug 18, 2015 at 3:25 AM Dario Faggioli <dario.faggioli@citrix.com>
wrote:
> On Mon, 2015-08-17 at 00:55 +0000, Kun Cheng wrote:
> >
> >
> > On Mon, Aug 17, 2015 at 12:16 AM Frediano Ziglio <freddy77@gmail.com>
> >
> > What I'm planing is adding page migration support for NUMA aware
> > scheduling. In such a case the most time I'll be dealing with Xen's
> > memory management & scheduling part to make relevant pages migrate to
> > another node with their VCPU. However, Linux kernel has already
> > implemented some basic mechanisms so the whole work would be better by
> > leveraging the kernel's  existing code or functions.
> >
> No, not at all. As you figured (or at least had intuition about)
> yourself, Xen does run below Linux. Actually, it runs below any guest,
> including Dom0, which is a special guest but still a guest, and can even
> not be a Linux guest.
>
> So there's no code sharing, or no mechanism to invoke Linux code and
> have it affect Xen's scheduling or memory management (and never will
> be :-P).
>
>
Thank you Dario and Frediano.
Not being able to share the existing kernel mechanism is some kind of
frustrating......But just as you said it's the point of virtualization. And
now I gain a better understanding why you said it would be tough ;)   (I
start to envy KVM guys, LOL)
> > More specifically, I want to confirm that could we use the code or
> > functions in linux kernel to assist the hypervisor?
> >
> No, it's the other way around.
>
> > My guess is not because in my understanding xen hypervisor lies under
> > the linux kernel, i.e. dom0's kernel.
> >
> Exactly.
>
> > Given that Dom0 is a special domain, if I want to manage & move all
> > the machine memory pages, can the kernel be helpful?
> >
> The Dom0 kernel doesn't know anything about the memory of other guest.
> It basically doesn't even know that they exist... That's the point of
> virtualization, isn't it?
> Also Linux's and Xen's scheduling and memory management are so different
> (and that's by design) that, even for similar (or the same) feature, the
> implementation will be different anyway, so sharing the code won't help
> at all.
>
> > Hmm, "change the memory from dom0" means we can control the VM's
> > memory by using a config file or xl command right?
> >
> "changing the memory from dom0" means something like "the dom0 can ask
> Xen, via toolstack, to do something to the memory of other guests",
> i.e., it has enough privileges to do that, but that's it.
>
> > What if we goes to the code level? I'm really confused now. Is Xen's
> > memory management complemented all by itsself or does it also receive
> > help from the kernel?
> >
> As said, Xen doesn't even know what kernel is actually running in the
> various guest, including dom0, and things should remains that way,
> especially for core things like scheduling and memory management.
>
> So, in summary, what you're after should be achieved entirely inside
> Xen. It is possible than, in the PV guest case, you'd need some help
> from the guest. However, that would be in the form of "Xen
> asking/forcing the guest to do something on the *guest* *itself*", not
> in the form of "Xen asking dom0 to do something on Xen's own
> memory/scheduling or (directly) on other guests' memory".
>
> Hope this helps clearing things out for you. :-)
>
At this point I still have other plans.  But 'asking the guest to do
something on the guest itself' sounds like exposing the virtual NUMA
topology to the guest (vNUMA). I wrote this email because hypervisor is
responsible to allocate machine memory for each guest. Then, in a PV case
there are P2M and M2P to help address translation (and shadow page tables
in HVMs). So what first came to my mind was hypervisor should move the
pages for guests and then P2M things should better be renewed somehow.
However inside a guest domain, its OS can only manage the guest physical
memory, which I don't think is able to be moved to another node by itself.
>
> Regards,
> Dario
>
> --
> <<This happens because I choose it to happen!>> (Raistlin Majere)
> -----------------------------------------------------------------
> Dario Faggioli, Ph.D, http://about.me/dario.faggioli
> Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
>
Maybe I misunderstood you words... 'asking the guest to do something on the
guest itself' confuses me a bit, could you explain more details of your
thought if it's convenient for you?
Thank you,
Kenneth
[-- Attachment #1.2: Type: text/html, Size: 5809 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply	other threads:[~2015-08-18  1:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15  1:31 Could Xen hyperviosr be able to invoke Linux systemcalls? Kun Cheng
2015-08-16 16:16 ` Frediano Ziglio
2015-08-17  0:55   ` Kun Cheng
2015-08-17 19:25     ` Dario Faggioli
2015-08-18  1:18       ` Kun Cheng [this message]
2015-08-18  9:16         ` Dario Faggioli
2015-08-19  0:47           ` Kun Cheng
2015-08-19 18:27             ` Dario Faggioli
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=CAO3v1VSgGosc33KWbPA+abaUrmfbXrKqzOw16D8j8vhtC9vG5w@mail.gmail.com \
    --to=chengkunck@gmail.com \
    --cc=dario.faggioli@citrix.com \
    --cc=freddy77@gmail.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).