Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

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