Xen为什么一定要进入内核

这个问题我问了一位名为笑遍世界的博主,这位博主在写一本名为《KVM虚拟化原理与实践》的书,在他的博客上连载了书里面的部分章节,目前我在网上能找到最好的中文资料就是这个连载了。

博客地址:http://smilejay.com/kvm_theory_practice/

我:

有几个问题想请问博主,还望解疑: Xen为什么一定要进入内核呢,进入内核意味着它也要借助linux内核对硬件资源管理和调度吗? 博主能不能简单说点对KVM和Xen的看法? 谢谢

master :

对的,应该是你说的那样的,不过注意xen hypervisor本身几乎是永远不能进入Linux内核的,只是说和Xen配合使用的dom0 kernel已经可以完全直接使用Linux kernel upstream了(意思是Linux内核这边的为了xen进行的相关改动已经全部进入到Linux原生内核中了)。我工作和学习对KVM、Xen都是涉及到的,其实很早就准备写一篇KVM/Xen的看法的,等等吧~~ 我的大致观点与这篇文章有点类似(我不敢自称专家哈):
http://chucknology.com/2012/04/15/kvm-is-still-linux-xen-is-still-not/

KVM is still Linux. Xen is still not.

Posted on April 15, 2012by cdubuque

http://chucknology.com/2012/04/15/kvm-is-still-linux-xen-is-still-not/

我希望之前写的KVM is Linux, Xen is Not  这篇文章能帮助大家更好的理解KVM与Xen之间的区别。

It’s been gratifying to see lots of folks finding my site a couple of months after my first post, reading the article “KVM is Linux, Xen is Not“, and retweeting it to a broader audience. I seem to have hit a nerve, and I hope I have provided some value in helping folks understand the differences between KVM and Xen.

我是Red Hat公司的员工,工作也是与KVM相关。当然是KVM技术的支持者。

If you’ve read in the last couple of weeks, you probably noticed that posting has attracted some less than positive comments from Xen adherents.

All cards on the table: I am a KVM adherent. I work for Red Hat, and I work on a KVM-based product. Moreover, I personally believe that KVM is the best technology going forward for open source virtualization.

Linux 3.0. 内核中,加入了部分Xen代码,而我那篇文章主要是为了谈谈在Xen的部分代码进入linux3.0之前与之后,Xen与KVM的一些架构上的区别。

My goal in the post was to point out the architectural differences between Xen and KVM, before and after the inclusion of some Xen code beginning with Linux 3.0. And yes, to poke some fun at Citrix and Oracle.

Based on the recent comments I’ve gotten, I thought it was worth writing a short post before going on to other topics.

I was tempted to do some editing to the original post (a footnote here, a qualification there), but aside from fixing a couple of incorrect links, I decided to let it stand as originally written and posted for better or worse.

I do apologize for initially pointing to the incorrect article as the attribution link for Simon Crosby’s quote. I have made that correction in the post.

But unless there are technical inaccuracies, I am not making any further edits. You the reader can decide if I was fair, pushing things to make a point, or way off base and need to apologize for muckraking.

Let’s step back in time a bit…

那篇大致在 2011/07 写完,是为了说清楚关于Xen进入Linux内核的真正意义的问题。

Now, the post is a bit out of its historical context. After all I wrote most of it in July of 2011 for a different forum to address a real issue–the confusion about what Xen being “accepted” into Linux actually means.

Confusion still reigns

额。。关于Xen进入内核到底意味着什么,很多人仍然有困惑。

Oracle和Citrix的一年前的一篇声明让很多人产生一种印象,就是Xen也进入了Linux内核,这使得KVM这种基于linux内核的技术,失去了它作为Linux内核一部分而带来的相对优势。

正是为了澄清这一个误解,我才写了KVM is Linux, Xen is Not 这篇文章。

Almost a year later, people still ask what that announcement from Oracle and Citrix means. And still the overwhelming impression that people come away with from reading the coverage and talking to sales people is that Xen is now integrated into Linux, and that KVM’s advantages in that regard are moot.

Addressing that confusion was the ultimate intent of the post.

Was it a bit cheeky to call out the Oracle and Citrix at the top of the article? Sure. Guilty as charged. It helped get the post out to a broader audience than I expected for what at its heart is a relatively dry but important architectural distinction.

