diff options
author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2014-10-09 18:29:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:26:03 -0400 |
commit | 015254daf1753003c19c46b90ee85a963260d270 (patch) | |
tree | 38a23db2944bfd144d2437bfe09f7c19a386dc45 /Documentation/ABI/testing | |
parent | 461a8eee6af3b55745be64bea403ed0b743563cf (diff) |
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>
Diffstat (limited to 'Documentation/ABI/testing')
-rw-r--r-- | Documentation/ABI/testing/sysfs-block-zram | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Documentation/ABI/testing/sysfs-block-zram b/Documentation/ABI/testing/sysfs-block-zram index b13dc993291f..a6148eaf91e5 100644 --- a/Documentation/ABI/testing/sysfs-block-zram +++ b/Documentation/ABI/testing/sysfs-block-zram | |||
@@ -77,11 +77,14 @@ What: /sys/block/zram<id>/notify_free | |||
77 | Date: August 2010 | 77 | Date: August 2010 |
78 | Contact: Nitin Gupta <ngupta@vflare.org> | 78 | Contact: Nitin Gupta <ngupta@vflare.org> |
79 | Description: | 79 | Description: |
80 | The notify_free file is read-only and specifies the number of | 80 | The notify_free file is read-only. Depending on device usage |
81 | swap slot free notifications received by this device. These | 81 | scenario it may account a) the number of pages freed because |
82 | notifications are sent to a swap block device when a swap slot | 82 | of swap slot free notifications or b) the number of pages freed |
83 | is freed. This statistic is applicable only when this disk is | 83 | because of REQ_DISCARD requests sent by bio. The former ones |
84 | being used as a swap disk. | 84 | are sent to a swap block device when a swap slot is freed, which |
85 | implies that this disk is being used as a swap disk. The latter | ||
86 | ones are sent by filesystem mounted with discard option, | ||
87 | whenever some data blocks are getting discarded. | ||
85 | 88 | ||
86 | What: /sys/block/zram<id>/zero_pages | 89 | What: /sys/block/zram<id>/zero_pages |
87 | Date: August 2010 | 90 | Date: August 2010 |