xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Kun Cheng <chengkunck@gmail.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: Mon, 17 Aug 2015 12:25:26 -0700	[thread overview]
Message-ID: <1439839526.4239.18.camel@citrix.com> (raw)
In-Reply-To: <CAO3v1VQW=m_O9BcSu0rX=7L3dAVnOnFPyH1wvwmTTCpRs22X+A@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3206 bytes --]

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).

> 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. :-)

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)

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2015-08-17 19:25 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 [this message]
2015-08-18  1:18       ` Kun Cheng
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=1439839526.4239.18.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=chengkunck@gmail.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).