Is there anything technically inaccurate in the post? I haven’t heard of anything yet, but I commit to immediately correct any technical inaccuracies.

Did I not give the people behind the posts the benefit of the doubt?Maybe. I admit I was fixated on the inaccuracies and FUD circulating at the time.

我想说的是,如果你对Xen,KVM的技术架构有足够的了解,而且也了解Linux内核中与之相关的那部分内核代码,那么你读了KVM is Linux, Xen is Not这篇文章之后,是应该能够知道Xen的那篇声明是什么意思的。

I will say this: if you understand enough about the architecture of Xen, of KVM, and the process of including code in the Linux kernel, then reading in full the cited articles will give you an accurate account of what the Xen announcement means for Xen and for KVM.

If however you don’t know hypervisor architectures that well, or you only read the press and second hand accounts, or what a sales person told you, or the headlines and soundbites, then you probably got the wrong impression. This article was written for you.

Enough said.

I’m moving on to other topics. Feel free to comment.

KVM is Linux. Xen is Not.

Linux 3.0内核开始接收Xen 的部分代码了,有些人说这意味着Xen已经如同Kvm一样被紧密的整合到了Linux内核中,我想告诉你的是事实并非如此。 Kvm仍然是唯一整合进Linux内核的技术。

Last year there was a lot of talk from Citrix, XenSource, and Oracle about the acceptance of certain Xen code and drivers into the Linux 3.0 kernel. I still hear it today. They’re implying that it means the Xen has been as tightly integrated into the Linux kernel as KVM. And I’m here to tell you that they are wrong.

Here’s what Oracle and Citrix have said on the matter:

“I’ve heard over the last few years, competitors use “There is no Xen support in Linux” as a tagline to create FUD with the Xen userbase and promote alternatives. Well, it’s all there people.” — Wim Coekaert, Oracle

“During all the fuss of Citrix Synergy last week, an event of pretty earth-shattering importance occurred in the open source world: all key Xen code was accepted into the Linux mainline kernel.”– Simon Crosby, Citrix

Wrong!

The Oracle and Citrix marketing on this issue are misleading to say the least. It implies that the recent acceptance of some Xen enablement code into the Linux kernel equates to integration, or that the Xen architecture doesn’t matter now that some of their code is in Linux.

KVM is still the only Linux kernel-integrated hypervisor technology. End of sentence. End of story.

KVM被整合到Linux内核中,意味着KVM使用Linux来做包括 设备管理,CPU调度,内存页分享,以更好的算法利用 CPU内核和内存,以及利用近五年来 Intel和AMD的x86硬件虚拟化技术。

There is no special KVM enablement needed in the Linux kernel. KVM is integrated into the Linux kernel.KVM uses Linux for everything from device management to CPU scheduling, memory page sharing, better algorithms for making use of lots of cores and lots of memory, and tying into all the hardware virtualization technology AMD and Intel have been building into x86 for the past 5 years.

Xen is no more mainineor mainstreamtoday in 2012 when it comes to Linux than it was in 2007 when KVM was accepted into the Linux kernel, or 2009 when Red Hat decided to move forward with KVM instead of Xen and integrated KVM into RHEL.

OK, then, what’s the Real Scoop?

Xen实际上仍然是没有进入内核的,Xen的hypervisor技术,决定了它无法直接“影响”linux内核的技术,如:transparent huge pages - 透明大型分页, CFS scheduler, paging-分页, memory overcommitment with KSM -内存过载,等等。

你仍然需要在裸硬件上安装Xen kernel,构建一个特殊的VM客户机“Dom0”来管理这个Xen kenerl(我不太了解Xen, 或许我这里翻译有误, 仅作参考),并提供设备驱动。Xen的技术架构仍然是 Xen-Dom0-DomU。

Xen has still not been accepted (and probably never will be) into the Linux kernel, and cannot leverage directly Linux technologies such as transparent huge pages, CFS scheduler, paging, memory overcommitment with KSM, etc. for its hypervisor technology. You still need to install the Xen kernel on bare metal and build a special VM called a Dom0 to manage it and to provide device drivers. And you still have the suboptimal Xen architecture with Xen-Dom0-DomU. See the ugly diagrams below for more details.

