Sergey Senozhatsky 015254daf1 zram: use notify_free to account all free notifications
`notify_free' device attribute accounts the number of slot free
notifications and internally represents the number of zram_free_page()
calls.  Slot free notifications are sent only when device is used as a
swap device, hence `notify_free' is used only for swap devices.  Since
f4659d8e620d08 (zram: support REQ_DISCARD) ZRAM handles yet another one
free notification (also via zram_free_page() call) -- REQ_DISCARD
requests, which are sent by a filesystem, whenever some data blocks are
discarded.  However, there is no way to know the number of notifications
in the latter case.

Use `notify_free' to account the number of pages freed by
zram_bio_discard() and zram_slot_free_notify().  Depending on usage
scenario `notify_free' represents:

 a) the number of pages freed because of slot free notifications, which is
   equal to the number of swap_slot_free_notify() calls, so there is no
   behaviour change

 b) the number of pages freed because of REQ_DISCARD notifications

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-10-09 22:26:03 -04:00
..
2014-10-09 22:26:02 -04:00
2014-10-08 17:37:16 -04:00
2014-10-08 17:37:16 -04:00
2014-10-07 20:39:25 -04:00
2014-10-08 17:37:16 -04:00
2014-09-22 16:48:47 +09:00
2014-10-08 06:50:18 -04:00
2014-09-22 07:54:10 -07:00
2014-10-03 11:24:46 -07:00
2014-10-08 05:27:39 -04:00
2014-10-08 17:37:16 -04:00
2014-10-07 21:29:18 -04:00
2014-10-08 17:06:53 -04:00
2014-09-06 12:12:09 -07:00
2014-09-24 09:46:29 -07:00
2014-10-08 17:37:16 -04:00
2014-10-07 21:29:18 -04:00
2014-10-08 17:37:16 -04:00
2014-09-11 16:52:29 -07:00