It’s a mistake to include Xen in a Linux distro

As the title show, it’s a mistake to include Xen in a linux distro. Why? Somebody would argue that Xen is a very useful technology. Xen does the virtualization work very well and many projects are using Xen which prove Xen is so great. I’m not mean Xen is not good. However, just because Xen is a hypervisor that is based on another microkernel that is not Linux kernel itself. Linux distros that ship Xen today actually are running an entirely different Operating System kernel that most users even don’t notice that. Xen should be a separate, purpose-built kernel, so it should never be a part of the Linux kernel. Isn’t it strange that you think you are running a linux OS, but this ’linux’ has a kernel that is not linux, which is another kernel. You take away the Linux kernel, how could you say the OS is Linux. ...

June 22, 2012 · 2 min · kamus

什麼是敏感指令

1974年,Popek和Goldberg在美國电脑協會的通訊期刊上發表了一篇論文"虛擬化第三代架構的一般性要求"(Formal Requirements for Virtualizable Third Generation Architectures)。在這篇文章中,提出了敏感指令的概念。 敏感指令(Sensitive Instructions)的定義: 敏感指令是這樣一組指令,這些指令的行為取決於指令執行時處理器的工作模式,以及指令在記憶體中的位置。 ——- 對敏感指令的處理是虛擬化技術的一個關鍵點。在用戶態執行的敏感指令如果總會造成陷入(always generates a trap),這樣的敏感指令也屬於特權 指令。在不使用Wmware提出的動態二進制翻譯機制的情況下,除非所有的敏感指令都是特權指令,虛擬機管理程式才能保證正確運行。換言之,如果某種處理器架構的所有的敏感指令都是特權指令的一個子集,我們就可以說這種處理器架構是可虛擬化的。在這種情況下,我們就可以肜經典的“陷入後模擬“(trap-and-emulate)的方法實現虛擬化。按照這個定義,在嵌入式工業中最常見的ARM架構則不是可虛擬化的,因為ARM的敏感指令有些是特權指令,有些則不是。 原文 from the paper “KVM for ARM” by Christoffer Dall and Jason Nieh, Columbia University:Popek and Goldberg define sensitive instructions as the group of instructions where the effect of their execution depends on the mode of the processor or the location of the instruction in physical memory. A sensitive instruction is also privileged if it always generates a trap, when executed in user mode. The VMM can only guarantee correct execution without the use of dynamic translation if all sensitive instructions are also privileged. In other words, an architecture is virtualizable if and only if the set of sensitive instrucctions is a subset of the seet of privileged instructions. If that is the case, the VMM can be implemented using a classic trap-and-emulate solution. Unfortunately, ARM is not virtualizable as the architecture defines both sensitive privileged instructions and sensitive non-privileged instructions. ...

June 21, 2012 · 1 min · kamus

traceroute failed.Specify protocal traceroute used manually to fix it.

Today, I ran the traceroute program on a machine running FreeBSD. It failed once and again. Traceroute complained: traceroute: sendto: Permission denied. So I tried to ping. Ping failed, too. I then checked out the configuration of the firewall, which actually denied the pass through of ICMP packet. So I set it to allow ICMP pacakges to pass through the firewall. Ping worked as I expected. But traceroute still failed. ...

June 20, 2012 · 1 min · kamus

如何正确地提交内核补丁包

