Skip to content

Commit eea3a00

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge second patchbomb from Andrew Morton: - the rest of MM - various misc bits - add ability to run /sbin/reboot at reboot time - printk/vsprintf changes - fiddle with seq_printf() return value * akpm: (114 commits) parisc: remove use of seq_printf return value lru_cache: remove use of seq_printf return value tracing: remove use of seq_printf return value cgroup: remove use of seq_printf return value proc: remove use of seq_printf return value s390: remove use of seq_printf return value cris fasttimer: remove use of seq_printf return value cris: remove use of seq_printf return value openrisc: remove use of seq_printf return value ARM: plat-pxa: remove use of seq_printf return value nios2: cpuinfo: remove use of seq_printf return value microblaze: mb: remove use of seq_printf return value ipc: remove use of seq_printf return value rtc: remove use of seq_printf return value power: wakeup: remove use of seq_printf return value x86: mtrr: if: remove use of seq_printf return value linux/bitmap.h: improve BITMAP_{LAST,FIRST}_WORD_MASK MAINTAINERS: CREDITS: remove Stefano Brivio from B43 .mailmap: add Ricardo Ribalda CREDITS: add Ricardo Ribalda Delgado ...
2 parents e7c8241 + e693d73 commit eea3a00

File tree

136 files changed

+3299
-1834
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+3299
-1834
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Rajesh Shah <[email protected]>
100100
Ralf Baechle <[email protected]>
101101
Ralf Wildenhues <[email protected]>
102102
Rémi Denis-Courmont <[email protected]>
103+
Ricardo Ribalda Delgado <[email protected]>
103104
Rudolf Marek <[email protected]>
104105
Rui Saraiva <[email protected]>
105106
Sachin P Sant <[email protected]>

CREDITS

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,10 @@ E: [email protected]
508508
W: http://paulbristow.net/linux/idefloppy.html
509509
D: Maintainer of IDE/ATAPI floppy driver
510510

511+
N: Stefano Brivio
512+
513+
D: Broadcom B43 driver
514+
511515
N: Dominik Brodowski
512516
513517
W: http://www.brodo.de/
@@ -3008,6 +3012,19 @@ W: http://www.qsl.net/dl1bke/
30083012
D: Generic Z8530 driver, AX.25 DAMA slave implementation
30093013
D: Several AX.25 hacks
30103014

3015+
N: Ricardo Ribalda Delgado
3016+
3017+
W: http://ribalda.com
3018+
D: PLX USB338x driver
3019+
D: PCA9634 driver
3020+
D: Option GTM671WFS
3021+
D: Fintek F81216A
3022+
D: Various kernel hacks
3023+
S: Qtechnology A/S
3024+
S: Valby Langgade 142
3025+
S: 2500 Valby
3026+
S: Denmark
3027+
30113028
N: Francois-Rene Rideau
30123029
30133030
W: http://www.tunes.org/~fare
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
What: /sys/block/zram<id>/num_reads
2+
Date: August 2015
3+
Contact: Sergey Senozhatsky <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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.

Documentation/ABI/testing/sysfs-block-zram

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,28 @@ Description:
141141
amount of memory ZRAM can use to store the compressed data. The
142142
limit could be changed in run time and "0" means disable the
143143
limit. No limit is the initial state. Unit: bytes
144+
145+
What: /sys/block/zram<id>/compact
146+
Date: August 2015
147+
Contact: Minchan Kim <[email protected]>
148+
Description:
149+
The compact file is write-only and trigger compaction for
150+
allocator zrm uses. The allocator moves some objects so that
151+
it could free fragment space.
152+
153+
What: /sys/block/zram<id>/io_stat
154+
Date: August 2015
155+
Contact: Sergey Senozhatsky <[email protected]>
156+
Description:
157+
The io_stat file is read-only and accumulates device's I/O
158+
statistics not accounted by block layer. For example,
159+
failed_reads, failed_writes, etc. File format is similar to
160+
block layer statistics file format.
161+
162+
What: /sys/block/zram<id>/mm_stat
163+
Date: August 2015
164+
Contact: Sergey Senozhatsky <[email protected]>
165+
Description:
166+
The mm_stat file is read-only and represents device's mm
167+
statistics (orig_data_size, compr_data_size, etc.) in a format
168+
similar to block layer statistics file format.

