Skip to content

Commit 05ef8b9

Browse files
committed
Merge tag 'docs-5.6' of git://git.lwn.net/linux
Pull documentation updates from Jonathan Corbet: "It has been a relatively quiet cycle for documentation, but there's still a couple of things of note: - Conversion of the NFS documentation to RST - A new document on how to help with documentation (and a maintainer profile entry too) Plus the usual collection of typo fixes, etc" * tag 'docs-5.6' of git://git.lwn.net/linux: (40 commits) docs: filesystems: add overlayfs to index.rst docs: usb: remove some broken references scripts/find-unused-docs: Fix massive false positives docs: nvdimm: use ReST notation for subsection zram: correct documentation about sysfs node of huge page writeback Documentation: zram: various fixes in zram.rst Add a maintainer entry profile for documentation Add a document on how to contribute to the documentation docs: Keep up with the location of NoUri Documentation: Call out example SYM_FUNC_* usage as x86-specific Documentation: nfs: fault_injection: convert to ReST Documentation: nfs: pnfs-scsi-server: convert to ReST Documentation: nfs: convert pnfs-block-server to ReST Documentation: nfs: idmapper: convert to ReST Documentation: convert nfsd-admin-interfaces to ReST Documentation: nfs-rdma: convert to ReST Documentation: nfsroot.rst: COSMETIC: refill a paragraph Documentation: nfsroot.txt: convert to ReST Documentation: convert nfs.txt to ReST Documentation: filesystems: convert vfat.txt to RST ...
2 parents 08a3ef8 + 77ce1a4 commit 05ef8b9

Some content is hidden

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

44 files changed

+1903
-870
lines changed

Documentation/admin-guide/blockdev/zram.rst

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
========================================
2-
zram: Compressed RAM based block devices
2+
zram: Compressed RAM-based block devices
33
========================================
44

55
Introduction
66
============
77

8-
The zram module creates RAM based block devices named /dev/zram<id>
8+
The zram module creates RAM-based block devices named /dev/zram<id>
99
(<id> = 0, 1, ...). Pages written to these disks are compressed and stored
1010
in memory itself. These disks allow very fast I/O and compression provides
11-
good amounts of memory savings. Some of the usecases include /tmp storage,
12-
use as swap disks, various caches under /var and maybe many more :)
11+
good amounts of memory savings. Some of the use cases include /tmp storage,
12+
use as swap disks, various caches under /var and maybe many more. :)
1313

1414
Statistics for individual zram devices are exported through sysfs nodes at
1515
/sys/block/zram<id>/
@@ -43,17 +43,17 @@ The list of possible return codes:
4343

4444
======== =============================================================
4545
-EBUSY an attempt to modify an attribute that cannot be changed once
46-
the device has been initialised. Please reset device first;
46+
the device has been initialised. Please reset device first.
4747
-ENOMEM zram was not able to allocate enough memory to fulfil your
48-
needs;
48+
needs.
4949
-EINVAL invalid input has been provided.
5050
======== =============================================================
5151

52-
If you use 'echo', the returned value that is changed by 'echo' utility,
52+
If you use 'echo', the returned value is set by the 'echo' utility,
5353
and, in general case, something like::
5454

5555
echo 3 > /sys/block/zram0/max_comp_streams
56-
if [ $? -ne 0 ];
56+
if [ $? -ne 0 ]; then
5757
handle_error
5858
fi
5959

@@ -65,20 +65,21 @@ should suffice.
6565
::
6666

6767
modprobe zram num_devices=4
68-
This creates 4 devices: /dev/zram{0,1,2,3}
68+
69+
This creates 4 devices: /dev/zram{0,1,2,3}
6970

7071
num_devices parameter is optional and tells zram how many devices should be
7172
pre-created. Default: 1.
7273

7374
2) Set max number of compression streams
7475
========================================
7576