原文:https://lwn.net/Articles/500443/ 翻译:ykyi.net Greg Kroah-Hartman(又Greg KH)在执行一个了不起的作务:减少内核开发者,尤其是维护者的暴躁情绪。他在日本横滨举行的全球Linux大会上的讲演呼吁公众理解内核维护者的工作,内核贡献者的什么样的行为会导致内核维护者变得暴戾。但是,如果内核贡献者们能够遵守一些约束,他代表他自己做了许多承诺。 Greg Kroah Hartman把Linux内核称之为"有史以来最宏大的软件开发项目",而且它的开发速度也是“亘古未有”。从3.0到3.4,有373个公司的2833位开发者参于了Linux内核的开发。这一年,(2011年的5月到,2012年的5月),Linux内核在每个小时会有5.79处变动。而且这个开发速度仍然要加速,如果你看看3.4的开发过程,每小时共有7.21处变动。这里所说的变动仅仅指能够被合并到主干的补丁包,而那些被拒绝的补丁包没有被统计进来。 补丁包修改了哪些文件,内核开发者就把补丁包发给负责这些文件的维护者。所以的内核维护者,现在大概有700人。他们把改变应用到130个子系统的维护者那里。再从子系统的维护者到Linus的Linux内核代码分支。最后并必Linux内核的主干。如果提交的补丁包一路通过的话。 因此,来看看为什么一些补丁包不会被接受呢?Greg Kroah Hartman以刚过去的两个星期收到的补丁包为例,这两个星期刚好处于3.5版本的Merge Window时间。Merge Window是一个他确不应该接收到许多补丁包的时间段。他应该在Merge Window开始前收到所以有可能会在Merge Window其间被发往Linux Torvalds的补丁包。不过,他说他在这两个星期的时间里收到487个补丁包。其中的大多数都有很多问题,有些补丁包来自那些本应该对内核有更好理解的内核开发者们。 坏的补丁包 Greg KH举例说明了一些他收到的坏的补丁包。其中一个补丁包被命名为:patch 48/48(一个有48个补丁集的最后一个),但是其它的47个都没有。他还收到一堆补丁但没有写清楚先后顺序。如此,他要么猜测一个顺序,这毫无疑问会失败。另一个替代方案就是安全不管这个补丁了。另外还收到过有10个补丁的补丁集,但是2号补丁确丢失了。 ...

June 20, 2012 · 5 min · kamus

Linux内核维护者的职责

原文: http://www.linuxfoundation.org/news-media/blogs/browse/2012/06/role-linux-kernel-maintainer 翻译: ykyi.net 几个星期前在日本举行的Linux大会(LinuxCon)上,我做了一个演讲,题目是"Linux内核维护者,他们在做什么,如何能够帮到他们"。 这个演讲的视频可以通过这个链接看到。如果你想要幻灯片,和我的讲演稿,可以在这个地址获得。 ...

June 20, 2012 · 1 min · kamus

中山大学软件学院11级硕士研究生2012年上学期软件项目管理期末考试试题

如题,这是中山大学软件学院02年上学期期末的软件项目管理期末考试试题 for MSE 11. The final exam of Software Project Management in the first semester of 2012 for MSE 11, Software School, Sun Yat-sen University. 一 概念题,名词解释(每题5分,共30分) WBS (Work Breakdown Structure) CPM (Critical Path Method) 里程碑 (Milestone) RAM (Responsibility Assignment Matrix) SPI (Software Process Improvement) 决策树 二. 问答题(每题10分,共70分) 请具体解释项目管理知识体系的九大知识域? 如何理解迭代式开发,有何优缺点? 什么是CMMI? CMMI的五个级别各有什么要求? 简述软件项目的风险管理过程。 如何估算软件项目的成本。 项目经理应用哪些能力?为什么? 请具体解释五大项目管理过程组。

June 20, 2012 · 1 min · kamus

What is 802.11 and their friends.

WLAN(Wireless Lan) was invented in University of Hawaii, 1970, under the leadership of Professor Norman Abramson.The wireless network communicated using radios, without using phone lines making it easy to deploy over Hawaii islands. Original WLAN hardware was used as an alternative to cabled network where cabling was impossible or difficult. The protocals of WLAN at that time was proprietary. Many companies and universities appealed to establish a set of protocals as industry protocals. In the end of the 1990s, IEEE 802.11(Wifi) came to satisfy the urgent need. Subsequent amendments such as 802.11a, 802.11b, 802.11g, 802.11n was published in the following years. Other proprietary protocals was then graduately replaced by 802.11 family. ...

June 19, 2012 · 2 min · kamus

