linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* zram /proc/swaps accounting weirdness
@ 2012-12-07 23:57 Dan Magenheimer
  2012-12-10  3:15 ` Bob Liu
  2012-12-11  6:26 ` Minchan Kim
  0 siblings, 2 replies; 8+ messages in thread
From: Dan Magenheimer @ 2012-12-07 23:57 UTC (permalink / raw)
  To: Nitin Gupta, Minchan Kim; +Cc: Luigi Semenzato, linux-mm

While playing around with zcache+zram (see separate thread),
I was watching stats with "watch -d".

It appears from the code that /sys/block/num_writes only
increases, never decreases.  In my test, num_writes got up
to 1863.  /sys/block/disksize is 104857600.

I have two swap disks, one zram (pri=60), one real (pri=-1),
and as a I watched /proc/swaps, the "Used" field grew rapidly
and reached the Size (102396k) of the zram swap, and then
the second swap disk (a physical disk partition) started being
used.  Then for awhile, the Used field for both swap devices
was changing (up and down).

Can you explain how this could happen if num_writes never
exceeded 1863?  This may be harmless in the case where
the only swap on the system is zram; or may indicate a bug
somewhere?

It looks like num_writes is counting bio's not pages...
which would imply the bio's are potentially quite large
(and I'll guess they are of size SWAPFILE_CLUSTER which is
defined to be 256).  Do large clusters make sense with zram?

Late on a Friday so sorry if I am incomprehensible...

P.S. The corresponding stat for zcache indicates that
it failed 8852 stores, so I would have expected zram
to deal with no more than 8852 compressions.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-18 17:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-07 23:57 zram /proc/swaps accounting weirdness Dan Magenheimer
2012-12-10  3:15 ` Bob Liu
2012-12-12  0:22   ` Dan Magenheimer
2012-12-11  6:26 ` Minchan Kim
2012-12-12  0:34   ` Dan Magenheimer
2012-12-12  1:12     ` Dan Magenheimer
2013-02-17  1:52       ` Simon Jeons
2013-02-18 17:54         ` Dan Magenheimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).