Segmentation leads to slower page translations and swapping
For those reasons, segmentation was largely dropped on x86-64.
The main difference between them is that:
- paging splits memory into fixed sized chunks
- segmentation allows different widths for each chunk
While it might appear smarter to have configurable segment widths, as you increase memory size for a process, fragmentation is inevitable, e.g.:
| | process 1 | | process 2 | |
----------- -----------
0 max
will eventually become as process 1 grows:
| | process 1 || process 2 | |
------------------ -------------
0 max
until a split is inevitable:
| | process 1 part 1 || process 2 | | process 1 part 2 | |
------------------ ----------- ------------------
0 max
At this point:
- the only way to translate pages is to do binary searches over all pages of process 1, which takes an unacceptable log(n)
- a swap out of process 1 part 1 could be huge since that segment could be huge
With fixed sized pages however:
- every 32-bit translation does only 2 memory reads: directory and page table walk
- every swap is an acceptable 4KiB
Fixed sized chunks of memory are simply more manageable, and have dominated current OS design.
See also: How does x86 paging work?