76-
Regardless the value passed to this attribute, ZRAM will always
77-
allocate multiple compression streams - one per online CPUs - thus
77+
Regardless of the value passed to this attribute, ZRAM will always
78+
allocate multiple compression streams - one per online CPU - thus
7879
allowing several concurrent compression operations. The number of
7980
allocated compression streams goes down when some of the CPUs
8081
become offline. There is no single-compression-stream mode anymore,
81-
unless you are running a UP system or has only 1 CPU online.
82+
unless you are running a UP system or have only 1 CPU online.
8283

8384
To find out how many streams are currently available::
8485

@@ -89,7 +90,7 @@ To find out how many streams are currently available::
8990

9091
Using comp_algorithm device attribute one can see available and
9192
currently selected (shown in square brackets) compression algorithms,
92-
change selected compression algorithm (once the device is initialised
93+
or change the selected compression algorithm (once the device is initialised
9394
there is no way to change compression algorithm).
9495

9596
Examples::
@@ -167,9 +168,9 @@ Examples::
167168
zram provides a control interface, which enables dynamic (on-demand) device
168169
addition and removal.
169170

170-
In order to add a new /dev/zramX device, perform read operation on hot_add
171-
attribute. This will return either new device's device id (meaning that you
172-
can use /dev/zram<id>) or error code.
171+
In order to add a new /dev/zramX device, perform a read operation on the hot_add
172+
attribute. This will return either the new device's device id (meaning that you
173+
can use /dev/zram<id>) or an error code.
173174

174175
Example::
175176

@@ -186,8 +187,8 @@ execute::
186187

187188
Per-device statistics are exported as various nodes under /sys/block/zram<id>/
188189

189-
A brief description of exported device attributes. For more details please
190-
read Documentation/ABI/testing/sysfs-block-zram.
190+
A brief description of exported device attributes follows. For more details
191+
please read Documentation/ABI/testing/sysfs-block-zram.
191192

192193
====================== ====== ===============================================
193194
Name access description
@@ -245,7 +246,7 @@ whitespace:
245246

246247
File /sys/block/zram<id>/mm_stat
247248

248-
The stat file represents device's mm statistics. It consists of a single
249+
The mm_stat file represents the device's mm statistics. It consists of a single
249250
line of text and contains the following stats separated by whitespace:
250251

251252
================ =============================================================
@@ -261,7 +262,7 @@ line of text and contains the following stats separated by whitespace:
261262
Unit: bytes
262263
mem_limit the maximum amount of memory ZRAM can use to store
263264
the compressed data
264-
mem_used_max the maximum amount of memory zram have consumed to
265+
mem_used_max the maximum amount of memory zram has consumed to
265266
store the data
266267
same_pages the number of same element filled pages written to this disk.
267268
No memory is allocated for such pages.
@@ -271,7 +272,7 @@ line of text and contains the following stats separated by whitespace:
271272

272273
File /sys/block/zram<id>/bd_stat
273274

274-
The stat file represents device's backing device statistics. It consists of
275+
The bd_stat file represents a device's backing device statistics. It consists of
275276
a single line of text and contains the following stats separated by whitespace:
276277

277278
============== =============================================================
@@ -316,17 +317,17 @@ To use the feature, admin should set up backing device via::
316317
echo /dev/sda5 > /sys/block/zramX/backing_dev
317318

318319
before disksize setting. It supports only partition at this moment.
319-
If admin want to use incompressible page writeback, they could do via::
320+
If admin wants to use incompressible page writeback, they could do via::
320321

321-
echo huge > /sys/block/zramX/write
322+
echo huge > /sys/block/zramX/writeback
322323

323324
To use idle page writeback, first, user need to declare zram pages
324325
as idle::
325326

326327
echo all > /sys/block/zramX/idle
327328

328329
From now on, any pages on zram are idle pages. The idle mark
329-
will be removed until someone request access of the block.
330+
will be removed until someone requests access of the block.
330331
IOW, unless there is access request, those pages are still idle pages.
331332