那所谓的Linux 3.0接收Xen进入意味着什么呢。仅意味着两件事情:
1、自linux 3.0开始,Xen使用的paravirtualized drivers - 半虚拟化驱动 会被整合到linux内核中。这个类似于,从Linux 3.x+ 开始,如果你想在Linux 3.x+内核的客户机中使用virtio ( KVM/libvirt ),pv-scsi ( VMware ),pv-ops 这些用来加速 disk(磁盘) 和 NIC(网卡)硬件,就不用自己去整合到客户机里面,已经给你准备好了。

2、从linxu 3.0开始,你不需要修改内核,就可以使用linux做为Dom0。记住Dom0是Xen的控制台操作系统所在,也要负责处理某些的来自客户机的IO请求。Dom0不是Xen本身,Xen仍然在裸硬件上,是独立于Linux的一个项目,Xen要自己去做支持硬件和新的虚拟化技术的工作。

总之,从linux 3.0开始,如果你要使用Xen(当前版本和未来的版本)来做hypervisor,那么,你使用Linux 系统作为客户机,或者作为Dom0,会相对容易一些。

如果你要使用linux 3.0之前的版本做Dom0,则需要修改 (won’t work without modifications)

如果你要使用linux 3.0之前的版本做客户机,你需要hack in the drivers(不明白什么意思)

因为KVM被整合进了Linux 内核,所以它可以利用继承自linux的一些功能来做hypervisor的工作。如:scheduling, paging, frequency scaling and hardware enablement。

Xen仍然需要自己完成这一部分的工作,这是Xen技术的一部分,将来也不会改变的。

The announcement of Xen and Linux 3.0 means two (and only two) things:

1. The paravirtualized drivers that Xen uses will be integrated into Linux starting with 3.0. This means that just like virtio(KVM/Libvirt) and pv-scsi (VMware), the pv-ops drivers used for accelerated disk and NIC will be available in any Linux 3.x+ guest without having to integrate drivers. This leaves Microsoft Hyper-V alone in requiring integrating drivers for guests.

2. A Linux 3.0 or higher guest can be used unmodified as a Dom0. Remember Dom0is where the console operating system resides and is also a slave for certain IO from the guests. It is not Xen itself. Xen still resides on the bare metal and is still a separate project from Linux that has to duplicate effort to support hardware and new virtualization technologies.

In summary, it will be slightly easier to use future versions of Linux guests with current and future versionsof Xen, and it will be slightly easier to use future versionsof Linux as a Dom0for current and future versionsof Xen.

If you want to use a pre-3.0 Linux as a Dom0 it won’t work without modifications. If you want to use pre-3.0 Linux guests, you still need to hack in the drivers.

Not such a big deal after all. So does this change anything for KVM?

In a word, No.

One of KVM’s strengths is that it is integrated into the Linux kernel and therefore can utilize Linux features for things that hypervisors do besides just being a hypervisor.

Xen hypervisor is still a separate project and a completely separate code base, and features that KVM can use for virtualization and inherits from Linux (scheduling, paging, frequency scaling and hardware enablement, for example) will still need to be separately implemented in Xen. This is part of the design of Xen and is not going to change.

KVM Architecture

Elegant, isn’t it?

Xen Architecture

What a mess…

What did they say? Word for word. I’m taking down names.

Here’s links to the various blogs Citrix and Oracle have put out:

http://blogs.citrix.com/2011/05/30/xen-celebrates-the-final-step-of-a-four-year-odyssey/

http://blogs.oracle.com/wim/entry/linux_mainline_contains_all_the

转载于:https://blog.51cto.com/guli3057/1196291