Documentation/blockdev/zram.txt

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,79 @@ size of the disk when not in use so a huge zram is wasteful.
9898
mount /dev/zram1 /tmp
9999

100100
7) Stats:
101-
Per-device statistics are exported as various nodes under
102-
/sys/block/zram<id>/
103-
disksize
104-
num_reads
105-
num_writes
106-
failed_reads
107-
failed_writes
108-
invalid_io
109-
notify_free
110-
zero_pages
111-
orig_data_size
112-
compr_data_size
113-
mem_used_total
114-
mem_used_max
101+
Per-device statistics are exported as various nodes under /sys/block/zram<id>/
102+
103+
A brief description of exported device attritbutes. For more details please
104+
read Documentation/ABI/testing/sysfs-block-zram.
105+
106+
Name access description
107+
---- ------ -----------
108+
disksize RW show and set the device's disk size
109+
initstate RO shows the initialization state of the device
110+
reset WO trigger device reset
111+
num_reads RO the number of reads
112+
failed_reads RO the number of failed reads
113+
num_write RO the number of writes
114+
failed_writes RO the number of failed writes
115+
invalid_io RO the number of non-page-size-aligned I/O requests
116+
max_comp_streams RW the number of possible concurrent compress operations
117+
comp_algorithm RW show and change the compression algorithm
118+
notify_free RO the number of notifications to free pages (either
119+
slot free notifications or REQ_DISCARD requests)
120+
zero_pages RO the number of zero filled pages written to this disk
121+
orig_data_size RO uncompressed size of data stored in this disk
122+
compr_data_size RO compressed size of data stored in this disk
123+
mem_used_total RO the amount of memory allocated for this disk
124+
mem_used_max RW the maximum amount memory zram have consumed to
125+
store compressed data
126+
mem_limit RW the maximum amount of memory ZRAM can use to store
127+
the compressed data
128+
num_migrated RO the number of objects migrated migrated by compaction
129+
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+
147+
File /sys/block/zram<id>/stat
148+
149+
Represents block layer statistics. Read Documentation/block/stat.txt for
150+
details.
151+
152+
File /sys/block/zram<id>/io_stat
153+
154+
The stat file represents device's I/O statistics not accounted by block
155+
layer and, thus, not available in zram<id>/stat file. It consists of a
156+
single line of text and contains the following stats separated by
157+
whitespace:
158+
failed_reads
159+
failed_writes
160+
invalid_io
161+
notify_free
162+
163+
File /sys/block/zram<id>/mm_stat
164+
165+
The stat file represents device's mm statistics. It consists of a single
166+
line of text and contains the following stats separated by whitespace:
167+
orig_data_size
168+
compr_data_size
169+
mem_used_total
170+
mem_limit
171+
mem_used_max
172+
zero_pages
173+
num_migrated
115174

116175
8) Deactivate:
117176
swapoff /dev/zram0

Documentation/filesystems/Locking

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ prototypes:
523523
void (*close)(struct vm_area_struct*);
524524
int (*fault)(struct vm_area_struct*, struct vm_fault *);
525525
int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *);
526+
int (*pfn_mkwrite)(struct vm_area_struct *, struct vm_fault *);
526527
int (*access)(struct vm_area_struct *, unsigned long, void*, int, int);
527528

528529
locking rules:
@@ -532,6 +533,7 @@ close: yes
532533
fault: yes can return with page locked
533534
map_pages: yes
534535
page_mkwrite: yes can return with page locked
536+
pfn_mkwrite: yes
535537
access: yes
536538

537539
->fault() is called when a previously not present pte is about
@@ -558,6 +560,12 @@ the page has been truncated, the filesystem should not look up a new page
558560
like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which
559561
will cause the VM to retry the fault.
560562

563+
->pfn_mkwrite() is the same as page_mkwrite but when the pte is
564+
VM_PFNMAP or VM_MIXEDMAP with a page-less entry. Expected return is
565+
VM_FAULT_NOPAGE. Or one of the VM_FAULT_ERROR types. The default behavior
566+
after this call is to make the pte read-write, unless pfn_mkwrite returns
567+
an error.
568+
561569
->access() is called when get_user_pages() fails in
562570
access_process_vm(), typically used to debug a process through
563571
/proc/pid/mem or ptrace. This function is needed only for

0 commit comments

Comments
 (0)