3 ms·
While it may be “cumbersome” from the programmers perspective - it’s certainly a lot faster than an MMU. There’s no universe where traversing a page table (act
by slededit 8y ago
While it may be “cumbersome” from the programmers perspective - it’s certainly a lot faster than an MMU.
There’s no universe where traversing a page table (actually a tree) in memory is faster than an offset and a bounds check.
- wruza 8y agoWhat are you talking about? On x86 page tables were cached in TLB since their introduction. No mmu at all (80286) means that you're subject to fragmentation, and swapping segments is as expensive as a syscall since you have to lookup the descriptor through GDTR. x86 segments are scarce, expensive and cumbersome resources invented to cover bus width mismatch. Today it is not ever an issue. Even TSS is shared one per cpu, so much useless and slow its hardware part is. We could imagine more segment registers and bigger descriptor tables, but that would be just poor man's manual TLB (manual always failed in cpus). If you concerned with constant checks, you may order yourself a cpu with BOUND instruction support and put it everywhere with the same result. Oh, it is already in x86-64, nevermind. >actually a tree It is 2 level "tree", afair. Directory and table. Please make your homework and research why segmented model was kicked off software arena by virtually everyone involved.
- slededit 8y agoSpoken like a programmer that has never had to fix TLB misses as a bottleneck. It’s actually quite common as the TLB is rather small. Not even enough for 2MB worth of 4K pages. You can use huge pages but it has all of the drawbacks of segments and none of the benefits. VMWare used to have a super fast 32-bit hypervisor based on segments long before special instructions were added. This of course had to be reworked completely for X64. Also Intel’s bound check instructions are still extremely rare and don’t work that well in practice. I’ve used them.
- wruza 8y agoA recipe for fixing TLB misses (as any cache misses) is simple: don’t thrash your cache. Ofc I didn’t, I cannot even imagine what does one do to bottleneck at TLB – LSD? It is one of these problems like “doc, if I turn my finger 180, it hurts”. >VMWare 32-bit before special instructions DOS also was pretty fast, but that didn’t make it a good multi-user protected-mode OS. All these early emulations and monkey patching of guests cannot substitute hardware vt in the wild.