Xen为什么一定要进入内核 —— [简译] KVM is Linux, Xen is not相关推荐

  1. 编译3.0的linux内核,1-3-编译Linux内核

    1-3-编译Linux内核 1.将Linux源码包拷贝到共享文件夹. 2.进入共享文件夹. 3.解压,命令#tar xvfj Kernel_3.0.8_TQ210_for_Linux_v2.2.tar ...

  2. linux xen 内核,Xen 正式进入 Linux 内核

    matriz - June 6th, 2011 1:28 pm KVM和Xen在做底下的博弈么? matriz - June 6th, 2011 1:36 pm LZ糊人的吧,我去kernelorg下 ...

  3. 君君学Linux设备驱动第三天之linux内核简简简介

    内核这东西不是一篇博客,日志能说清楚的,但是简要总结一下有利于后面的学习...... 一 内核的演变和发展 Linux是unix的一种克隆系统.它的发展依赖于五大支柱:unix系统(分时操作系统),m ...

  4. linux xen卸载,超级简单安装xen和虚拟机以及解决其中出现的问题

    c.安装 我的物理机是8核,16G内存,1TB硬盘,我估计能够装7个2GB内存,100GB的虚拟机和一个1GB内存,100GB的虚拟机 计划安装一个虚拟机交node001,内存为2G 点击(此处)折叠 ...

  5. Linux虚拟化: 探索 Linux 内核虚拟机 学习 KVM 架构及其优点

    M. Tim Jones, 顾问工程师, Emulex 简介: Linux® 既有良好的灵活性,在虚拟化方面同样出色.但是最近,随着内核虚拟机(KVM:Kernel Virtual Machine)的 ...

  6. 【Linux 内核】编译 Linux 内核 ① ( 下载指定版本的 Linux 内核源码 | Linux 内核版本号含义 | 主版本号 | 次版本号 | 小版本号 | 稳定版本 )

    文章目录 一.下载 Linux 内核 1.下载最新版本 Linux 内核 2.下载指定版本 Linux 内核 二.Linux 内核版本号含义 一.下载 Linux 内核 1.下载最新版本 Linux ...

  7. linux内核在什么目录结构,Linux Kernel 目录结构说明

    核心源程序的文件按树形结构进行组织,在源程序树的最上层你会看到这样一些目录: · Arch :包括了所有和体系结构相关的核心代码.它的每一个子目录都代表一种支持的体系结构,例如i386就是关于inte ...

  8. 移植linux内核-映像文件,移植Linux内核-映像文件

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明 http://tigerwang202.blogbus.com/logs/43927976.html 首先从Blackfin uCli ...

  9. linux内核分为四个子系统,linux操作系统的内核有哪几个子系统构成,简要说明各子系统的作用...

    Linux是一个一体化内核(monolithic kernel)系统."内核"指的是一个提供硬件抽象层.磁盘及文件系统控制.多任务等功能的系统软件.一个内核不是一套完整的操作系统. ...

最新文章

  1. 无法在终端中显示Git树
  2. 谷歌希望通过 Adiantum 为更多人提供加密功能
  3. 年末盘点 2016 年最严重的 7 起 DDoS 攻击事件
  4. 特征选择与特征权重区别
  5. 2013年11月19日
  6. 啥叫“Functional Programming ”???
  7. 贴片电容的0.65T,0.8T,1.25T,2.5T是什么意思
  8. 使计算机进入休眠状态
  9. 辅助驾驶等级_BBA霸榜、特斯拉折戟 E-NCAP辅助驾驶评测结果公布
  10. GX works2 使用总结
  11. 记一次被200G流量 DDOS攻击的处理经验
  12. 神经网络训练用什么软件,神经网络训练ai玩游戏
  13. SAP License:ERP系统实施价格是多少?
  14. 单纯形法算法实现--java版
  15. uva-10041-水题
  16. AI人工智能ml5.js在线实现图片变卡通图像,照片变卡通图像
  17. 恋人日记服务器维护中,知乐日记:恋人不会在最终相遇 因为他们本来就一直在一起...
  18. 介绍2款最流行的画PCB工具
  19. 80老翁谈人生(347):老翁因火星人失窃源代码与方正结成“死结“
  20. vue 使用 cesium 接入 gltf 模型

热门文章

  1. MySQL 报错 1055
  2. 关于rms,打开文档的时候提示您没有权限打开文档,因为您的权限已过期
  3. docker 核心概念整理
  4. 六、CPU优化(4)NUMA架构
  5. 第一章 Joomla!扩展开发:概况
  6. CPL DPL RPL的区别 一致性代码段和非一致性代码段
  7. asp.net页面回传与js调用服务端事件、PostBack的原理详解
  8. css样式中关于li的横向排列
  9. HTML ol 标签的 type 属性
  10. 搭建Qt 5.3.1 for Windows Phone 8开发环境