LWN.net Logo

Advertisement

E-Commerce & credit card processing - the Open Source way!

Advertise here

The point of virtualization

Posted Oct 12, 2007 22:49 UTC (Fri) by roelofs (subscriber, #2599)
In reply to: The point of virtualization by giraffedata
Parent article: Matt Domsch on Linux support at Dell

I presume you meant virtual to physical...

Yes, of course. Sorry for the typo!

The virtual page table is not involved in page translation. So it's the same speed with virtualization as without.

I don't understand why you think that. The guest app triggers a TLB (cache) miss, which means the guest kernel has to do a virtual-to-"physical" lookup in the page table, which involves one memory access for each level of the table. But its "physical" addresses are still virtual in the hypervisor kernel's space, which means you have to do a second virtual-to-physical lookup in the shadow page table, at a cost of three or four more memory accesses (for x86 and x86-64, respectively).

Those are probably included in my phrasing, "a system built for virtualization." And they're upcoming only for the Intel stuff.

Right--Ulrich explicitly stated that he was principally concerned with commodity x86-family hardware (and, to a lesser extent, Linux), and that certainly goes for me as well. I wouldn't be terribly surprised if IBM had some of this stuff back in the 1970s...

Greg


(Log in to post comments)

The point of virtualization

Posted Oct 12, 2007 23:02 UTC (Fri) by roelofs (subscriber, #2599) [Link]

Those are probably included in my phrasing, "a system built for virtualization." And they're upcoming only for the Intel stuff.

OK, maybe I didn't go back far enough for context. I think I now see what you meant by "a system built for virtualization"--you were implicitly excluding the extra set of memory accesses due to shadow page tables in software-based virtualization. But I misread that since you were replying to the author's comment about existing Dell hardware--which explicitly does not include IBM mainframe technologies. And your original statement was a flat denial of any performance penalty due to virtualization ("The virtualization layer doesn't slow the machine down, anyway."). It was more that part to which I was replying.

Greg

The point of virtualization

Posted Oct 13, 2007 2:31 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

I agree the answer to the question, "does virtualization slow systems down" is different if one means virtualization per se than if one means virtualization in practice.

In the original comment, I thought I saw questioning of the very concept of virtualization -- i.e. why is everyone rushing toward this thing if it costs so much speed? So in addition to pointing out what I think the benefits are supposed to be, I also opined that it doesn't cost speed. I think the virtualization that people are presenting as the next big thing is virtualization done right, not necessarily what is practical today. E.g. companies are introducing new products specifically to enable virtualization.

The point of virtualization

Posted Oct 13, 2007 2:16 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

The guest app triggers a TLB (cache) miss, which means the guest kernel has to do a virtual-to-"physical" lookup in the page table,

How would the guest kernel get involved? Page translation is done in the CPU. The guest app does a load instruction to an address he hasn't accessed in a while, so its translation is not in the TLB, so the CPU walks the shadow page tables to find to which physical page it refers, then loads the bytes into the register from there, then proceeds to the next instruction. The CPU doesn't even know the guest page table exists; the shadow page table maps the guest ap's virtual addresses to physical memory.

You seem to be saying TLB miss, but thinking page fault. When there's a page fault (the shadow page table does not contain a translation for the address in question), there is that multi-level lookup by the guest kernel and hypervisor, to ultimately add a translation to the shadow page tables. On systems that have guest page tables, that is.

The point of virtualization

Posted Oct 14, 2007 16:58 UTC (Sun) by roelofs (subscriber, #2599) [Link]

You seem to be saying TLB miss, but thinking page fault. When there's a page fault (the shadow page table does not contain a translation for the address in question), there is that multi-level lookup by the guest kernel and hypervisor, to ultimately add a translation to the shadow page tables.

Yes, I think you've nailed it. I seem to have conflated the two issues.

Greg

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.