Hello,
Brendan wrote:[*]inadequate (on its own) for handling physical memory fragmentation (there's no way to avoid the "worst case, copy lots of RAM" problem).
Yes, you have to do a memory-defragmentation (with paging you can do that in the background without disturbing the applications), but if you do this job good than you can switch off the paging completely and become a higher performance (segmentation is cheaper then paging). With an (hypothetical) CPU with better support for segmentation (not x86) you can activate the paging on a per segment base and only the application with fragmented segments have to pay the paging penalty.
Brendan wrote:[*]inadequate (on its own) for handling things like swap space, memory mapped files, copy on write, allocation on demand, etc. You're mostly forced to work on entire segments (not small pieces) which defeats the purpose of these common VMM features and prevents any performance gain/s or RAM savings that could've been achieved.
This are thinks that paging is designed for. Good segmentation need paging for some low level tasks that are used in special situation but typical are off.
Swapping is the ultimate job for paging, swapping with complete segments is really not applicable. The same with memory mapped files. Copy on write is working with segmentation too. Allocation on demand is nice but not every time useful, my PC has enough RAM, and the segments can have the correct size for now and expanded as needed at a later time.
Brendan wrote:[*]bad (on its own) due to physical address space size limitations on 80x86 (you can't access more than 4 GiB of the physical address space, or about 3 GiB of RAM, even though most modern computers have more)
Yes, with segmentation you have only one linear address space for all applications and the OS but on a 64 bit platform this is today not a problem.
With paging you have other limitations. How many stack space can have a flat memory application per stack? Flat memory stacks are typical fixed in its size, with segmentation you can use all available memory for stacks (or heap) without a special limit (as long the sum of both fits into the memory). On segmentation the programmer must not be aware that the stack has a significant smaller limit than the heap, both are full flexible.
Brendan wrote:[*]entirely pointless if it's used in conjunction with paging (to solve the first 3 problems). As soon as you start using paging you realise paging alone is enough for protection and isolation purposes, and segmentation becomes just an unnecessary layer of overhead.
As long as every simple integer can be interpreted as a pointer that points to any location (possible valid but not intended) the paging has not enough protection.
Brendan wrote:[*]not portable. Very few other architectures support it (including 64-bit 80x86).
Yes, thats right.
Brendan wrote:[*]it's "awkward" for programmers
Why? A typical C programmer can not see that his program will run with segmentation, this assumes a good compiler for segmentation. Except the OS kernel and the heap management part of the libc, you have nothing to do with the used memory philosophy of the target platform.
Brendan wrote:(and a pain in the neck for compilers/toolchains).
May be true, but is not a real problem.
Brendan wrote:A nice clean/contiguous space is conceptually easier than "many isolated islands".
Yes, for the beginners.
Brendan wrote:[*]Slow. The GDT/LDT lookups plus the number of protection checks involved can't be avoided
This checks can be done in parallel with the memory access and costs nothing (in the same manner as the protection check of paging). And the GDT/LDT lookups are only done at loading a segment register, if your CPU have enough segment registers (not true for x86) than this is very rarely.
Brendan wrote:Because it sucks nobody uses it and because nobody uses it CPU manufacturers don't bother optimising it (which makes it suck even more).
This is the real problem.
The performance looses by paging rise with increased amount of memory used by the applications, the costs for segmentation are nearly constant.
Greetings
Erik
Sorry for my terrible English, my native languages are VHDL and German
and sorry for my delay