summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-04-18 16:29:24 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-07-15 08:20:26 -0400
commit39443104c7d3f2b05a4a330fbcef6da68f80d60b (patch)
tree4405b2a60e9fa358522e4b90f564b135ff638c02
parente0ae154404c33477473244f286b1193364144289 (diff)
docs: blockdev: convert to ReST
Rename the blockdev documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system. The drbd sub-directory contains some graphs and data flows. Add those too to the documentation. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt18
-rw-r--r--Documentation/blockdev/drbd/data-structure-v9.rst (renamed from Documentation/blockdev/drbd/data-structure-v9.txt)6
-rw-r--r--Documentation/blockdev/drbd/figures.rst28
-rw-r--r--Documentation/blockdev/drbd/index.rst (renamed from Documentation/blockdev/drbd/README.txt)15
-rw-r--r--Documentation/blockdev/floppy.rst (renamed from Documentation/blockdev/floppy.txt)88
-rw-r--r--Documentation/blockdev/index.rst16
-rw-r--r--Documentation/blockdev/nbd.rst (renamed from Documentation/blockdev/nbd.txt)2
-rw-r--r--Documentation/blockdev/paride.rst (renamed from Documentation/blockdev/paride.txt)196
-rw-r--r--Documentation/blockdev/ramdisk.rst (renamed from Documentation/blockdev/ramdisk.txt)55
-rw-r--r--Documentation/blockdev/zram.rst (renamed from Documentation/blockdev/zram.txt)195
-rw-r--r--MAINTAINERS8
-rw-r--r--drivers/block/Kconfig8
-rw-r--r--drivers/block/floppy.c2
-rw-r--r--drivers/block/zram/Kconfig6
-rw-r--r--tools/testing/selftests/zram/README2
15 files changed, 399 insertions, 246 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index a342dd5c95a9..6b2adda1cc03 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1249,7 +1249,7 @@
1249 See also Documentation/fault-injection/. 1249 See also Documentation/fault-injection/.
1250 1250
1251 floppy= [HW] 1251 floppy= [HW]
1252 See Documentation/blockdev/floppy.txt. 1252 See Documentation/blockdev/floppy.rst.
1253 1253
1254 force_pal_cache_flush 1254 force_pal_cache_flush
1255 [IA-64] Avoid check_sal_cache_flush which may hang on 1255 [IA-64] Avoid check_sal_cache_flush which may hang on
@@ -2234,7 +2234,7 @@
2234 memblock=debug [KNL] Enable memblock debug messages. 2234 memblock=debug [KNL] Enable memblock debug messages.
2235 2235
2236 load_ramdisk= [RAM] List of ramdisks to load from floppy 2236 load_ramdisk= [RAM] List of ramdisks to load from floppy
2237 See Documentation/blockdev/ramdisk.txt. 2237 See Documentation/blockdev/ramdisk.rst.
2238 2238
2239 lockd.nlm_grace_period=P [NFS] Assign grace period. 2239 lockd.nlm_grace_period=P [NFS] Assign grace period.
2240 Format: <integer> 2240 Format: <integer>
@@ -3268,7 +3268,7 @@
3268 3268
3269 pcd. [PARIDE] 3269 pcd. [PARIDE]
3270 See header of drivers/block/paride/pcd.c. 3270 See header of drivers/block/paride/pcd.c.
3271 See also Documentation/blockdev/paride.txt. 3271 See also Documentation/blockdev/paride.rst.
3272 3272
3273 pci=option[,option...] [PCI] various PCI subsystem options. 3273 pci=option[,option...] [PCI] various PCI subsystem options.
3274 3274
@@ -3512,7 +3512,7 @@
3512 needed on a platform with proper driver support. 3512 needed on a platform with proper driver support.
3513 3513
3514 pd. [PARIDE] 3514 pd. [PARIDE]
3515 See Documentation/blockdev/paride.txt. 3515 See Documentation/blockdev/paride.rst.
3516 3516
3517 pdcchassis= [PARISC,HW] Disable/Enable PDC Chassis Status codes at 3517 pdcchassis= [PARISC,HW] Disable/Enable PDC Chassis Status codes at
3518 boot time. 3518 boot time.
@@ -3527,10 +3527,10 @@
3527 and performance comparison. 3527 and performance comparison.
3528 3528
3529 pf. [PARIDE] 3529 pf. [PARIDE]
3530 See Documentation/blockdev/paride.txt. 3530 See Documentation/blockdev/paride.rst.
3531 3531
3532 pg. [PARIDE] 3532 pg. [PARIDE]
3533 See Documentation/blockdev/paride.txt. 3533 See Documentation/blockdev/paride.rst.
3534 3534
3535 pirq= [SMP,APIC] Manual mp-table setup 3535 pirq= [SMP,APIC] Manual mp-table setup
3536 See Documentation/x86/i386/IO-APIC.rst. 3536 See Documentation/x86/i386/IO-APIC.rst.
@@ -3642,7 +3642,7 @@
3642 3642
3643 prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk 3643 prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk
3644 before loading. 3644 before loading.
3645 See Documentation/blockdev/ramdisk.txt. 3645 See Documentation/blockdev/ramdisk.rst.
3646 3646
3647 psi= [KNL] Enable or disable pressure stall information 3647 psi= [KNL] Enable or disable pressure stall information
3648 tracking. 3648 tracking.
@@ -3664,7 +3664,7 @@
3664 pstore.backend= Specify the name of the pstore backend to use 3664 pstore.backend= Specify the name of the pstore backend to use
3665 3665
3666 pt. [PARIDE] 3666 pt. [PARIDE]
3667 See Documentation/blockdev/paride.txt. 3667 See Documentation/blockdev/paride.rst.
3668 3668
3669 pti= [X86_64] Control Page Table Isolation of user and 3669 pti= [X86_64] Control Page Table Isolation of user and
3670 kernel address spaces. Disabling this feature 3670 kernel address spaces. Disabling this feature
@@ -3693,7 +3693,7 @@
3693 See Documentation/admin-guide/md.rst. 3693 See Documentation/admin-guide/md.rst.
3694 3694
3695 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes 3695 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
3696 See Documentation/blockdev/ramdisk.txt. 3696 See Documentation/blockdev/ramdisk.rst.
3697 3697
3698 random.trust_cpu={on,off} 3698 random.trust_cpu={on,off}
3699 [KNL] Enable or disable trusting the use of the 3699 [KNL] Enable or disable trusting the use of the
diff --git a/Documentation/blockdev/drbd/data-structure-v9.txt b/Documentation/blockdev/drbd/data-structure-v9.rst
index 1e52a0e32624..66036b901644 100644
--- a/Documentation/blockdev/drbd/data-structure-v9.txt
+++ b/Documentation/blockdev/drbd/data-structure-v9.rst
@@ -1,3 +1,7 @@
1================================
2kernel data structure for DRBD-9
3================================
4
1This describes the in kernel data structure for DRBD-9. Starting with 5This describes the in kernel data structure for DRBD-9. Starting with
2Linux v3.14 we are reorganizing DRBD to use this data structure. 6Linux v3.14 we are reorganizing DRBD to use this data structure.
3 7
@@ -10,7 +14,7 @@ device is represented by a block device locally.
10 14
11The DRBD objects are interconnected to form a matrix as depicted below; a 15The DRBD objects are interconnected to form a matrix as depicted below; a
12drbd_peer_device object sits at each intersection between a drbd_device and a 16drbd_peer_device object sits at each intersection between a drbd_device and a
13drbd_connection: 17drbd_connection::
14 18
15 /--------------+---------------+.....+---------------\ 19 /--------------+---------------+.....+---------------\
16 | resource | device | | device | 20 | resource | device | | device |
diff --git a/Documentation/blockdev/drbd/figures.rst b/Documentation/blockdev/drbd/figures.rst
new file mode 100644
index 000000000000..3e3fd4b8a478
--- /dev/null
+++ b/Documentation/blockdev/drbd/figures.rst
@@ -0,0 +1,28 @@
1.. The here included files are intended to help understand the implementation
2
3Data flows that Relate some functions, and write packets
4========================================================
5
6.. kernel-figure:: DRBD-8.3-data-packets.svg
7 :alt: DRBD-8.3-data-packets.svg
8 :align: center
9
10.. kernel-figure:: DRBD-data-packets.svg
11 :alt: DRBD-data-packets.svg
12 :align: center
13
14
15Sub graphs of DRBD's state transitions
16======================================
17
18.. kernel-figure:: conn-states-8.dot
19 :alt: conn-states-8.dot
20 :align: center
21
22.. kernel-figure:: disk-states-8.dot
23 :alt: disk-states-8.dot
24 :align: center
25
26.. kernel-figure:: node-states-8.dot
27 :alt: node-states-8.dot
28 :align: center
diff --git a/Documentation/blockdev/drbd/README.txt b/Documentation/blockdev/drbd/index.rst
index 627b0a1bf35e..68ecd5c113e9 100644
--- a/Documentation/blockdev/drbd/README.txt
+++ b/Documentation/blockdev/drbd/index.rst
@@ -1,4 +1,9 @@
1==========================================
2Distributed Replicated Block Device - DRBD
3==========================================
4
1Description 5Description
6===========
2 7
3 DRBD is a shared-nothing, synchronously replicated block device. It 8 DRBD is a shared-nothing, synchronously replicated block device. It
4 is designed to serve as a building block for high availability 9 is designed to serve as a building block for high availability
@@ -7,10 +12,8 @@ Description
7 12
8 Please visit http://www.drbd.org to find out more. 13 Please visit http://www.drbd.org to find out more.
9 14
10The here included files are intended to help understand the implementation 15.. toctree::
11 16 :maxdepth: 1
12DRBD-8.3-data-packets.svg, DRBD-data-packets.svg
13 relates some functions, and write packets.
14 17
15conn-states-8.dot, disk-states-8.dot, node-states-8.dot 18 data-structure-v9
16 The sub graphs of DRBD's state transitions 19 figures
diff --git a/Documentation/blockdev/floppy.txt b/Documentation/blockdev/floppy.rst
index e2240f5ab64d..4a8f31cf4139 100644
--- a/Documentation/blockdev/floppy.txt
+++ b/Documentation/blockdev/floppy.rst
@@ -1,35 +1,37 @@
1This file describes the floppy driver. 1=============
2Floppy Driver
3=============
2 4
3FAQ list: 5FAQ list:
4========= 6=========
5 7
6 A FAQ list may be found in the fdutils package (see below), and also 8A FAQ list may be found in the fdutils package (see below), and also
7at <http://fdutils.linux.lu/faq.html>. 9at <http://fdutils.linux.lu/faq.html>.
8 10
9 11
10LILO configuration options (Thinkpad users, read this) 12LILO configuration options (Thinkpad users, read this)
11====================================================== 13======================================================
12 14
13 The floppy driver is configured using the 'floppy=' option in 15The floppy driver is configured using the 'floppy=' option in
14lilo. This option can be typed at the boot prompt, or entered in the 16lilo. This option can be typed at the boot prompt, or entered in the
15lilo configuration file. 17lilo configuration file.
16 18
17 Example: If your kernel is called linux-2.6.9, type the following line 19Example: If your kernel is called linux-2.6.9, type the following line
18at the lilo boot prompt (if you have a thinkpad): 20at the lilo boot prompt (if you have a thinkpad)::
19 21
20 linux-2.6.9 floppy=thinkpad 22 linux-2.6.9 floppy=thinkpad
21 23
22You may also enter the following line in /etc/lilo.conf, in the description 24You may also enter the following line in /etc/lilo.conf, in the description
23of linux-2.6.9: 25of linux-2.6.9::
24 26
25 append = "floppy=thinkpad" 27 append = "floppy=thinkpad"
26 28
27 Several floppy related options may be given, example: 29Several floppy related options may be given, example::
28 30
29 linux-2.6.9 floppy=daring floppy=two_fdc 31 linux-2.6.9 floppy=daring floppy=two_fdc
30 append = "floppy=daring floppy=two_fdc" 32 append = "floppy=daring floppy=two_fdc"
31 33
32 If you give options both in the lilo config file and on the boot 34If you give options both in the lilo config file and on the boot
33prompt, the option strings of both places are concatenated, the boot 35prompt, the option strings of both places are concatenated, the boot
34prompt options coming last. That's why there are also options to 36prompt options coming last. That's why there are also options to
35restore the default behavior. 37restore the default behavior.
@@ -38,21 +40,23 @@ restore the default behavior.
38Module configuration options 40Module configuration options
39============================ 41============================
40 42
41 If you use the floppy driver as a module, use the following syntax: 43If you use the floppy driver as a module, use the following syntax::
42modprobe floppy floppy="<options>"
43 44
44Example: 45 modprobe floppy floppy="<options>"
45 modprobe floppy floppy="omnibook messages"
46 46
47 If you need certain options enabled every time you load the floppy driver, 47Example::
48you can put:
49 48
50 options floppy floppy="omnibook messages" 49 modprobe floppy floppy="omnibook messages"
50
51If you need certain options enabled every time you load the floppy driver,
52you can put::
53
54 options floppy floppy="omnibook messages"
51 55
52in a configuration file in /etc/modprobe.d/. 56in a configuration file in /etc/modprobe.d/.
53 57
54 58
55 The floppy driver related options are: 59The floppy driver related options are:
56 60
57 floppy=asus_pci 61 floppy=asus_pci
58 Sets the bit mask to allow only units 0 and 1. (default) 62 Sets the bit mask to allow only units 0 and 1. (default)
@@ -70,8 +74,7 @@ in a configuration file in /etc/modprobe.d/.
70 Tells the floppy driver that you have only one floppy controller. 74 Tells the floppy driver that you have only one floppy controller.
71 (default) 75 (default)
72 76
73 floppy=two_fdc 77 floppy=two_fdc / floppy=<address>,two_fdc
74 floppy=<address>,two_fdc
75 Tells the floppy driver that you have two floppy controllers. 78 Tells the floppy driver that you have two floppy controllers.
76 The second floppy controller is assumed to be at <address>. 79 The second floppy controller is assumed to be at <address>.
77 This option is not needed if the second controller is at address 80 This option is not needed if the second controller is at address
@@ -84,8 +87,7 @@ in a configuration file in /etc/modprobe.d/.
84 floppy=0,thinkpad 87 floppy=0,thinkpad
85 Tells the floppy driver that you don't have a Thinkpad. 88 Tells the floppy driver that you don't have a Thinkpad.
86 89
87 floppy=omnibook 90 floppy=omnibook / floppy=nodma
88 floppy=nodma
89 Tells the floppy driver not to use Dma for data transfers. 91 Tells the floppy driver not to use Dma for data transfers.
90 This is needed on HP Omnibooks, which don't have a workable 92 This is needed on HP Omnibooks, which don't have a workable
91 DMA channel for the floppy driver. This option is also useful 93 DMA channel for the floppy driver. This option is also useful
@@ -144,14 +146,16 @@ in a configuration file in /etc/modprobe.d/.
144 described in the physical CMOS), or if your BIOS uses 146 described in the physical CMOS), or if your BIOS uses
145 non-standard CMOS types. The CMOS types are: 147 non-standard CMOS types. The CMOS types are:
146 148
147 0 - Use the value of the physical CMOS 149 == ==================================
148 1 - 5 1/4 DD 150 0 Use the value of the physical CMOS
149 2 - 5 1/4 HD 151 1 5 1/4 DD
150 3 - 3 1/2 DD 152 2 5 1/4 HD
151 4 - 3 1/2 HD 153 3 3 1/2 DD
152 5 - 3 1/2 ED 154 4 3 1/2 HD
153 6 - 3 1/2 ED 155 5 3 1/2 ED
154 16 - unknown or not installed 156 6 3 1/2 ED
157 16 unknown or not installed
158 == ==================================
155 159
156 (Note: there are two valid types for ED drives. This is because 5 was 160 (Note: there are two valid types for ED drives. This is because 5 was
157 initially chosen to represent floppy *tapes*, and 6 for ED drives. 161 initially chosen to represent floppy *tapes*, and 6 for ED drives.
@@ -162,8 +166,7 @@ in a configuration file in /etc/modprobe.d/.
162 Print a warning message when an unexpected interrupt is received. 166 Print a warning message when an unexpected interrupt is received.
163 (default) 167 (default)
164 168
165 floppy=no_unexpected_interrupts 169 floppy=no_unexpected_interrupts / floppy=L40SX
166 floppy=L40SX
167 Don't print a message when an unexpected interrupt is received. This 170 Don't print a message when an unexpected interrupt is received. This
168 is needed on IBM L40SX laptops in certain video modes. (There seems 171 is needed on IBM L40SX laptops in certain video modes. (There seems
169 to be an interaction between video and floppy. The unexpected 172 to be an interaction between video and floppy. The unexpected
@@ -199,47 +202,54 @@ in a configuration file in /etc/modprobe.d/.
199 Sets the floppy DMA channel to <nr> instead of 2. 202 Sets the floppy DMA channel to <nr> instead of 2.
200 203
201 floppy=slow 204 floppy=slow
202 Use PS/2 stepping rate: 205 Use PS/2 stepping rate::
203 " PS/2 floppies have much slower step rates than regular floppies. 206
207 PS/2 floppies have much slower step rates than regular floppies.
204 It's been recommended that take about 1/4 of the default speed 208 It's been recommended that take about 1/4 of the default speed
205 in some more extreme cases." 209 in some more extreme cases.
206 210
207 211
208Supporting utilities and additional documentation: 212Supporting utilities and additional documentation:
209================================================== 213==================================================
210 214
211 Additional parameters of the floppy driver can be configured at 215Additional parameters of the floppy driver can be configured at
212runtime. Utilities which do this can be found in the fdutils package. 216runtime. Utilities which do this can be found in the fdutils package.
213This package also contains a new version of mtools which allows to 217This package also contains a new version of mtools which allows to
214access high capacity disks (up to 1992K on a high density 3 1/2 disk!). 218access high capacity disks (up to 1992K on a high density 3 1/2 disk!).
215It also contains additional documentation about the floppy driver. 219It also contains additional documentation about the floppy driver.
216 220
217The latest version can be found at fdutils homepage: 221The latest version can be found at fdutils homepage:
222
218 http://fdutils.linux.lu 223 http://fdutils.linux.lu
219 224
220The fdutils releases can be found at: 225The fdutils releases can be found at:
226
221 http://fdutils.linux.lu/download.html 227 http://fdutils.linux.lu/download.html
228
222 http://www.tux.org/pub/knaff/fdutils/ 229 http://www.tux.org/pub/knaff/fdutils/
230
223 ftp://metalab.unc.edu/pub/Linux/utils/disk-management/ 231 ftp://metalab.unc.edu/pub/Linux/utils/disk-management/
224 232
225Reporting problems about the floppy driver 233Reporting problems about the floppy driver
226========================================== 234==========================================
227 235
228 If you have a question or a bug report about the floppy driver, mail 236If you have a question or a bug report about the floppy driver, mail
229me at Alain.Knaff@poboxes.com . If you post to Usenet, preferably use 237me at Alain.Knaff@poboxes.com . If you post to Usenet, preferably use
230comp.os.linux.hardware. As the volume in these groups is rather high, 238comp.os.linux.hardware. As the volume in these groups is rather high,
231be sure to include the word "floppy" (or "FLOPPY") in the subject 239be sure to include the word "floppy" (or "FLOPPY") in the subject
232line. If the reported problem happens when mounting floppy disks, be 240line. If the reported problem happens when mounting floppy disks, be
233sure to mention also the type of the filesystem in the subject line. 241sure to mention also the type of the filesystem in the subject line.
234 242
235 Be sure to read the FAQ before mailing/posting any bug reports! 243Be sure to read the FAQ before mailing/posting any bug reports!
236 244
237 Alain 245Alain
238 246
239Changelog 247Changelog
240========= 248=========
241 249
24210-30-2004 : Cleanup, updating, add reference to module configuration. 25010-30-2004 :
251 Cleanup, updating, add reference to module configuration.
243 James Nelson <james4765@gmail.com> 252 James Nelson <james4765@gmail.com>
244 253
2456-3-2000 : Original Document 2546-3-2000 :
255 Original Document
diff --git a/Documentation/blockdev/index.rst b/Documentation/blockdev/index.rst
new file mode 100644
index 000000000000..a9af6ed8b4aa
--- /dev/null
+++ b/Documentation/blockdev/index.rst
@@ -0,0 +1,16 @@
1:orphan:
2
3===========================
4The Linux RapidIO Subsystem
5===========================
6
7.. toctree::
8 :maxdepth: 1
9
10 floppy
11 nbd
12 paride
13 ramdisk
14 zram
15
16 drbd/index
diff --git a/Documentation/blockdev/nbd.txt b/Documentation/blockdev/nbd.rst
index db242ea2bce8..d78dfe559dcf 100644
--- a/Documentation/blockdev/nbd.txt
+++ b/Documentation/blockdev/nbd.rst
@@ -1,3 +1,4 @@
1==================================
1Network Block Device (TCP version) 2Network Block Device (TCP version)
2================================== 3==================================
3 4
@@ -28,4 +29,3 @@ max_part
28 29
29nbds_max 30nbds_max
30 Number of block devices that should be initialized (default: 16). 31 Number of block devices that should be initialized (default: 16).
31
diff --git a/Documentation/blockdev/paride.txt b/Documentation/blockdev/paride.rst
index ee6717e3771d..87b4278bf314 100644
--- a/Documentation/blockdev/paride.txt
+++ b/Documentation/blockdev/paride.rst
@@ -1,15 +1,17 @@
1 1===================================
2 Linux and parallel port IDE devices 2Linux and parallel port IDE devices
3===================================
3 4
4PARIDE v1.03 (c) 1997-8 Grant Guenther <grant@torque.net> 5PARIDE v1.03 (c) 1997-8 Grant Guenther <grant@torque.net>
5 6
61. Introduction 71. Introduction
8===============
7 9
8Owing to the simplicity and near universality of the parallel port interface 10Owing to the simplicity and near universality of the parallel port interface
9to personal computers, many external devices such as portable hard-disk, 11to personal computers, many external devices such as portable hard-disk,
10CD-ROM, LS-120 and tape drives use the parallel port to connect to their 12CD-ROM, LS-120 and tape drives use the parallel port to connect to their
11host computer. While some devices (notably scanners) use ad-hoc methods 13host computer. While some devices (notably scanners) use ad-hoc methods
12to pass commands and data through the parallel port interface, most 14to pass commands and data through the parallel port interface, most
13external devices are actually identical to an internal model, but with 15external devices are actually identical to an internal model, but with
14a parallel-port adapter chip added in. Some of the original parallel port 16a parallel-port adapter chip added in. Some of the original parallel port
15adapters were little more than mechanisms for multiplexing a SCSI bus. 17adapters were little more than mechanisms for multiplexing a SCSI bus.
@@ -28,47 +30,50 @@ were to open up a parallel port CD-ROM drive, for instance, one would
28find a standard ATAPI CD-ROM drive, a power supply, and a single adapter 30find a standard ATAPI CD-ROM drive, a power supply, and a single adapter
29that interconnected a standard PC parallel port cable and a standard 31that interconnected a standard PC parallel port cable and a standard
30IDE cable. It is usually possible to exchange the CD-ROM device with 32IDE cable. It is usually possible to exchange the CD-ROM device with
31any other device using the IDE interface. 33any other device using the IDE interface.
32 34
33The document describes the support in Linux for parallel port IDE 35The document describes the support in Linux for parallel port IDE
34devices. It does not cover parallel port SCSI devices, "ditto" tape 36devices. It does not cover parallel port SCSI devices, "ditto" tape
35drives or scanners. Many different devices are supported by the 37drives or scanners. Many different devices are supported by the
36parallel port IDE subsystem, including: 38parallel port IDE subsystem, including:
37 39
38 MicroSolutions backpack CD-ROM 40 - MicroSolutions backpack CD-ROM
39 MicroSolutions backpack PD/CD 41 - MicroSolutions backpack PD/CD
40 MicroSolutions backpack hard-drives 42 - MicroSolutions backpack hard-drives
41 MicroSolutions backpack 8000t tape drive 43 - MicroSolutions backpack 8000t tape drive
42 SyQuest EZ-135, EZ-230 & SparQ drives 44 - SyQuest EZ-135, EZ-230 & SparQ drives
43 Avatar Shark 45 - Avatar Shark
44 Imation Superdisk LS-120 46 - Imation Superdisk LS-120
45 Maxell Superdisk LS-120 47 - Maxell Superdisk LS-120
46 FreeCom Power CD 48 - FreeCom Power CD
47 Hewlett-Packard 5GB and 8GB tape drives 49 - Hewlett-Packard 5GB and 8GB tape drives
48 Hewlett-Packard 7100 and 7200 CD-RW drives 50 - Hewlett-Packard 7100 and 7200 CD-RW drives
49 51
50as well as most of the clone and no-name products on the market. 52as well as most of the clone and no-name products on the market.
51 53
52To support such a wide range of devices, PARIDE, the parallel port IDE 54To support such a wide range of devices, PARIDE, the parallel port IDE
53subsystem, is actually structured in three parts. There is a base 55subsystem, is actually structured in three parts. There is a base
54paride module which provides a registry and some common methods for 56paride module which provides a registry and some common methods for
55accessing the parallel ports. The second component is a set of 57accessing the parallel ports. The second component is a set of
56high-level drivers for each of the different types of supported devices: 58high-level drivers for each of the different types of supported devices:
57 59
60 === =============
58 pd IDE disk 61 pd IDE disk
59 pcd ATAPI CD-ROM 62 pcd ATAPI CD-ROM
60 pf ATAPI disk 63 pf ATAPI disk
61 pt ATAPI tape 64 pt ATAPI tape
62 pg ATAPI generic 65 pg ATAPI generic
66 === =============
63 67
64(Currently, the pg driver is only used with CD-R drives). 68(Currently, the pg driver is only used with CD-R drives).
65 69
66The high-level drivers function according to the relevant standards. 70The high-level drivers function according to the relevant standards.
67The third component of PARIDE is a set of low-level protocol drivers 71The third component of PARIDE is a set of low-level protocol drivers
68for each of the parallel port IDE adapter chips. Thanks to the interest 72for each of the parallel port IDE adapter chips. Thanks to the interest
69and encouragement of Linux users from many parts of the world, 73and encouragement of Linux users from many parts of the world,
70support is available for almost all known adapter protocols: 74support is available for almost all known adapter protocols:
71 75
76 ==== ====================================== ====
72 aten ATEN EH-100 (HK) 77 aten ATEN EH-100 (HK)
73 bpck Microsolutions backpack (US) 78 bpck Microsolutions backpack (US)
74 comm DataStor (old-type) "commuter" adapter (TW) 79 comm DataStor (old-type) "commuter" adapter (TW)
@@ -83,9 +88,11 @@ support is available for almost all known adapter protocols:
83 ktti KT Technology PHd adapter (SG) 88 ktti KT Technology PHd adapter (SG)
84 on20 OnSpec 90c20 (US) 89 on20 OnSpec 90c20 (US)
85 on26 OnSpec 90c26 (US) 90 on26 OnSpec 90c26 (US)
91 ==== ====================================== ====
86 92
87 93
882. Using the PARIDE subsystem 942. Using the PARIDE subsystem
95=============================
89 96
90While configuring the Linux kernel, you may choose either to build 97While configuring the Linux kernel, you may choose either to build
91the PARIDE drivers into your kernel, or to build them as modules. 98the PARIDE drivers into your kernel, or to build them as modules.
@@ -94,10 +101,10 @@ In either case, you will need to select "Parallel port IDE device support"
94as well as at least one of the high-level drivers and at least one 101as well as at least one of the high-level drivers and at least one
95of the parallel port communication protocols. If you do not know 102of the parallel port communication protocols. If you do not know
96what kind of parallel port adapter is used in your drive, you could 103what kind of parallel port adapter is used in your drive, you could
97begin by checking the file names and any text files on your DOS 104begin by checking the file names and any text files on your DOS
98installation floppy. Alternatively, you can look at the markings on 105installation floppy. Alternatively, you can look at the markings on
99the adapter chip itself. That's usually sufficient to identify the 106the adapter chip itself. That's usually sufficient to identify the
100correct device. 107correct device.
101 108
102You can actually select all the protocol modules, and allow the PARIDE 109You can actually select all the protocol modules, and allow the PARIDE
103subsystem to try them all for you. 110subsystem to try them all for you.
@@ -105,8 +112,9 @@ subsystem to try them all for you.
105For the "brand-name" products listed above, here are the protocol 112For the "brand-name" products listed above, here are the protocol
106and high-level drivers that you would use: 113and high-level drivers that you would use:
107 114
115 ================ ============ ====== ========
108 Manufacturer Model Driver Protocol 116 Manufacturer Model Driver Protocol
109 117 ================ ============ ====== ========
110 MicroSolutions CD-ROM pcd bpck 118 MicroSolutions CD-ROM pcd bpck
111 MicroSolutions PD drive pf bpck 119 MicroSolutions PD drive pf bpck
112 MicroSolutions hard-drive pd bpck 120 MicroSolutions hard-drive pd bpck
@@ -119,8 +127,10 @@ and high-level drivers that you would use:
119 Hewlett-Packard 5GB Tape pt epat 127 Hewlett-Packard 5GB Tape pt epat
120 Hewlett-Packard 7200e (CD) pcd epat 128 Hewlett-Packard 7200e (CD) pcd epat
121 Hewlett-Packard 7200e (CD-R) pg epat 129 Hewlett-Packard 7200e (CD-R) pg epat
130 ================ ============ ====== ========
122 131
1232.1 Configuring built-in drivers 1322.1 Configuring built-in drivers
133---------------------------------
124 134
125We recommend that you get to know how the drivers work and how to 135We recommend that you get to know how the drivers work and how to
126configure them as loadable modules, before attempting to compile a 136configure them as loadable modules, before attempting to compile a
@@ -143,7 +153,7 @@ protocol identification number and, for some devices, the drive's
143chain ID. While your system is booting, a number of messages are 153chain ID. While your system is booting, a number of messages are
144displayed on the console. Like all such messages, they can be 154displayed on the console. Like all such messages, they can be
145reviewed with the 'dmesg' command. Among those messages will be 155reviewed with the 'dmesg' command. Among those messages will be
146some lines like: 156some lines like::
147 157
148 paride: bpck registered as protocol 0 158 paride: bpck registered as protocol 0
149 paride: epat registered as protocol 1 159 paride: epat registered as protocol 1
@@ -158,10 +168,10 @@ the last two digits of the drive's serial number (but read MicroSolutions'
158documentation about this). 168documentation about this).
159 169
160As an example, let's assume that you have a MicroSolutions PD/CD drive 170As an example, let's assume that you have a MicroSolutions PD/CD drive
161with unit ID number 36 connected to the parallel port at 0x378, a SyQuest 171with unit ID number 36 connected to the parallel port at 0x378, a SyQuest
162EZ-135 connected to the chained port on the PD/CD drive and also an 172EZ-135 connected to the chained port on the PD/CD drive and also an
163Imation Superdisk connected to port 0x278. You could give the following 173Imation Superdisk connected to port 0x278. You could give the following
164options on your boot command: 174options on your boot command::
165 175
166 pd.drive0=0x378,1 pf.drive0=0x278,1 pf.drive1=0x378,0,36 176 pd.drive0=0x378,1 pf.drive0=0x278,1 pf.drive1=0x378,0,36
167 177
@@ -169,24 +179,27 @@ In the last option, pf.drive1 configures device /dev/pf1, the 0x378
169is the parallel port base address, the 0 is the protocol registration 179is the parallel port base address, the 0 is the protocol registration
170number and 36 is the chain ID. 180number and 36 is the chain ID.
171 181
172Please note: while PARIDE will work both with and without the 182Please note: while PARIDE will work both with and without the
173PARPORT parallel port sharing system that is included by the 183PARPORT parallel port sharing system that is included by the
174"Parallel port support" option, PARPORT must be included and enabled 184"Parallel port support" option, PARPORT must be included and enabled
175if you want to use chains of devices on the same parallel port. 185if you want to use chains of devices on the same parallel port.
176 186
1772.2 Loading and configuring PARIDE as modules 1872.2 Loading and configuring PARIDE as modules
188----------------------------------------------
178 189
179It is much faster and simpler to get to understand the PARIDE drivers 190It is much faster and simpler to get to understand the PARIDE drivers
180if you use them as loadable kernel modules. 191if you use them as loadable kernel modules.
181 192
182Note 1: using these drivers with the "kerneld" automatic module loading 193Note 1:
183system is not recommended for beginners, and is not documented here. 194 using these drivers with the "kerneld" automatic module loading
195 system is not recommended for beginners, and is not documented here.
184 196
185Note 2: if you build PARPORT support as a loadable module, PARIDE must 197Note 2:
186also be built as loadable modules, and PARPORT must be loaded before the 198 if you build PARPORT support as a loadable module, PARIDE must
187PARIDE modules. 199 also be built as loadable modules, and PARPORT must be loaded before
200 the PARIDE modules.
188 201
189To use PARIDE, you must begin by 202To use PARIDE, you must begin by::
190 203
191 insmod paride 204 insmod paride
192 205
@@ -195,8 +208,8 @@ among other tasks.
195 208
196Then, load as many of the protocol modules as you think you might need. 209Then, load as many of the protocol modules as you think you might need.
197As you load each module, it will register the protocols that it supports, 210As you load each module, it will register the protocols that it supports,
198and print a log message to your kernel log file and your console. For 211and print a log message to your kernel log file and your console. For
199example: 212example::
200 213
201 # insmod epat 214 # insmod epat
202 paride: epat registered as protocol 0 215 paride: epat registered as protocol 0
@@ -205,22 +218,22 @@ example:
205 paride: k971 registered as protocol 2 218 paride: k971 registered as protocol 2
206 219
207Finally, you can load high-level drivers for each kind of device that 220Finally, you can load high-level drivers for each kind of device that
208you have connected. By default, each driver will autoprobe for a single 221you have connected. By default, each driver will autoprobe for a single
209device, but you can support up to four similar devices by giving their 222device, but you can support up to four similar devices by giving their
210individual co-ordinates when you load the driver. 223individual co-ordinates when you load the driver.
211 224
212For example, if you had two no-name CD-ROM drives both using the 225For example, if you had two no-name CD-ROM drives both using the
213KingByte KBIC-951A adapter, one on port 0x378 and the other on 0x3bc 226KingByte KBIC-951A adapter, one on port 0x378 and the other on 0x3bc
214you could give the following command: 227you could give the following command::
215 228
216 # insmod pcd drive0=0x378,1 drive1=0x3bc,1 229 # insmod pcd drive0=0x378,1 drive1=0x3bc,1
217 230
218For most adapters, giving a port address and protocol number is sufficient, 231For most adapters, giving a port address and protocol number is sufficient,
219but check the source files in linux/drivers/block/paride for more 232but check the source files in linux/drivers/block/paride for more
220information. (Hopefully someone will write some man pages one day !). 233information. (Hopefully someone will write some man pages one day !).
221 234
222As another example, here's what happens when PARPORT is installed, and 235As another example, here's what happens when PARPORT is installed, and
223a SyQuest EZ-135 is attached to port 0x378: 236a SyQuest EZ-135 is attached to port 0x378::
224 237
225 # insmod paride 238 # insmod paride
226 paride: version 1.0 installed 239 paride: version 1.0 installed
@@ -237,46 +250,47 @@ Note that the last line is the output from the generic partition table
237scanner - in this case it reports that it has found a disk with one partition. 250scanner - in this case it reports that it has found a disk with one partition.
238 251
2392.3 Using a PARIDE device 2522.3 Using a PARIDE device
253--------------------------
240 254
241Once the drivers have been loaded, you can access PARIDE devices in the 255Once the drivers have been loaded, you can access PARIDE devices in the
242same way as their traditional counterparts. You will probably need to 256same way as their traditional counterparts. You will probably need to
243create the device "special files". Here is a simple script that you can 257create the device "special files". Here is a simple script that you can
244cut to a file and execute: 258cut to a file and execute::
245 259
246#!/bin/bash 260 #!/bin/bash
247# 261 #
248# mkd -- a script to create the device special files for the PARIDE subsystem 262 # mkd -- a script to create the device special files for the PARIDE subsystem
249# 263 #
250function mkdev { 264 function mkdev {
251 mknod $1 $2 $3 $4 ; chmod 0660 $1 ; chown root:disk $1 265 mknod $1 $2 $3 $4 ; chmod 0660 $1 ; chown root:disk $1
252} 266 }
253# 267 #
254function pd { 268 function pd {
255 D=$( printf \\$( printf "x%03x" $[ $1 + 97 ] ) ) 269 D=$( printf \\$( printf "x%03x" $[ $1 + 97 ] ) )
256 mkdev pd$D b 45 $[ $1 * 16 ] 270 mkdev pd$D b 45 $[ $1 * 16 ]
257 for P in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 271 for P in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
258 do mkdev pd$D$P b 45 $[ $1 * 16 + $P ] 272 do mkdev pd$D$P b 45 $[ $1 * 16 + $P ]
259 done 273 done
260} 274 }
261# 275 #
262cd /dev 276 cd /dev
263# 277 #
264for u in 0 1 2 3 ; do pd $u ; done 278 for u in 0 1 2 3 ; do pd $u ; done
265for u in 0 1 2 3 ; do mkdev pcd$u b 46 $u ; done 279 for u in 0 1 2 3 ; do mkdev pcd$u b 46 $u ; done
266for u in 0 1 2 3 ; do mkdev pf$u b 47 $u ; done 280 for u in 0 1 2 3 ; do mkdev pf$u b 47 $u ; done
267for u in 0 1 2 3 ; do mkdev pt$u c 96 $u ; done 281 for u in 0 1 2 3 ; do mkdev pt$u c 96 $u ; done
268for u in 0 1 2 3 ; do mkdev npt$u c 96 $[ $u + 128 ] ; done 282 for u in 0 1 2 3 ; do mkdev npt$u c 96 $[ $u + 128 ] ; done
269for u in 0 1 2 3 ; do mkdev pg$u c 97 $u ; done 283 for u in 0 1 2 3 ; do mkdev pg$u c 97 $u ; done
270# 284 #
271# end of mkd 285 # end of mkd
272 286
273With the device files and drivers in place, you can access PARIDE devices 287With the device files and drivers in place, you can access PARIDE devices
274like any other Linux device. For example, to mount a CD-ROM in pcd0, use: 288like any other Linux device. For example, to mount a CD-ROM in pcd0, use::
275 289
276 mount /dev/pcd0 /cdrom 290 mount /dev/pcd0 /cdrom
277 291
278If you have a fresh Avatar Shark cartridge, and the drive is pda, you 292If you have a fresh Avatar Shark cartridge, and the drive is pda, you
279might do something like: 293might do something like::
280 294
281 fdisk /dev/pda -- make a new partition table with 295 fdisk /dev/pda -- make a new partition table with
282 partition 1 of type 83 296 partition 1 of type 83
@@ -289,41 +303,46 @@ might do something like:
289 303
290Devices like the Imation superdisk work in the same way, except that 304Devices like the Imation superdisk work in the same way, except that
291they do not have a partition table. For example to make a 120MB 305they do not have a partition table. For example to make a 120MB
292floppy that you could share with a DOS system: 306floppy that you could share with a DOS system::
293 307
294 mkdosfs /dev/pf0 308 mkdosfs /dev/pf0
295 mount /dev/pf0 /mnt 309 mount /dev/pf0 /mnt
296 310
297 311
2982.4 The pf driver 3122.4 The pf driver
313------------------
299 314
300The pf driver is intended for use with parallel port ATAPI disk 315The pf driver is intended for use with parallel port ATAPI disk
301devices. The most common devices in this category are PD drives 316devices. The most common devices in this category are PD drives
302and LS-120 drives. Traditionally, media for these devices are not 317and LS-120 drives. Traditionally, media for these devices are not
303partitioned. Consequently, the pf driver does not support partitioned 318partitioned. Consequently, the pf driver does not support partitioned
304media. This may be changed in a future version of the driver. 319media. This may be changed in a future version of the driver.
305 320
3062.5 Using the pt driver 3212.5 Using the pt driver
322------------------------
307 323
308The pt driver for parallel port ATAPI tape drives is a minimal driver. 324The pt driver for parallel port ATAPI tape drives is a minimal driver.
309It does not yet support many of the standard tape ioctl operations. 325It does not yet support many of the standard tape ioctl operations.
310For best performance, a block size of 32KB should be used. You will 326For best performance, a block size of 32KB should be used. You will
311probably want to set the parallel port delay to 0, if you can. 327probably want to set the parallel port delay to 0, if you can.
312 328
3132.6 Using the pg driver 3292.6 Using the pg driver
330------------------------
314 331
315The pg driver can be used in conjunction with the cdrecord program 332The pg driver can be used in conjunction with the cdrecord program
316to create CD-ROMs. Please get cdrecord version 1.6.1 or later 333to create CD-ROMs. Please get cdrecord version 1.6.1 or later
317from ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ . To record CD-R media 334from ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ . To record CD-R media
318your parallel port should ideally be set to EPP mode, and the "port delay" 335your parallel port should ideally be set to EPP mode, and the "port delay"
319should be set to 0. With those settings it is possible to record at 2x 336should be set to 0. With those settings it is possible to record at 2x
320speed without any buffer underruns. If you cannot get the driver to work 337speed without any buffer underruns. If you cannot get the driver to work
321in EPP mode, try to use "bidirectional" or "PS/2" mode and 1x speeds only. 338in EPP mode, try to use "bidirectional" or "PS/2" mode and 1x speeds only.
322 339
323 340
3243. Troubleshooting 3413. Troubleshooting
342==================
325 343
3263.1 Use EPP mode if you can 3443.1 Use EPP mode if you can
345----------------------------
327 346
328The most common problems that people report with the PARIDE drivers 347The most common problems that people report with the PARIDE drivers
329concern the parallel port CMOS settings. At this time, none of the 348concern the parallel port CMOS settings. At this time, none of the
@@ -332,6 +351,7 @@ If you are able to do so, please set your parallel port into EPP mode
332using your CMOS setup procedure. 351using your CMOS setup procedure.
333 352
3343.2 Check the port delay 3533.2 Check the port delay
354-------------------------
335 355
336Some parallel ports cannot reliably transfer data at full speed. To 356Some parallel ports cannot reliably transfer data at full speed. To
337offset the errors, the PARIDE protocol modules introduce a "port 357offset the errors, the PARIDE protocol modules introduce a "port
@@ -347,23 +367,25 @@ read the comments at the beginning of the driver source files in
347linux/drivers/block/paride. 367linux/drivers/block/paride.
348 368
3493.3 Some drives need a printer reset 3693.3 Some drives need a printer reset
370-------------------------------------
350 371
351There appear to be a number of "noname" external drives on the market 372There appear to be a number of "noname" external drives on the market
352that do not always power up correctly. We have noticed this with some 373that do not always power up correctly. We have noticed this with some
353drives based on OnSpec and older Freecom adapters. In these rare cases, 374drives based on OnSpec and older Freecom adapters. In these rare cases,
354the adapter can often be reinitialised by issuing a "printer reset" on 375the adapter can often be reinitialised by issuing a "printer reset" on
355the parallel port. As the reset operation is potentially disruptive in 376the parallel port. As the reset operation is potentially disruptive in
356multiple device environments, the PARIDE drivers will not do it 377multiple device environments, the PARIDE drivers will not do it
357automatically. You can however, force a printer reset by doing: 378automatically. You can however, force a printer reset by doing::
358 379
359 insmod lp reset=1 380 insmod lp reset=1
360 rmmod lp 381 rmmod lp
361 382
362If you have one of these marginal cases, you should probably build 383If you have one of these marginal cases, you should probably build
363your paride drivers as modules, and arrange to do the printer reset 384your paride drivers as modules, and arrange to do the printer reset
364before loading the PARIDE drivers. 385before loading the PARIDE drivers.
365 386
3663.4 Use the verbose option and dmesg if you need help 3873.4 Use the verbose option and dmesg if you need help
388------------------------------------------------------
367 389
368While a lot of testing has gone into these drivers to make them work 390While a lot of testing has gone into these drivers to make them work
369as smoothly as possible, problems will arise. If you do have problems, 391as smoothly as possible, problems will arise. If you do have problems,
@@ -373,7 +395,7 @@ clues, then please make sure that only one drive is hooked to your system,
373and that either (a) PARPORT is enabled or (b) no other device driver 395and that either (a) PARPORT is enabled or (b) no other device driver
374is using your parallel port (check in /proc/ioports). Then, load the 396is using your parallel port (check in /proc/ioports). Then, load the
375appropriate drivers (you can load several protocol modules if you want) 397appropriate drivers (you can load several protocol modules if you want)
376as in: 398as in::
377 399
378 # insmod paride 400 # insmod paride
379 # insmod epat 401 # insmod epat
@@ -394,12 +416,14 @@ by e-mail to grant@torque.net, or join the linux-parport mailing list
394and post your report there. 416and post your report there.
395 417
3963.5 For more information or help 4183.5 For more information or help
419---------------------------------
397 420
398You can join the linux-parport mailing list by sending a mail message 421You can join the linux-parport mailing list by sending a mail message
399to 422to:
423
400 linux-parport-request@torque.net 424 linux-parport-request@torque.net
401 425
402with the single word 426with the single word::
403 427
404 subscribe 428 subscribe
405 429
@@ -412,6 +436,4 @@ have in your mail headers, when sending mail to the list server.
412You might also find some useful information on the linux-parport 436You might also find some useful information on the linux-parport
413web pages (although they are not always up to date) at 437web pages (although they are not always up to date) at
414 438
415 http://web.archive.org/web/*/http://www.torque.net/parport/ 439 http://web.archive.org/web/%2E/http://www.torque.net/parport/
416
417
diff --git a/Documentation/blockdev/ramdisk.txt b/Documentation/blockdev/ramdisk.rst
index 501e12e0323e..b7c2268f8dec 100644
--- a/Documentation/blockdev/ramdisk.txt
+++ b/Documentation/blockdev/ramdisk.rst
@@ -1,7 +1,8 @@
1==========================================
1Using the RAM disk block device with Linux 2Using the RAM disk block device with Linux
2------------------------------------------ 3==========================================
3 4
4Contents: 5.. Contents:
5 6
6 1) Overview 7 1) Overview
7 2) Kernel Command Line Parameters 8 2) Kernel Command Line Parameters
@@ -42,7 +43,7 @@ rescue floppy disk.
422a) Kernel Command Line Parameters 432a) Kernel Command Line Parameters
43 44
44 ramdisk_size=N 45 ramdisk_size=N
45 ============== 46 Size of the ramdisk.
46 47
47This parameter tells the RAM disk driver to set up RAM disks of N k size. The 48This parameter tells the RAM disk driver to set up RAM disks of N k size. The
48default is 4096 (4 MB). 49default is 4096 (4 MB).
@@ -50,16 +51,13 @@ default is 4096 (4 MB).
502b) Module parameters 512b) Module parameters
51 52
52 rd_nr 53 rd_nr
53 ===== 54 /dev/ramX devices created.
54 /dev/ramX devices created.
55 55
56 max_part 56 max_part
57 ======== 57 Maximum partition number.
58 Maximum partition number.
59 58
60 rd_size 59 rd_size
61 ======= 60 See ramdisk_size.
62 See ramdisk_size.
63 61
643) Using "rdev -r" 623) Using "rdev -r"
65------------------ 63------------------
@@ -71,11 +69,11 @@ to 2 MB (2^11) of where to find the RAM disk (this used to be the size). Bit
71prompt/wait sequence is to be given before trying to read the RAM disk. Since 69prompt/wait sequence is to be given before trying to read the RAM disk. Since
72the RAM disk dynamically grows as data is being written into it, a size field 70the RAM disk dynamically grows as data is being written into it, a size field
73is not required. Bits 11 to 13 are not currently used and may as well be zero. 71is not required. Bits 11 to 13 are not currently used and may as well be zero.
74These numbers are no magical secrets, as seen below: 72These numbers are no magical secrets, as seen below::
75 73
76./arch/x86/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK 0x07FF 74 ./arch/x86/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK 0x07FF
77./arch/x86/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000 75 ./arch/x86/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000
78./arch/x86/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000 76 ./arch/x86/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000
79 77
80Consider a typical two floppy disk setup, where you will have the 78Consider a typical two floppy disk setup, where you will have the
81kernel on disk one, and have already put a RAM disk image onto disk #2. 79kernel on disk one, and have already put a RAM disk image onto disk #2.
@@ -92,20 +90,23 @@ sequence so that you have a chance to switch floppy disks.
92The command line equivalent is: "prompt_ramdisk=1" 90The command line equivalent is: "prompt_ramdisk=1"
93 91
94Putting that together gives 2^15 + 2^14 + 0 = 49152 for an rdev word. 92Putting that together gives 2^15 + 2^14 + 0 = 49152 for an rdev word.
95So to create disk one of the set, you would do: 93So to create disk one of the set, you would do::
96 94
97 /usr/src/linux# cat arch/x86/boot/zImage > /dev/fd0 95 /usr/src/linux# cat arch/x86/boot/zImage > /dev/fd0
98 /usr/src/linux# rdev /dev/fd0 /dev/fd0 96 /usr/src/linux# rdev /dev/fd0 /dev/fd0
99 /usr/src/linux# rdev -r /dev/fd0 49152 97 /usr/src/linux# rdev -r /dev/fd0 49152
100 98
101If you make a boot disk that has LILO, then for the above, you would use: 99If you make a boot disk that has LILO, then for the above, you would use::
100
102 append = "ramdisk_start=0 load_ramdisk=1 prompt_ramdisk=1" 101 append = "ramdisk_start=0 load_ramdisk=1 prompt_ramdisk=1"
103Since the default start = 0 and the default prompt = 1, you could use: 102
103Since the default start = 0 and the default prompt = 1, you could use::
104
104 append = "load_ramdisk=1" 105 append = "load_ramdisk=1"
105 106
106 107
1074) An Example of Creating a Compressed RAM Disk 1084) An Example of Creating a Compressed RAM Disk
108---------------------------------------------- 109-----------------------------------------------
109 110
110To create a RAM disk image, you will need a spare block device to 111To create a RAM disk image, you will need a spare block device to
111construct it on. This can be the RAM disk device itself, or an 112construct it on. This can be the RAM disk device itself, or an
@@ -120,11 +121,11 @@ a) Decide on the RAM disk size that you want. Say 2 MB for this example.
120 Create it by writing to the RAM disk device. (This step is not currently 121 Create it by writing to the RAM disk device. (This step is not currently
121 required, but may be in the future.) It is wise to zero out the 122 required, but may be in the future.) It is wise to zero out the
122 area (esp. for disks) so that maximal compression is achieved for 123 area (esp. for disks) so that maximal compression is achieved for
123 the unused blocks of the image that you are about to create. 124 the unused blocks of the image that you are about to create::
124 125
125 dd if=/dev/zero of=/dev/ram0 bs=1k count=2048 126 dd if=/dev/zero of=/dev/ram0 bs=1k count=2048
126 127
127b) Make a filesystem on it. Say ext2fs for this example. 128b) Make a filesystem on it. Say ext2fs for this example::
128 129
129 mke2fs -vm0 /dev/ram0 2048 130 mke2fs -vm0 /dev/ram0 2048
130 131
@@ -133,11 +134,11 @@ c) Mount it, copy the files you want to it (eg: /etc/* /dev/* ...)
133 134
134d) Compress the contents of the RAM disk. The level of compression 135d) Compress the contents of the RAM disk. The level of compression
135 will be approximately 50% of the space used by the files. Unused 136 will be approximately 50% of the space used by the files. Unused
136 space on the RAM disk will compress to almost nothing. 137 space on the RAM disk will compress to almost nothing::
137 138
138 dd if=/dev/ram0 bs=1k count=2048 | gzip -v9 > /tmp/ram_image.gz 139 dd if=/dev/ram0 bs=1k count=2048 | gzip -v9 > /tmp/ram_image.gz
139 140
140e) Put the kernel onto the floppy 141e) Put the kernel onto the floppy::
141 142
142 dd if=zImage of=/dev/fd0 bs=1k 143 dd if=zImage of=/dev/fd0 bs=1k
143 144
@@ -146,13 +147,13 @@ f) Put the RAM disk image onto the floppy, after the kernel. Use an offset
146 (possibly larger) kernel onto the same floppy later without overlapping 147 (possibly larger) kernel onto the same floppy later without overlapping
147 the RAM disk image. An offset of 400 kB for kernels about 350 kB in 148 the RAM disk image. An offset of 400 kB for kernels about 350 kB in
148 size would be reasonable. Make sure offset+size of ram_image.gz is 149 size would be reasonable. Make sure offset+size of ram_image.gz is
149 not larger than the total space on your floppy (usually 1440 kB). 150 not larger than the total space on your floppy (usually 1440 kB)::
150 151
151 dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400 152 dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400
152 153
153g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc. 154g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc.
154 For prompt_ramdisk=1, load_ramdisk=1, ramdisk_start=400, one would 155 For prompt_ramdisk=1, load_ramdisk=1, ramdisk_start=400, one would
155 have 2^15 + 2^14 + 400 = 49552. 156 have 2^15 + 2^14 + 400 = 49552::
156 157
157 rdev /dev/fd0 /dev/fd0 158 rdev /dev/fd0 /dev/fd0
158 rdev -r /dev/fd0 49552 159 rdev -r /dev/fd0 49552
@@ -160,15 +161,17 @@ g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc.
160That is it. You now have your boot/root compressed RAM disk floppy. Some 161That is it. You now have your boot/root compressed RAM disk floppy. Some
161users may wish to combine steps (d) and (f) by using a pipe. 162users may wish to combine steps (d) and (f) by using a pipe.
162 163
163-------------------------------------------------------------------------- 164
164 Paul Gortmaker 12/95 165 Paul Gortmaker 12/95
165 166
166Changelog: 167Changelog:
167---------- 168----------
168 169
16910-22-04 : Updated to reflect changes in command line options, remove 17010-22-04 :
171 Updated to reflect changes in command line options, remove
170 obsolete references, general cleanup. 172 obsolete references, general cleanup.
171 James Nelson (james4765@gmail.com) 173 James Nelson (james4765@gmail.com)
172 174
173 175
17412-95 : Original Document 17612-95 :
177 Original Document
diff --git a/Documentation/blockdev/zram.txt b/Documentation/blockdev/zram.rst
index 4df0ce271085..2111231c9c0f 100644
--- a/Documentation/blockdev/zram.txt
+++ b/Documentation/blockdev/zram.rst
@@ -1,7 +1,9 @@
1========================================
1zram: Compressed RAM based block devices 2zram: Compressed RAM based block devices
2---------------------------------------- 3========================================
3 4
4* Introduction 5Introduction
6============
5 7
6The zram module creates RAM based block devices named /dev/zram<id> 8The zram module creates RAM based block devices named /dev/zram<id>
7(<id> = 0, 1, ...). Pages written to these disks are compressed and stored 9(<id> = 0, 1, ...). Pages written to these disks are compressed and stored
@@ -12,9 +14,11 @@ use as swap disks, various caches under /var and maybe many more :)
12Statistics for individual zram devices are exported through sysfs nodes at 14Statistics for individual zram devices are exported through sysfs nodes at
13/sys/block/zram<id>/ 15/sys/block/zram<id>/
14 16
15* Usage 17Usage
18=====
16 19
17There are several ways to configure and manage zram device(-s): 20There are several ways to configure and manage zram device(-s):
21
18a) using zram and zram_control sysfs attributes 22a) using zram and zram_control sysfs attributes
19b) using zramctl utility, provided by util-linux (util-linux@vger.kernel.org). 23b) using zramctl utility, provided by util-linux (util-linux@vger.kernel.org).
20 24
@@ -22,7 +26,7 @@ In this document we will describe only 'manual' zram configuration steps,
22IOW, zram and zram_control sysfs attributes. 26IOW, zram and zram_control sysfs attributes.
23 27
24In order to get a better idea about zramctl please consult util-linux 28In order to get a better idea about zramctl please consult util-linux
25documentation, zramctl man-page or `zramctl --help'. Please be informed 29documentation, zramctl man-page or `zramctl --help`. Please be informed
26that zram maintainers do not develop/maintain util-linux or zramctl, should 30that zram maintainers do not develop/maintain util-linux or zramctl, should
27you have any questions please contact util-linux@vger.kernel.org 31you have any questions please contact util-linux@vger.kernel.org
28 32
@@ -30,19 +34,23 @@ Following shows a typical sequence of steps for using zram.
30 34
31WARNING 35WARNING
32======= 36=======
37
33For the sake of simplicity we skip error checking parts in most of the 38For the sake of simplicity we skip error checking parts in most of the
34examples below. However, it is your sole responsibility to handle errors. 39examples below. However, it is your sole responsibility to handle errors.
35 40
36zram sysfs attributes always return negative values in case of errors. 41zram sysfs attributes always return negative values in case of errors.
37The list of possible return codes: 42The list of possible return codes:
38-EBUSY -- an attempt to modify an attribute that cannot be changed once 43
39the device has been initialised. Please reset device first; 44======== =============================================================
40-ENOMEM -- zram was not able to allocate enough memory to fulfil your 45-EBUSY an attempt to modify an attribute that cannot be changed once
41needs; 46 the device has been initialised. Please reset device first;
42-EINVAL -- invalid input has been provided. 47-ENOMEM zram was not able to allocate enough memory to fulfil your
48 needs;
49-EINVAL invalid input has been provided.
50======== =============================================================
43 51
44If you use 'echo', the returned value that is changed by 'echo' utility, 52If you use 'echo', the returned value that is changed by 'echo' utility,
45and, in general case, something like: 53and, in general case, something like::
46 54
47 echo 3 > /sys/block/zram0/max_comp_streams 55 echo 3 > /sys/block/zram0/max_comp_streams
48 if [ $? -ne 0 ]; 56 if [ $? -ne 0 ];
@@ -51,7 +59,11 @@ and, in general case, something like:
51 59
52should suffice. 60should suffice.
53 61
541) Load Module: 621) Load Module
63==============
64
65::
66
55 modprobe zram num_devices=4 67 modprobe zram num_devices=4
56 This creates 4 devices: /dev/zram{0,1,2,3} 68 This creates 4 devices: /dev/zram{0,1,2,3}
57 69
@@ -59,6 +71,8 @@ num_devices parameter is optional and tells zram how many devices should be
59pre-created. Default: 1. 71pre-created. Default: 1.
60 72
612) Set max number of compression streams 732) Set max number of compression streams
74========================================
75
62Regardless the value passed to this attribute, ZRAM will always 76Regardless the value passed to this attribute, ZRAM will always
63allocate multiple compression streams - one per online CPUs - thus 77allocate multiple compression streams - one per online CPUs - thus
64allowing several concurrent compression operations. The number of 78allowing several concurrent compression operations. The number of
@@ -66,16 +80,20 @@ allocated compression streams goes down when some of the CPUs
66become offline. There is no single-compression-stream mode anymore, 80become offline. There is no single-compression-stream mode anymore,
67unless you are running a UP system or has only 1 CPU online. 81unless you are running a UP system or has only 1 CPU online.
68 82
69To find out how many streams are currently available: 83To find out how many streams are currently available::
84
70 cat /sys/block/zram0/max_comp_streams 85 cat /sys/block/zram0/max_comp_streams
71 86
723) Select compression algorithm 873) Select compression algorithm
88===============================
89
73Using comp_algorithm device attribute one can see available and 90Using comp_algorithm device attribute one can see available and
74currently selected (shown in square brackets) compression algorithms, 91currently selected (shown in square brackets) compression algorithms,
75change selected compression algorithm (once the device is initialised 92change selected compression algorithm (once the device is initialised
76there is no way to change compression algorithm). 93there is no way to change compression algorithm).
77 94
78Examples: 95Examples::
96
79 #show supported compression algorithms 97 #show supported compression algorithms
80 cat /sys/block/zram0/comp_algorithm 98 cat /sys/block/zram0/comp_algorithm
81 lzo [lz4] 99 lzo [lz4]
@@ -83,20 +101,23 @@ Examples:
83 #select lzo compression algorithm 101 #select lzo compression algorithm
84 echo lzo > /sys/block/zram0/comp_algorithm 102 echo lzo > /sys/block/zram0/comp_algorithm
85 103
86For the time being, the `comp_algorithm' content does not necessarily 104For the time being, the `comp_algorithm` content does not necessarily
87show every compression algorithm supported by the kernel. We keep this 105show every compression algorithm supported by the kernel. We keep this
88list primarily to simplify device configuration and one can configure 106list primarily to simplify device configuration and one can configure
89a new device with a compression algorithm that is not listed in 107a new device with a compression algorithm that is not listed in
90`comp_algorithm'. The thing is that, internally, ZRAM uses Crypto API 108`comp_algorithm`. The thing is that, internally, ZRAM uses Crypto API
91and, if some of the algorithms were built as modules, it's impossible 109and, if some of the algorithms were built as modules, it's impossible
92to list all of them using, for instance, /proc/crypto or any other 110to list all of them using, for instance, /proc/crypto or any other
93method. This, however, has an advantage of permitting the usage of 111method. This, however, has an advantage of permitting the usage of
94custom crypto compression modules (implementing S/W or H/W compression). 112custom crypto compression modules (implementing S/W or H/W compression).
95 113
964) Set Disksize 1144) Set Disksize
115===============
116
97Set disk size by writing the value to sysfs node 'disksize'. 117Set disk size by writing the value to sysfs node 'disksize'.
98The value can be either in bytes or you can use mem suffixes. 118The value can be either in bytes or you can use mem suffixes.
99Examples: 119Examples::
120
100 # Initialize /dev/zram0 with 50MB disksize 121 # Initialize /dev/zram0 with 50MB disksize
101 echo $((50*1024*1024)) > /sys/block/zram0/disksize 122 echo $((50*1024*1024)) > /sys/block/zram0/disksize
102 123
@@ -111,10 +132,13 @@ since we expect a 2:1 compression ratio. Note that zram uses about 0.1% of the
111size of the disk when not in use so a huge zram is wasteful. 132size of the disk when not in use so a huge zram is wasteful.
112 133
1135) Set memory limit: Optional 1345) Set memory limit: Optional
135=============================
136
114Set memory limit by writing the value to sysfs node 'mem_limit'. 137Set memory limit by writing the value to sysfs node 'mem_limit'.
115The value can be either in bytes or you can use mem suffixes. 138The value can be either in bytes or you can use mem suffixes.
116In addition, you could change the value in runtime. 139In addition, you could change the value in runtime.
117Examples: 140Examples::
141
118 # limit /dev/zram0 with 50MB memory 142 # limit /dev/zram0 with 50MB memory
119 echo $((50*1024*1024)) > /sys/block/zram0/mem_limit 143 echo $((50*1024*1024)) > /sys/block/zram0/mem_limit
120 144
@@ -126,7 +150,11 @@ Examples:
126 # To disable memory limit 150 # To disable memory limit
127 echo 0 > /sys/block/zram0/mem_limit 151 echo 0 > /sys/block/zram0/mem_limit
128 152
1296) Activate: 1536) Activate
154===========
155
156::
157
130 mkswap /dev/zram0 158 mkswap /dev/zram0
131 swapon /dev/zram0 159 swapon /dev/zram0
132 160
@@ -134,6 +162,7 @@ Examples:
134 mount /dev/zram1 /tmp 162 mount /dev/zram1 /tmp
135 163
1367) Add/remove zram devices 1647) Add/remove zram devices
165==========================
137 166
138zram provides a control interface, which enables dynamic (on-demand) device 167zram provides a control interface, which enables dynamic (on-demand) device
139addition and removal. 168addition and removal.
@@ -142,37 +171,44 @@ In order to add a new /dev/zramX device, perform read operation on hot_add
142attribute. This will return either new device's device id (meaning that you 171attribute. This will return either new device's device id (meaning that you
143can use /dev/zram<id>) or error code. 172can use /dev/zram<id>) or error code.
144 173
145Example: 174Example::
175
146 cat /sys/class/zram-control/hot_add 176 cat /sys/class/zram-control/hot_add
147 1 177 1
148 178
149To remove the existing /dev/zramX device (where X is a device id) 179To remove the existing /dev/zramX device (where X is a device id)
150execute 180execute::
181
151 echo X > /sys/class/zram-control/hot_remove 182 echo X > /sys/class/zram-control/hot_remove
152 183
1538) Stats: 1848) Stats
185========
186
154Per-device statistics are exported as various nodes under /sys/block/zram<id>/ 187Per-device statistics are exported as various nodes under /sys/block/zram<id>/
155 188
156A brief description of exported device attributes. For more details please 189A brief description of exported device attributes. For more details please
157read Documentation/ABI/testing/sysfs-block-zram. 190read Documentation/ABI/testing/sysfs-block-zram.
158 191
192====================== ====== ===============================================
159Name access description 193Name access description
160---- ------ ----------- 194====================== ====== ===============================================
161disksize RW show and set the device's disk size 195disksize RW show and set the device's disk size
162initstate RO shows the initialization state of the device 196initstate RO shows the initialization state of the device
163reset WO trigger device reset 197reset WO trigger device reset
164mem_used_max WO reset the `mem_used_max' counter (see later) 198mem_used_max WO reset the `mem_used_max` counter (see later)
165mem_limit WO specifies the maximum amount of memory ZRAM can use 199mem_limit WO specifies the maximum amount of memory ZRAM can
166 to store the compressed data 200 use to store the compressed data
167writeback_limit WO specifies the maximum amount of write IO zram can 201writeback_limit WO specifies the maximum amount of write IO zram
168 write out to backing device as 4KB unit 202 can write out to backing device as 4KB unit
169writeback_limit_enable RW show and set writeback_limit feature 203writeback_limit_enable RW show and set writeback_limit feature
170max_comp_streams RW the number of possible concurrent compress operations 204max_comp_streams RW the number of possible concurrent compress
205 operations
171comp_algorithm RW show and change the compression algorithm 206comp_algorithm RW show and change the compression algorithm
172compact WO trigger memory compaction 207compact WO trigger memory compaction
173debug_stat RO this file is used for zram debugging purposes 208debug_stat RO this file is used for zram debugging purposes
174backing_dev RW set up backend storage for zram to write out 209backing_dev RW set up backend storage for zram to write out
175idle WO mark allocated slot as idle 210idle WO mark allocated slot as idle
211====================== ====== ===============================================
176 212
177 213
178User space is advised to use the following files to read the device statistics. 214User space is advised to use the following files to read the device statistics.
@@ -188,23 +224,31 @@ The stat file represents device's I/O statistics not accounted by block
188layer and, thus, not available in zram<id>/stat file. It consists of a 224layer and, thus, not available in zram<id>/stat file. It consists of a
189single line of text and contains the following stats separated by 225single line of text and contains the following stats separated by
190whitespace: 226whitespace:
191 failed_reads the number of failed reads 227
192 failed_writes the number of failed writes 228 ============= =============================================================
193 invalid_io the number of non-page-size-aligned I/O requests 229 failed_reads The number of failed reads
230 failed_writes The number of failed writes
231 invalid_io The number of non-page-size-aligned I/O requests
194 notify_free Depending on device usage scenario it may account 232 notify_free Depending on device usage scenario it may account
233
195 a) the number of pages freed because of swap slot free 234 a) the number of pages freed because of swap slot free
196 notifications or b) the number of pages freed because of 235 notifications
197 REQ_OP_DISCARD requests sent by bio. The former ones are 236 b) the number of pages freed because of
198 sent to a swap block device when a swap slot is freed, 237 REQ_OP_DISCARD requests sent by bio. The former ones are
199 which implies that this disk is being used as a swap disk. 238 sent to a swap block device when a swap slot is freed,
239 which implies that this disk is being used as a swap disk.
240
200 The latter ones are sent by filesystem mounted with 241 The latter ones are sent by filesystem mounted with
201 discard option, whenever some data blocks are getting 242 discard option, whenever some data blocks are getting
202 discarded. 243 discarded.
244 ============= =============================================================
203 245
204File /sys/block/zram<id>/mm_stat 246File /sys/block/zram<id>/mm_stat
205 247
206The stat file represents device's mm statistics. It consists of a single 248The stat file represents device's mm statistics. It consists of a single
207line of text and contains the following stats separated by whitespace: 249line of text and contains the following stats separated by whitespace:
250
251 ================ =============================================================
208 orig_data_size uncompressed size of data stored in this disk. 252 orig_data_size uncompressed size of data stored in this disk.
209 This excludes same-element-filled pages (same_pages) since 253 This excludes same-element-filled pages (same_pages) since
210 no memory is allocated for them. 254 no memory is allocated for them.
@@ -223,58 +267,71 @@ line of text and contains the following stats separated by whitespace:
223 No memory is allocated for such pages. 267 No memory is allocated for such pages.
224 pages_compacted the number of pages freed during compaction 268 pages_compacted the number of pages freed during compaction
225 huge_pages the number of incompressible pages 269 huge_pages the number of incompressible pages
270 ================ =============================================================
226 271
227File /sys/block/zram<id>/bd_stat 272File /sys/block/zram<id>/bd_stat
228 273
229The stat file represents device's backing device statistics. It consists of 274The stat file represents device's backing device statistics. It consists of
230a single line of text and contains the following stats separated by whitespace: 275a single line of text and contains the following stats separated by whitespace:
276
277 ============== =============================================================
231 bd_count size of data written in backing device. 278 bd_count size of data written in backing device.
232 Unit: 4K bytes 279 Unit: 4K bytes
233 bd_reads the number of reads from backing device 280 bd_reads the number of reads from backing device
234 Unit: 4K bytes 281 Unit: 4K bytes
235 bd_writes the number of writes to backing device 282 bd_writes the number of writes to backing device
236 Unit: 4K bytes 283 Unit: 4K bytes
284 ============== =============================================================
285
2869) Deactivate
287=============
288
289::
237 290
2389) Deactivate:
239 swapoff /dev/zram0 291 swapoff /dev/zram0
240 umount /dev/zram1 292 umount /dev/zram1
241 293
24210) Reset: 29410) Reset
243 Write any positive value to 'reset' sysfs node 295=========
244 echo 1 > /sys/block/zram0/reset 296
245 echo 1 > /sys/block/zram1/reset 297 Write any positive value to 'reset' sysfs node::
298
299 echo 1 > /sys/block/zram0/reset
300 echo 1 > /sys/block/zram1/reset
246 301
247 This frees all the memory allocated for the given device and 302 This frees all the memory allocated for the given device and
248 resets the disksize to zero. You must set the disksize again 303 resets the disksize to zero. You must set the disksize again
249 before reusing the device. 304 before reusing the device.
250 305
251* Optional Feature 306Optional Feature
307================
252 308
253= writeback 309writeback
310---------
254 311
255With CONFIG_ZRAM_WRITEBACK, zram can write idle/incompressible page 312With CONFIG_ZRAM_WRITEBACK, zram can write idle/incompressible page
256to backing storage rather than keeping it in memory. 313to backing storage rather than keeping it in memory.
257To use the feature, admin should set up backing device via 314To use the feature, admin should set up backing device via::
258 315
259 "echo /dev/sda5 > /sys/block/zramX/backing_dev" 316 echo /dev/sda5 > /sys/block/zramX/backing_dev
260 317
261before disksize setting. It supports only partition at this moment. 318before disksize setting. It supports only partition at this moment.
262If admin want to use incompressible page writeback, they could do via 319If admin want to use incompressible page writeback, they could do via::
263 320
264 "echo huge > /sys/block/zramX/write" 321 echo huge > /sys/block/zramX/write
265 322
266To use idle page writeback, first, user need to declare zram pages 323To use idle page writeback, first, user need to declare zram pages
267as idle. 324as idle::
268 325
269 "echo all > /sys/block/zramX/idle" 326 echo all > /sys/block/zramX/idle
270 327
271From now on, any pages on zram are idle pages. The idle mark 328From now on, any pages on zram are idle pages. The idle mark
272will be removed until someone request access of the block. 329will be removed until someone request access of the block.
273IOW, unless there is access request, those pages are still idle pages. 330IOW, unless there is access request, those pages are still idle pages.
274 331
275Admin can request writeback of those idle pages at right timing via 332Admin can request writeback of those idle pages at right timing via::
276 333
277 "echo idle > /sys/block/zramX/writeback" 334 echo idle > /sys/block/zramX/writeback
278 335
279With the command, zram writeback idle pages from memory to the storage. 336With the command, zram writeback idle pages from memory to the storage.
280 337
@@ -285,7 +342,7 @@ to guarantee storage health for entire product life.
285To overcome the concern, zram supports "writeback_limit" feature. 342To overcome the concern, zram supports "writeback_limit" feature.
286The "writeback_limit_enable"'s default value is 0 so that it doesn't limit 343The "writeback_limit_enable"'s default value is 0 so that it doesn't limit
287any writeback. IOW, if admin want to apply writeback budget, he should 344any writeback. IOW, if admin want to apply writeback budget, he should
288enable writeback_limit_enable via 345enable writeback_limit_enable via::
289 346
290 $ echo 1 > /sys/block/zramX/writeback_limit_enable 347 $ echo 1 > /sys/block/zramX/writeback_limit_enable
291 348
@@ -296,7 +353,7 @@ until admin set the budget via /sys/block/zramX/writeback_limit.
296assigned via /sys/block/zramX/writeback_limit is meaninless.) 353assigned via /sys/block/zramX/writeback_limit is meaninless.)
297 354
298If admin want to limit writeback as per-day 400M, he could do it 355If admin want to limit writeback as per-day 400M, he could do it
299like below. 356like below::
300 357
301 $ MB_SHIFT=20 358 $ MB_SHIFT=20
302 $ 4K_SHIFT=12 359 $ 4K_SHIFT=12
@@ -305,16 +362,16 @@ like below.
305 $ echo 1 > /sys/block/zram0/writeback_limit_enable 362 $ echo 1 > /sys/block/zram0/writeback_limit_enable
306 363
307If admin want to allow further write again once the bugdet is exausted, 364If admin want to allow further write again once the bugdet is exausted,
308he could do it like below 365he could do it like below::
309 366
310 $ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \ 367 $ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
311 /sys/block/zram0/writeback_limit 368 /sys/block/zram0/writeback_limit
312 369
313If admin want to see remaining writeback budget since he set, 370If admin want to see remaining writeback budget since he set::
314 371
315 $ cat /sys/block/zramX/writeback_limit 372 $ cat /sys/block/zramX/writeback_limit
316 373
317If admin want to disable writeback limit, he could do 374If admin want to disable writeback limit, he could do::
318 375
319 $ echo 0 > /sys/block/zramX/writeback_limit_enable 376 $ echo 0 > /sys/block/zramX/writeback_limit_enable
320 377
@@ -326,25 +383,35 @@ budget in next setting is user's job.
326If admin want to measure writeback count in a certain period, he could 383If admin want to measure writeback count in a certain period, he could
327know it via /sys/block/zram0/bd_stat's 3rd column. 384know it via /sys/block/zram0/bd_stat's 3rd column.
328 385
329= memory tracking 386memory tracking
387===============
330 388
331With CONFIG_ZRAM_MEMORY_TRACKING, user can know information of the 389With CONFIG_ZRAM_MEMORY_TRACKING, user can know information of the
332zram block. It could be useful to catch cold or incompressible 390zram block. It could be useful to catch cold or incompressible
333pages of the process with*pagemap. 391pages of the process with*pagemap.
392
334If you enable the feature, you could see block state via 393If you enable the feature, you could see block state via
335/sys/kernel/debug/zram/zram0/block_state". The output is as follows, 394/sys/kernel/debug/zram/zram0/block_state". The output is as follows::
336 395
337 300 75.033841 .wh. 396 300 75.033841 .wh.
338 301 63.806904 s... 397 301 63.806904 s...
339 302 63.806919 ..hi 398 302 63.806919 ..hi
340 399
341First column is zram's block index. 400First column
342Second column is access time since the system was booted 401 zram's block index.
343Third column is state of the block. 402Second column
344(s: same page 403 access time since the system was booted
345w: written page to backing store 404Third column
346h: huge page 405 state of the block:
347i: idle page) 406
407 s:
408 same page
409 w:
410 written page to backing store
411 h:
412 huge page
413 i:
414 idle page
348 415
349First line of above example says 300th block is accessed at 75.033841sec 416First line of above example says 300th block is accessed at 75.033841sec
350and the block's state is huge so it is written back to the backing 417and the block's state is huge so it is written back to the backing
diff --git a/MAINTAINERS b/MAINTAINERS
index 3ee73751f56c..ec541c8dc645 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11076,7 +11076,7 @@ M: Josef Bacik <josef@toxicpanda.com>
11076S: Maintained 11076S: Maintained
11077L: linux-block@vger.kernel.org 11077L: linux-block@vger.kernel.org
11078L: nbd@other.debian.org 11078L: nbd@other.debian.org
11079F: Documentation/blockdev/nbd.txt 11079F: Documentation/blockdev/nbd.rst
11080F: drivers/block/nbd.c 11080F: drivers/block/nbd.c
11081F: include/trace/events/nbd.h 11081F: include/trace/events/nbd.h
11082F: include/uapi/linux/nbd.h 11082F: include/uapi/linux/nbd.h
@@ -12086,7 +12086,7 @@ PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
12086M: Tim Waugh <tim@cyberelk.net> 12086M: Tim Waugh <tim@cyberelk.net>
12087L: linux-parport@lists.infradead.org (subscribers-only) 12087L: linux-parport@lists.infradead.org (subscribers-only)
12088S: Maintained 12088S: Maintained
12089F: Documentation/blockdev/paride.txt 12089F: Documentation/blockdev/paride.rst
12090F: drivers/block/paride/ 12090F: drivers/block/paride/
12091 12091
12092PARISC ARCHITECTURE 12092PARISC ARCHITECTURE
@@ -13367,7 +13367,7 @@ F: drivers/net/wireless/ralink/rt2x00/
13367RAMDISK RAM BLOCK DEVICE DRIVER 13367RAMDISK RAM BLOCK DEVICE DRIVER
13368M: Jens Axboe <axboe@kernel.dk> 13368M: Jens Axboe <axboe@kernel.dk>
13369S: Maintained 13369S: Maintained
13370F: Documentation/blockdev/ramdisk.txt 13370F: Documentation/blockdev/ramdisk.rst
13371F: drivers/block/brd.c 13371F: drivers/block/brd.c
13372 13372
13373RANCHU VIRTUAL BOARD FOR MIPS 13373RANCHU VIRTUAL BOARD FOR MIPS
@@ -17723,7 +17723,7 @@ R: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
17723L: linux-kernel@vger.kernel.org 17723L: linux-kernel@vger.kernel.org
17724S: Maintained 17724S: Maintained
17725F: drivers/block/zram/ 17725F: drivers/block/zram/
17726F: Documentation/blockdev/zram.txt 17726F: Documentation/blockdev/zram.rst
17727 17727
17728ZS DECSTATION Z85C30 SERIAL DRIVER 17728ZS DECSTATION Z85C30 SERIAL DRIVER
17729M: "Maciej W. Rozycki" <macro@linux-mips.org> 17729M: "Maciej W. Rozycki" <macro@linux-mips.org>
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 96ec7e0fc1ea..c43690b973d8 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -31,7 +31,7 @@ config BLK_DEV_FD
31 If you want to use the floppy disk drive(s) of your PC under Linux, 31 If you want to use the floppy disk drive(s) of your PC under Linux,
32 say Y. Information about this driver, especially important for IBM 32 say Y. Information about this driver, especially important for IBM
33 Thinkpad users, is contained in 33 Thinkpad users, is contained in
34 <file:Documentation/blockdev/floppy.txt>. 34 <file:Documentation/blockdev/floppy.rst>.
35 That file also contains the location of the Floppy driver FAQ as 35 That file also contains the location of the Floppy driver FAQ as
36 well as location of the fdutils package used to configure additional 36 well as location of the fdutils package used to configure additional
37 parameters of the driver at run time. 37 parameters of the driver at run time.
@@ -96,7 +96,7 @@ config PARIDE
96 your computer's parallel port. Most of them are actually IDE devices 96 your computer's parallel port. Most of them are actually IDE devices
97 using a parallel port IDE adapter. This option enables the PARIDE 97 using a parallel port IDE adapter. This option enables the PARIDE
98 subsystem which contains drivers for many of these external drives. 98 subsystem which contains drivers for many of these external drives.
99 Read <file:Documentation/blockdev/paride.txt> for more information. 99 Read <file:Documentation/blockdev/paride.rst> for more information.
100 100
101 If you have said Y to the "Parallel-port support" configuration 101 If you have said Y to the "Parallel-port support" configuration
102 option, you may share a single port between your printer and other 102 option, you may share a single port between your printer and other
@@ -261,7 +261,7 @@ config BLK_DEV_NBD
261 userland (making server and client physically the same computer, 261 userland (making server and client physically the same computer,
262 communicating using the loopback network device). 262 communicating using the loopback network device).
263 263
264 Read <file:Documentation/blockdev/nbd.txt> for more information, 264 Read <file:Documentation/blockdev/nbd.rst> for more information,
265 especially about where to find the server code, which runs in user 265 especially about where to find the server code, which runs in user
266 space and does not need special kernel support. 266 space and does not need special kernel support.
267 267
@@ -303,7 +303,7 @@ config BLK_DEV_RAM
303 during the initial install of Linux. 303 during the initial install of Linux.
304 304
305 Note that the kernel command line option "ramdisk=XX" is now obsolete. 305 Note that the kernel command line option "ramdisk=XX" is now obsolete.
306 For details, read <file:Documentation/blockdev/ramdisk.txt>. 306 For details, read <file:Documentation/blockdev/ramdisk.rst>.
307 307
308 To compile this driver as a module, choose M here: the 308 To compile this driver as a module, choose M here: the
309 module will be called brd. An alias "rd" has been defined 309 module will be called brd. An alias "rd" has been defined
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index b933a7eea52b..5c99e52f9dc1 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4424,7 +4424,7 @@ static int __init floppy_setup(char *str)
4424 pr_cont("\n"); 4424 pr_cont("\n");
4425 } else 4425 } else
4426 DPRINT("botched floppy option\n"); 4426 DPRINT("botched floppy option\n");
4427 DPRINT("Read Documentation/blockdev/floppy.txt\n"); 4427 DPRINT("Read Documentation/blockdev/floppy.rst\n");
4428 return 0; 4428 return 0;
4429} 4429}
4430 4430
diff --git a/drivers/block/zram/Kconfig b/drivers/block/zram/Kconfig
index 1ffc64770643..e06b99d54816 100644
--- a/drivers/block/zram/Kconfig
+++ b/drivers/block/zram/Kconfig
@@ -12,7 +12,7 @@ config ZRAM
12 It has several use cases, for example: /tmp storage, use as swap 12 It has several use cases, for example: /tmp storage, use as swap
13 disks and maybe many more. 13 disks and maybe many more.
14 14
15 See Documentation/blockdev/zram.txt for more information. 15 See Documentation/blockdev/zram.rst for more information.
16 16
17config ZRAM_WRITEBACK 17config ZRAM_WRITEBACK
18 bool "Write back incompressible or idle page to backing device" 18 bool "Write back incompressible or idle page to backing device"
@@ -26,7 +26,7 @@ config ZRAM_WRITEBACK
26 With /sys/block/zramX/{idle,writeback}, application could ask 26 With /sys/block/zramX/{idle,writeback}, application could ask
27 idle page's writeback to the backing device to save in memory. 27 idle page's writeback to the backing device to save in memory.
28 28
29 See Documentation/blockdev/zram.txt for more information. 29 See Documentation/blockdev/zram.rst for more information.
30 30
31config ZRAM_MEMORY_TRACKING 31config ZRAM_MEMORY_TRACKING
32 bool "Track zRam block status" 32 bool "Track zRam block status"
@@ -36,4 +36,4 @@ config ZRAM_MEMORY_TRACKING
36 of zRAM. Admin could see the information via 36 of zRAM. Admin could see the information via
37 /sys/kernel/debug/zram/zramX/block_state. 37 /sys/kernel/debug/zram/zramX/block_state.
38 38
39 See Documentation/blockdev/zram.txt for more information. 39 See Documentation/blockdev/zram.rst for more information.
diff --git a/tools/testing/selftests/zram/README b/tools/testing/selftests/zram/README
index 7972cc512408..5fa378391d3b 100644
--- a/tools/testing/selftests/zram/README
+++ b/tools/testing/selftests/zram/README
@@ -37,4 +37,4 @@ Commands required for testing:
37 - mkfs/ mkfs.ext4 37 - mkfs/ mkfs.ext4
38 38
39For more information please refer: 39For more information please refer:
40kernel-source-tree/Documentation/blockdev/zram.txt 40kernel-source-tree/Documentation/blockdev/zram.rst