A very brief Introduction to Neural Network.

 I have huge interests in the mysterious Artificial Intelligence. Because of the lack of time to devote into learning AI, I still barely know AI related theories. Tonight I read something about Neural Network, which plays a important role in the AI field.   So, what is A NEURAL NETWORK? A neural network is a massively parallel distributed processor made up of simple processing units that has a natural propensity for storing experiential knowledge and making it available for use. It resemble the brain in two respects: knowledge is acquired by the network from its environment through a learning process. Interneuron connection strengths  known as synaptic weights, are used to store the acquired knowledge.   Let us take the human vision as an example to demonstrate why it is necessary to study neural network. Human vision is a very complex information processing task. It is the function of the visual system to provide a representation of the the environment around us and to supply the information we need to interact with the environment. The brain accomplishes recognition task at the same time. For instance, the brain can recognize a familiar face embedded in an unfamiliar scene in shorter than a blink of eye, actually 100-200ms, whereas tasks of much lesser complexity take a great deal longer on a very powerful computer.   What's the reason makes the biological brains so efficient? How to let our machines think and do reasoning like biological brains do. The course of Neural Network has been trying to answer these questions from the day the course was established. A typical neural network has many useful properties and capacities. 1. Nonlinearity 2. Input-output Mapping 3. Adaptivity 4. Evidential Response 5. Contextual Information 6. Fault Tolerance 7. VLSI(Very Large Scale Integrated) Implementability. 8. Uniformity of Analysis and Design 9. Neurobiological Analogy.  

June 18, 2012 · 2 min · kamus

A easy way to add copyright information automatically into post(English Version英文版)

 Several weeks ago, I decided to write about two blog posts every day. I used to write copyright information manually in the post. Apparently, it's better to let the machine do this type of trivial work automatically. So, I searched the plugins to try to find a convenient one. Indeed, I found the plugin named "add post URL" which is able to help the author to insert copyright information into the post. When I clicked the 'DETAIL' button to see more. A warning message popped up: "This plugin has not been tested with your current version of WordPress". I was scared. Because I once had a bad experience about how untested plugin ruined my wordpress as a whole. So, the option of using plugin to insert copyright information was ruled out. ...

June 17, 2012 · 4 min · kamus

为什么要虚拟化