332333
Admin can request writeback of those idle pages at right timing via::
@@ -341,16 +342,16 @@ to guarantee storage health for entire product life.
341342

342343
To overcome the concern, zram supports "writeback_limit" feature.
343344
The "writeback_limit_enable"'s default value is 0 so that it doesn't limit
344-
any writeback. IOW, if admin want to apply writeback budget, he should
345+
any writeback. IOW, if admin wants to apply writeback budget, he should
345346
enable writeback_limit_enable via::
346347

347348
$ echo 1 > /sys/block/zramX/writeback_limit_enable
348349

349350
Once writeback_limit_enable is set, zram doesn't allow any writeback
350-
until admin set the budget via /sys/block/zramX/writeback_limit.
351+
until admin sets the budget via /sys/block/zramX/writeback_limit.
351352

352353
(If admin doesn't enable writeback_limit_enable, writeback_limit's value
353-
assigned via /sys/block/zramX/writeback_limit is meaninless.)
354+
assigned via /sys/block/zramX/writeback_limit is meaningless.)
354355

355356
If admin want to limit writeback as per-day 400M, he could do it
356357
like below::
@@ -361,26 +362,26 @@ like below::
361362
/sys/block/zram0/writeback_limit.
362363
$ echo 1 > /sys/block/zram0/writeback_limit_enable
363364

364-
If admin want to allow further write again once the bugdet is exausted,
365+
If admins want to allow further write again once the bugdet is exhausted,
365366
he could do it like below::
366367

367368
$ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
368369
/sys/block/zram0/writeback_limit
369370

370-
If admin want to see remaining writeback budget since he set::
371+
If admin wants to see remaining writeback budget since last set::
371372

372373
$ cat /sys/block/zramX/writeback_limit
373374

374375
If admin want to disable writeback limit, he could do::
375376

376377
$ echo 0 > /sys/block/zramX/writeback_limit_enable
377378

