4 ms·
Interesting idea: multiple swap partitions... the kernel smartly chooses the closer one the write head whenever needed.
by marcodiego 5y ago
Interesting idea: multiple swap partitions... the kernel smartly chooses the closer one the write head whenever needed.
- timvdalen 5y agoCouldn't that result in much slower reads when the head is far away from the swap when it needs to read (multiple times)?
- marcodiego 5y agoEven more interesting idea: pages are oportunistically mirrored between swap partitions and the kernel smartly chooses the closest one whenever needed!
- resonator 5y agoDoes the kernel even have the information to know which is closest. I figured that would be absracted away to the disk controller.
- marcodiego 5y agoThe slowest swap was at the end probably because it was farther. The position of the head can be inferred by the geometry and last access.
- teddyh 5y agoIIRC, you can already set priorities on different swap partitions, so that the kernel chooses the ones you want it to use first.
- marcodiego 5y agoYes,but it only changes the swap partition/device/file once another one is full.
- Lex-2008 5y agoI might be wrong, but I think I've read somewhere (here on HN) that kernel has no idea about disk head position. It's job of HDD's firmware to reorder read/write instructions it received from kernel for optimal performance. Also, firmware can "remap" some (bad) sectors into reserve area without kernel knowing.
- zozbot234 5y agoModern disks use Logical Block Addressing, so block numbers do correlate with head position but there's no detailed info at the level of cylinders/heads/sectors. Block remapping is a theoretical possibility, but if you see even a single block being remapped in the SMART info it means the disk is dying and you should replace it ASAP.
- zaarn 5y agoSome modern disks, depending on firmware and applications, do in fact do a lot of remapping; they have wear leveling enabled, generally aimed at shoveling data such that the head tends to move less and give you better latencies. Wouldn't surprise me if normal disks are starting to that regardless of usage as reducing tail latencies never hurts much. There is also a difference between remapping a sector and reallocating a sector. Remapping simply means the sector was moved for operational reasons, reallocating means a sector has produced some read errors but did read fine. A disk can operate fine even with 10s of thousands of reallocated sectors (by experience). The dangerous part is SMART reporting you pending and offline sectors, doubly if pending sectors does not go below offline sectors. That is data loss. But simpy put; on modern disks the logical block address has no relation to the position of the head on the platter.
- PixelOfDeath 5y ago> But simpy put; on modern disks the logical block address has no relation to the position of the head on the platter. WD kind of tried that with device managed SMR devices and they show absolutely horrible re-silvering performance. Without a relatively strong relations of linear write/read commands and their physical locations also being mostly linear, spinning rust performance is not on a usable level.
- h2odragon 5y agoDid that on a big SPARC system 20yr ago; had 8 SCSI channels and 36 disk spindles so each one had a small swap partition and they got used like raid0. it was nifty.