diff options
author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2015-04-15 19:16:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:21 -0400 |
commit | 8f7d282c717acaae25245c61b6b60e8995ec4ef4 (patch) | |
tree | 619cd0a9f363bfccf911f0fe2fe892a5961e9f9b /Documentation | |
parent | 4f2109f60881585dc04fa0b5657a60556576625c (diff) |
zram: deprecate zram attrs sysfs nodes
Add Documentation/ABI/obsolete/sysfs-block-zram file and list obsolete and
deprecated attributes there. The patch also adds additional information
to zram documentation and describes the basic strategy:
- the existing RW nodes will be downgraded to WO nodes (in 4.11)
- deprecated RO sysfs nodes will eventually be removed (in 4.11)
Users will be additionally notified about deprecated attr usage by
pr_warn_once() (added to every deprecated attr _show()), as suggested by
Minchan Kim.
User space is advised to use zram<id>/stat, zram<id>/io_stat and
zram<id>/mm_stat files.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reported-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/obsolete/sysfs-block-zram | 119 | ||||
-rw-r--r-- | Documentation/blockdev/zram.txt | 16 |
2 files changed, 135 insertions, 0 deletions
diff --git a/Documentation/ABI/obsolete/sysfs-block-zram b/Documentation/ABI/obsolete/sysfs-block-zram new file mode 100644 index 000000000000..720ea92cfb2e --- /dev/null +++ b/Documentation/ABI/obsolete/sysfs-block-zram | |||
@@ -0,0 +1,119 @@ | |||
1 | What: /sys/block/zram<id>/num_reads | ||
2 | Date: August 2015 | ||
3 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
4 | Description: | ||
5 | The num_reads file is read-only and specifies the number of | ||
6 | reads (failed or successful) done on this device. | ||
7 | Now accessible via zram<id>/stat node. | ||
8 | |||
9 | What: /sys/block/zram<id>/num_writes | ||
10 | Date: August 2015 | ||
11 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
12 | Description: | ||
13 | The num_writes file is read-only and specifies the number of | ||
14 | writes (failed or successful) done on this device. | ||
15 | Now accessible via zram<id>/stat node. | ||
16 | |||
17 | What: /sys/block/zram<id>/invalid_io | ||
18 | Date: August 2015 | ||
19 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
20 | Description: | ||
21 | The invalid_io file is read-only and specifies the number of | ||
22 | non-page-size-aligned I/O requests issued to this device. | ||
23 | Now accessible via zram<id>/io_stat node. | ||
24 | |||
25 | What: /sys/block/zram<id>/failed_reads | ||
26 | Date: August 2015 | ||
27 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
28 | Description: | ||
29 | The failed_reads file is read-only and specifies the number of | ||
30 | failed reads happened on this device. | ||
31 | Now accessible via zram<id>/io_stat node. | ||
32 | |||
33 | What: /sys/block/zram<id>/failed_writes | ||
34 | Date: August 2015 | ||
35 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
36 | Description: | ||
37 | The failed_writes file is read-only and specifies the number of | ||
38 | failed writes happened on this device. | ||
39 | Now accessible via zram<id>/io_stat node. | ||
40 | |||
41 | What: /sys/block/zram<id>/notify_free | ||
42 | Date: August 2015 | ||
43 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
44 | Description: | ||
45 | The notify_free file is read-only. Depending on device usage | ||
46 | scenario it may account a) the number of pages freed because | ||
47 | of swap slot free notifications or b) the number of pages freed | ||
48 | because of REQ_DISCARD requests sent by bio. The former ones | ||
49 | are sent to a swap block device when a swap slot is freed, which | ||
50 | implies that this disk is being used as a swap disk. The latter | ||
51 | ones are sent by filesystem mounted with discard option, | ||
52 | whenever some data blocks are getting discarded. | ||
53 | Now accessible via zram<id>/io_stat node. | ||
54 | |||
55 | What: /sys/block/zram<id>/zero_pages | ||
56 | Date: August 2015 | ||
57 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
58 | Description: | ||
59 | The zero_pages file is read-only and specifies number of zero | ||
60 | filled pages written to this disk. No memory is allocated for | ||
61 | such pages. | ||
62 | Now accessible via zram<id>/mm_stat node. | ||
63 | |||
64 | What: /sys/block/zram<id>/orig_data_size | ||
65 | Date: August 2015 | ||
66 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
67 | Description: | ||
68 | The orig_data_size file is read-only and specifies uncompressed | ||
69 | size of data stored in this disk. This excludes zero-filled | ||
70 | pages (zero_pages) since no memory is allocated for them. | ||
71 | Unit: bytes | ||
72 | Now accessible via zram<id>/mm_stat node. | ||
73 | |||
74 | What: /sys/block/zram<id>/compr_data_size | ||
75 | Date: August 2015 | ||
76 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
77 | Description: | ||
78 | The compr_data_size file is read-only and specifies compressed | ||
79 | size of data stored in this disk. So, compression ratio can be | ||
80 | calculated using orig_data_size and this statistic. | ||
81 | Unit: bytes | ||
82 | Now accessible via zram<id>/mm_stat node. | ||
83 | |||
84 | What: /sys/block/zram<id>/mem_used_total | ||
85 | Date: August 2015 | ||
86 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
87 | Description: | ||
88 | The mem_used_total file is read-only and specifies the amount | ||
89 | of memory, including allocator fragmentation and metadata | ||
90 | overhead, allocated for this disk. So, allocator space | ||
91 | efficiency can be calculated using compr_data_size and this | ||
92 | statistic. | ||
93 | Unit: bytes | ||
94 | Now accessible via zram<id>/mm_stat node. | ||
95 | |||
96 | What: /sys/block/zram<id>/mem_used_max | ||
97 | Date: August 2015 | ||
98 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
99 | Description: | ||
100 | The mem_used_max file is read/write and specifies the amount | ||
101 | of maximum memory zram have consumed to store compressed data. | ||
102 | For resetting the value, you should write "0". Otherwise, | ||
103 | you could see -EINVAL. | ||
104 | Unit: bytes | ||
105 | Downgraded to write-only node: so it's possible to set new | ||
106 | value only; its current value is stored in zram<id>/mm_stat | ||
107 | node. | ||
108 | |||
109 | What: /sys/block/zram<id>/mem_limit | ||
110 | Date: August 2015 | ||
111 | Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | ||
112 | Description: | ||
113 | The mem_limit file is read/write and specifies the maximum | ||
114 | amount of memory ZRAM can use to store the compressed data. | ||
115 | The limit could be changed in run time and "0" means disable | ||
116 | the limit. No limit is the initial state. Unit: bytes | ||
117 | Downgraded to write-only node: so it's possible to set new | ||
118 | value only; its current value is stored in zram<id>/mm_stat | ||
119 | node. | ||
diff --git a/Documentation/blockdev/zram.txt b/Documentation/blockdev/zram.txt index 7920f4026d36..48a183e29988 100644 --- a/Documentation/blockdev/zram.txt +++ b/Documentation/blockdev/zram.txt | |||
@@ -128,6 +128,22 @@ mem_limit RW the maximum amount of memory ZRAM can use to store | |||
128 | num_migrated RO the number of objects migrated migrated by compaction | 128 | num_migrated RO the number of objects migrated migrated by compaction |
129 | 129 | ||
130 | 130 | ||
131 | WARNING | ||
132 | ======= | ||
133 | per-stat sysfs attributes are considered to be deprecated. | ||
134 | The basic strategy is: | ||
135 | -- the existing RW nodes will be downgraded to WO nodes (in linux 4.11) | ||
136 | -- deprecated RO sysfs nodes will eventually be removed (in linux 4.11) | ||
137 | |||
138 | The list of deprecated attributes can be found here: | ||
139 | Documentation/ABI/obsolete/sysfs-block-zram | ||
140 | |||
141 | Basically, every attribute that has its own read accessible sysfs node | ||
142 | (e.g. num_reads) *AND* is accessible via one of the stat files (zram<id>/stat | ||
143 | or zram<id>/io_stat or zram<id>/mm_stat) is considered to be deprecated. | ||
144 | |||
145 | User space is advised to use the following files to read the device statistics. | ||
146 | |||
131 | File /sys/block/zram<id>/stat | 147 | File /sys/block/zram<id>/stat |
132 | 148 | ||
133 | Represents block layer statistics. Read Documentation/block/stat.txt for | 149 | Represents block layer statistics. Read Documentation/block/stat.txt for |