378-
The writeback_limit count will reset whenever you reset zram(e.g.,
379+
The writeback_limit count will reset whenever you reset zram (e.g.,
379380
system reboot, echo 1 > /sys/block/zramX/reset) so keeping how many of
380381
writeback happened until you reset the zram to allocate extra writeback
381382
budget in next setting is user's job.
382383

383-
If admin want to measure writeback count in a certain period, he could
384+
If admin wants to measure writeback count in a certain period, he could
384385
know it via /sys/block/zram0/bd_stat's 3rd column.
385386

386387
memory tracking

Documentation/admin-guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ configure specific aspects of kernel behavior to your liking.
7676
device-mapper/index
7777
efi-stub
7878
ext4
79+
nfs/index
7980
gpio/index
8081
highuid
8182
hw_random

Documentation/filesystems/nfs/fault_injection.txt renamed to Documentation/admin-guide/nfs/fault_injection.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
===================
2+
NFS Fault Injection
3+
===================
14

2-
Fault Injection
3-
===============
45
Fault injection is a method for forcing errors that may not normally occur, or
56
may be difficult to reproduce. Forcing these errors in a controlled environment
67
can help the developer find and fix bugs before their code is shipped in a
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
=============
2+
NFS
3+
=============
4+
5+
.. toctree::
6+
:maxdepth: 1
7+
8+
nfs-client
9+
nfsroot
10+
nfs-rdma
11+
nfsd-admin-interfaces
12+
nfs-idmapper
13+
pnfs-block-server
14+
pnfs-scsi-server
15+
fault_injection

Documentation/filesystems/nfs/nfs.txt renamed to Documentation/admin-guide/nfs/nfs-client.rst

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
==========
2+
NFS Client
3+
==========
14

25
The NFS client
36
==============
@@ -59,10 +62,11 @@ The DNS resolver
5962

6063
NFSv4 allows for one server to refer the NFS client to data that has been
6164
migrated onto another server by means of the special "fs_locations"
62-
attribute. See
63-
http://tools.ietf.org/html/rfc3530#section-6
64-
and
65-
http://tools.ietf.org/html/draft-ietf-nfsv4-referrals-00
65+
attribute. See `RFC3530 Section 6: Filesystem Migration and Replication`_ and
66+
`Implementation Guide for Referrals in NFSv4`_.
67+
68+
.. _RFC3530 Section 6\: Filesystem Migration and Replication: http://tools.ietf.org/html/rfc3530#section-6
69+
.. _Implementation Guide for Referrals in NFSv4: http://tools.ietf.org/html/draft-ietf-nfsv4-referrals-00
6670

6771
The fs_locations information can take the form of either an ip address and
6872
a path, or a DNS hostname and a path. The latter requires the NFS client to
@@ -78,8 +82,8 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual
7882
(2) If no valid entry exists, the helper script '/sbin/nfs_cache_getent'
7983
(may be changed using the 'nfs.cache_getent' kernel boot parameter)
8084
is run, with two arguments:
81-
- the cache name, "dns_resolve"
82-
- the hostname to resolve
85+
- the cache name, "dns_resolve"
86+
- the hostname to resolve
8387

8488
(3) After looking up the corresponding ip address, the helper script
8589
writes the result into the rpc_pipefs pseudo-file
@@ -94,43 +98,44 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual
9498
script, and <ttl> is the 'time to live' of this cache entry (in
9599
units of seconds).
96100

97-
Note: If <ip address> is invalid, say the string "0", then a negative
98-
entry is created, which will cause the kernel to treat the hostname
99-
as having no valid DNS translation.
101+
.. note::
102+
If <ip address> is invalid, say the string "0", then a negative
103+
entry is created, which will cause the kernel to treat the hostname
104+
as having no valid DNS translation.
100105

101106

102107

103108

104109
A basic sample /sbin/nfs_cache_getent
105110
=====================================
106-
107-
#!/bin/bash
108-
#
109-
ttl=600
110-
#
111-
cut=/usr/bin/cut
112-
getent=/usr/bin/getent
113-
rpc_pipefs=/var/lib/nfs/rpc_pipefs
114-
#
115-
die()
116-
{
117-
echo "Usage: $0 cache_name entry_name"
118-
exit 1
119-
}
120-
121-
[ $# -lt 2 ] && die
122-
cachename="$1"
123-
cache_path=${rpc_pipefs}/cache/${cachename}/channel
124-
125-
case "${cachename}" in
126-
dns_resolve)
127-
name="$2"
128-
result="$(${getent} hosts ${name} | ${cut} -f1 -d\ )"
129-
[ -z "${result}" ] && result="0"
130-
;;
131-
*)
132-
die
133-
;;
134-
esac
135-
echo "${result} ${name} ${ttl}" >${cache_path}
136-
111+
.. code-block:: sh
112+
113+
#!/bin/bash
114+
#
115+
ttl=600
116+
#
117+
cut=/usr/bin/cut
118+
getent=/usr/bin/getent
119+
rpc_pipefs=/var/lib/nfs/rpc_pipefs
120+
#
121+
die()
122+
{
123+
echo "Usage: $0 cache_name entry_name"
124+
exit 1
125+
}
126+
127+
[ $# -lt 2 ] && die
128+
cachename="$1"
129+
cache_path=${rpc_pipefs}/cache/${cachename}/channel
130+
131+
case "${cachename}" in
132+
dns_resolve)
133+
name="$2"
134+
result="$(${getent} hosts ${name} | ${cut} -f1 -d\ )"
135+
[ -z "${result}" ] && result="0"
136+
;;
137+
*)
138+
die
139+
;;
140+
esac
141+
echo "${result} ${name} ${ttl}" >${cache_path}

0 commit comments

Comments
 (0)