如今,虚拟化是炙手可热的一个高频词。一些质疑虚拟化的人经常会问:我们为什么要搞虚拟化呢,计算机硬件变得越来越便宜了啊!另一方面,一些痴迷虚拟化技术的狂人们在他们的桌式机上用虚拟机运行着四五个操作系统。他们或许也有同样的疑问。仅管他们看着虚拟机里旧式操作系统,模拟出的旧式硬件,觉得非常爽非常有成就感。但是他们却不太解释得清楚究竟为什么需要虚拟化技术。那么,这篇文章将要告诉你我们需要虚拟化技术的原因。 整合 Consolidation: 使用虚拟化技术的最常见原因是需要整合:把多台机器的工作负载全部整合到同一台机器上面。在更少的物理机器上运行更多的虚拟机。但是你肯定要问:计算机已经越来越便宜了呀。没错,计算机越来越便宜了。但是如果机器非常多的话,这个价格你是绝对不能忽略的。 典型的数据中心 A Typical(full) data center 让我们来看一看当今世界的数据中心。如今的数据中心里急缺存放机器的空间,房子里满满的塞满了机器,你找不到更多的地方来添置计算机或空调之类的设施。空间利用率已经接近极限了。但是,大多数机器的资源利用率却非常地低。大概平均只有10-20%的的资源利用率。简言之,数据中心的物理空间已经饱合,但是物理机器的使用能力确远远没有利用足够。那么,如果数据中心要承担多更的工作负载,你会再建一个数据中心呢还是想办法把没有利用好的资源利用起来。 只有数据中心还有空间让你添置机器,当然多加一台机器就相当容易的解决问题了。但无论如论你放不上新的机器的时候,你应该会有很大的麻烦说服BOSS新建一个数据中心。另外一个大问题是,即使BOSS答应新建一个数据中心来解决问题,但是巨大的电力供应从哪里来呢。一个一千万瓦功率的数据中心不是说接入电网就可以接入电网的。你或许还要说服电网的领导批准提升电网的供电能力。 虚拟化是解决这个问题的最佳办法。用虚拟化把所以机器的性能都利用起来吧! 隔离硬件(Hardware Isolation) 硬件的性能每个月都在快速提高。但是,当我们把工作负载转移到一台新的服务器的时候,我们还需要先在裸机上安装操作系统,然后再配置各种软件环境,再把所有的数据转移到这台新服务器上来。忙到最后我们还要心惊肉跳的祈祷一切顺利! 如果使用虚拟化,你就不必这么麻烦了,因为不再直接与硬件层交互。你只需要在新的机器上部署好虚拟环境,再把虚拟机整个移过来。不需要再额外配置什么鬼东西,因为配置就在虚拟机里面,你已经把虚拟机整个搬来了。 历史遗留的旧操作系统(Legacy Operating System) 计算机工业走了这么多年,碰到要维护旧的操作系统并不鲜见。不幸的是,你有一个致关重要的程序只能够在这个恐龙级别的操作系统下运行。但大多数老旧的操作系统不能够在新的硬件上运行呀,你又没有办法再配置一台旧硬件的机器。 解决方案就是使用虚拟化。比如Vmware的Binary rewriting,或者Xen又或者KVM都可以。工作原理则是虚拟层模拟了简单的硬件,从你的旧操作系统看过去,多核CPU变成了老旧操作系统支持的旧时代CPU,当然频率却变快了。多核,ACPI设备发现,中断路由,支持10G以太网,支持SATA都不会成为你运行旧操作系统的障碍,因为虚拟层(Virtualization Layer)! 当然了,虚拟化本身会占用一些性能。但是因为采用了虚拟化,你才能在非常快速的新硬件上运行旧操作系统,这样得到的效率提高要远远高于在原生态支持旧操作系统的旧硬件上运行。因此,还为你节省了电费。 测试(Testing) 不管你是学习软件开发的在校学生,还是大银行的首席信息官,你一定缺少足够多的测试硬件吧。 虚拟化可以解决这一问题。在虚拟机上测试新发布的Fedora Rawhide或者Debian Unstable先,而不是直接格掉机器安装。还能给你的开发团队一把虚拟机,让每人一台虚拟机想测试什么就测试什么。 维护(Maintenace) 有了虚拟化,能方便很多方面的维护。 比如使用即时迁移技术,像Vmware的vmotion,Xen的Live Migration,你可以在保持虚拟机上的操作系统正常工作的情况下把虚拟机从一台物理机器移动到另一台物理机器。这项技术确实非常有用啊,不仅仅可以用来在你的朋友面前炫燿。 还有很多情况,你可以使用到即时迁移技术。比如物理机的硬件故障。有一台机器的CPU风扇坏了,CPU的保护系统自动启用使用CPU工作在一个非常慢的速度。那么你就可以把虚拟机即时迁移到另一台健康的机器上,然后修理那台坏的机器而不致于产生Downtime。又如,某台虚拟机的工作负载越来越大,那么你可以这台虚拟机所在的物理机上另外一些虚拟机器迁移到其它物理机上,为这台需要更多资源的虚拟机提供更多支持。有时候你需要升级某台机器的硬件,那么先把这台机器上所有的虚拟机即时迁移到其它机器,再开始你的硬件升级工作,还是没有任何Downtime。酷毙了,是吗? 节省能源(Power Saveing) 举个例子,你有100台服务器运行着各种各样的100个服务程序。但每台服务器的负载只有不到50%,那么你可以用50台物理机器虚拟出100台虚拟机运行100个服务程序。一下子节省了50%的电力,不是吗?想想,一个功率是一千万瓦的数据中心如果能节省50%的电力,这是个多么了不起的数字啊!为你节省了电费钱,还为对抗全球变暖做出了贡献。 安全和性能隔离(Security and performance isolation) 如果你采用虚拟机把不同的程序运行在不同的虚拟机里面,那么如果其中有一个程序出错,吃光了所有的内存,它也不至于影响其它程序。因为其它程序运行在不同的虚拟机里,它们仍然运行得很好,一点都不会受到那个出错程序的影响。如果这些程序运行在同一个OS下,那情况就不妙了。 一个相似的情况下,如果有一台虚拟机被入侵者攻陷,那么入侵者仅仅只控制了这一台虚拟机,暂时不能对其它虚拟机造成直接威胁。当然,这些虚拟机应该相互隔离的很好,每台虚拟机都运行着自己的内核,大多数虚拟化技术都是这样做的。但有一种虚拟化技术叫做容器技术(Container Technoloties),如Linux VServer, Virtuozzo/OpenVZ和Solaris Zones,它们实现的虚拟化的隔离性要相当低一些,得到的好处是虚拟化自身消耗更少的硬件资源。 copyright ykyi.net

June 16, 2012 · 1 min · kamus