View Single Post
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#272
Originally Posted by malfunctioning View Post
Everything makes sense and is clear, except the objection misiak proposed (I actually thought about this before I even saw his response ).

It seems (at first sight, anyway) that the percentage of fresh swap remaining should be <= the total amount of swap space remaining reported by free.

But I'm sure I'm wrong and you will clarify things.

EDIT: One way I see this being possible is if the way FlopSwap works is by partitioning the swap space. So you might keep internally a cursor where you start writing sequentially (which is set for example when you make a fresh swap), but which is different of how free swap space is calculated by the free command.

Just speculating.
Well do bear in mind that free is in Kb whereas flopswap outputs Mb.

To better understand what happens I'll explain.
Flopswap gets it's values from /proc/diskstats/, these values are in blocks which are calculated from blocks into Mb, eventually.
Originally Posted by peterleinchen View Post
Each block is 512 bytes.
You have to divide by 2 to get kB.
And then of course by 2048 to get MB.
So yes Flopswap has "a cursor", it stores a block value and calculates your fragmentation from this. When you then refresh this new block value is stored again.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post: