diff options
author | James Morris <jmorris@namei.org> | 2010-03-30 17:39:27 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-03-30 17:39:27 -0400 |
commit | d25d6fa1a95f465ff1ec4458ca15e30b2c8dffec (patch) | |
tree | 7362b182dedd825fc762ef7706830837e42943af /Documentation | |
parent | 225a9be24d799aa16d543c31fb09f0c9ed1d9caa (diff) | |
parent | 2eaa9cfdf33b8d7fb7aff27792192e0019ae8fc6 (diff) |
Merge branch 'master' into next
Diffstat (limited to 'Documentation')
86 files changed, 3581 insertions, 1434 deletions
diff --git a/Documentation/ABI/stable/sysfs-devices-node b/Documentation/ABI/stable/sysfs-devices-node new file mode 100644 index 000000000000..49b82cad7003 --- /dev/null +++ b/Documentation/ABI/stable/sysfs-devices-node | |||
@@ -0,0 +1,7 @@ | |||
1 | What: /sys/devices/system/node/nodeX | ||
2 | Date: October 2002 | ||
3 | Contact: Linux Memory Management list <linux-mm@kvack.org> | ||
4 | Description: | ||
5 | When CONFIG_NUMA is enabled, this is a directory containing | ||
6 | information on node X such as what CPUs are local to the | ||
7 | node. | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index a986e9bbba3d..bcebb9eaedce 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -160,7 +160,7 @@ Description: | |||
160 | match the driver to the device. For example: | 160 | match the driver to the device. For example: |
161 | # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id | 161 | # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id |
162 | 162 | ||
163 | What: /sys/bus/usb/device/.../avoid_reset | 163 | What: /sys/bus/usb/device/.../avoid_reset_quirk |
164 | Date: December 2009 | 164 | Date: December 2009 |
165 | Contact: Oliver Neukum <oliver@neukum.org> | 165 | Contact: Oliver Neukum <oliver@neukum.org> |
166 | Description: | 166 | Description: |
diff --git a/Documentation/PCI/PCI-DMA-mapping.txt b/Documentation/DMA-API-HOWTO.txt index ecad88d9fe59..52618ab069ad 100644 --- a/Documentation/PCI/PCI-DMA-mapping.txt +++ b/Documentation/DMA-API-HOWTO.txt | |||
@@ -1,12 +1,12 @@ | |||
1 | Dynamic DMA mapping | 1 | Dynamic DMA mapping Guide |
2 | =================== | 2 | ========================= |
3 | 3 | ||
4 | David S. Miller <davem@redhat.com> | 4 | David S. Miller <davem@redhat.com> |
5 | Richard Henderson <rth@cygnus.com> | 5 | Richard Henderson <rth@cygnus.com> |
6 | Jakub Jelinek <jakub@redhat.com> | 6 | Jakub Jelinek <jakub@redhat.com> |
7 | 7 | ||
8 | This document describes the DMA mapping system in terms of the pci_ | 8 | This is a guide to device driver writers on how to use the DMA API |
9 | API. For a similar API that works for generic devices, see | 9 | with example pseudo-code. For a concise description of the API, see |
10 | DMA-API.txt. | 10 | DMA-API.txt. |
11 | 11 | ||
12 | Most of the 64bit platforms have special hardware that translates bus | 12 | Most of the 64bit platforms have special hardware that translates bus |
@@ -26,12 +26,15 @@ mapped only for the time they are actually used and unmapped after the DMA | |||
26 | transfer. | 26 | transfer. |
27 | 27 | ||
28 | The following API will work of course even on platforms where no such | 28 | The following API will work of course even on platforms where no such |
29 | hardware exists, see e.g. arch/x86/include/asm/pci.h for how it is implemented on | 29 | hardware exists. |
30 | top of the virt_to_bus interface. | 30 | |
31 | Note that the DMA API works with any bus independent of the underlying | ||
32 | microprocessor architecture. You should use the DMA API rather than | ||
33 | the bus specific DMA API (e.g. pci_dma_*). | ||
31 | 34 | ||
32 | First of all, you should make sure | 35 | First of all, you should make sure |
33 | 36 | ||
34 | #include <linux/pci.h> | 37 | #include <linux/dma-mapping.h> |
35 | 38 | ||
36 | is in your driver. This file will obtain for you the definition of the | 39 | is in your driver. This file will obtain for you the definition of the |
37 | dma_addr_t (which can hold any valid DMA address for the platform) | 40 | dma_addr_t (which can hold any valid DMA address for the platform) |
@@ -78,44 +81,43 @@ for you to DMA from/to. | |||
78 | DMA addressing limitations | 81 | DMA addressing limitations |
79 | 82 | ||
80 | Does your device have any DMA addressing limitations? For example, is | 83 | Does your device have any DMA addressing limitations? For example, is |
81 | your device only capable of driving the low order 24-bits of address | 84 | your device only capable of driving the low order 24-bits of address? |
82 | on the PCI bus for SAC DMA transfers? If so, you need to inform the | 85 | If so, you need to inform the kernel of this fact. |
83 | PCI layer of this fact. | ||
84 | 86 | ||
85 | By default, the kernel assumes that your device can address the full | 87 | By default, the kernel assumes that your device can address the full |
86 | 32-bits in a SAC cycle. For a 64-bit DAC capable device, this needs | 88 | 32-bits. For a 64-bit capable device, this needs to be increased. |
87 | to be increased. And for a device with limitations, as discussed in | 89 | And for a device with limitations, as discussed in the previous |
88 | the previous paragraph, it needs to be decreased. | 90 | paragraph, it needs to be decreased. |
89 | 91 | ||
90 | pci_alloc_consistent() by default will return 32-bit DMA addresses. | 92 | Special note about PCI: PCI-X specification requires PCI-X devices to |
91 | PCI-X specification requires PCI-X devices to support 64-bit | 93 | support 64-bit addressing (DAC) for all transactions. And at least |
92 | addressing (DAC) for all transactions. And at least one platform (SGI | 94 | one platform (SGI SN2) requires 64-bit consistent allocations to |
93 | SN2) requires 64-bit consistent allocations to operate correctly when | 95 | operate correctly when the IO bus is in PCI-X mode. |
94 | the IO bus is in PCI-X mode. Therefore, like with pci_set_dma_mask(), | 96 | |
95 | it's good practice to call pci_set_consistent_dma_mask() to set the | 97 | For correct operation, you must interrogate the kernel in your device |
96 | appropriate mask even if your device only supports 32-bit DMA | 98 | probe routine to see if the DMA controller on the machine can properly |
97 | (default) and especially if it's a PCI-X device. | 99 | support the DMA addressing limitation your device has. It is good |
98 | 100 | style to do this even if your device holds the default setting, | |
99 | For correct operation, you must interrogate the PCI layer in your | ||
100 | device probe routine to see if the PCI controller on the machine can | ||
101 | properly support the DMA addressing limitation your device has. It is | ||
102 | good style to do this even if your device holds the default setting, | ||
103 | because this shows that you did think about these issues wrt. your | 101 | because this shows that you did think about these issues wrt. your |
104 | device. | 102 | device. |
105 | 103 | ||
106 | The query is performed via a call to pci_set_dma_mask(): | 104 | The query is performed via a call to dma_set_mask(): |
107 | 105 | ||
108 | int pci_set_dma_mask(struct pci_dev *pdev, u64 device_mask); | 106 | int dma_set_mask(struct device *dev, u64 mask); |
109 | 107 | ||
110 | The query for consistent allocations is performed via a call to | 108 | The query for consistent allocations is performed via a call to |
111 | pci_set_consistent_dma_mask(): | 109 | dma_set_coherent_mask(): |
112 | 110 | ||
113 | int pci_set_consistent_dma_mask(struct pci_dev *pdev, u64 device_mask); | 111 | int dma_set_coherent_mask(struct device *dev, u64 mask); |
114 | 112 | ||
115 | Here, pdev is a pointer to the PCI device struct of your device, and | 113 | Here, dev is a pointer to the device struct of your device, and mask |
116 | device_mask is a bit mask describing which bits of a PCI address your | 114 | is a bit mask describing which bits of an address your device |
117 | device supports. It returns zero if your card can perform DMA | 115 | supports. It returns zero if your card can perform DMA properly on |
118 | properly on the machine given the address mask you provided. | 116 | the machine given the address mask you provided. In general, the |
117 | device struct of your device is embedded in the bus specific device | ||
118 | struct of your device. For example, a pointer to the device struct of | ||
119 | your PCI device is pdev->dev (pdev is a pointer to the PCI device | ||
120 | struct of your device). | ||
119 | 121 | ||
120 | If it returns non-zero, your device cannot perform DMA properly on | 122 | If it returns non-zero, your device cannot perform DMA properly on |
121 | this platform, and attempting to do so will result in undefined | 123 | this platform, and attempting to do so will result in undefined |
@@ -133,31 +135,30 @@ of your driver reports that performance is bad or that the device is not | |||
133 | even detected, you can ask them for the kernel messages to find out | 135 | even detected, you can ask them for the kernel messages to find out |
134 | exactly why. | 136 | exactly why. |
135 | 137 | ||
136 | The standard 32-bit addressing PCI device would do something like | 138 | The standard 32-bit addressing device would do something like this: |
137 | this: | ||
138 | 139 | ||
139 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 140 | if (dma_set_mask(dev, DMA_BIT_MASK(32))) { |
140 | printk(KERN_WARNING | 141 | printk(KERN_WARNING |
141 | "mydev: No suitable DMA available.\n"); | 142 | "mydev: No suitable DMA available.\n"); |
142 | goto ignore_this_device; | 143 | goto ignore_this_device; |
143 | } | 144 | } |
144 | 145 | ||
145 | Another common scenario is a 64-bit capable device. The approach | 146 | Another common scenario is a 64-bit capable device. The approach here |
146 | here is to try for 64-bit DAC addressing, but back down to a | 147 | is to try for 64-bit addressing, but back down to a 32-bit mask that |
147 | 32-bit mask should that fail. The PCI platform code may fail the | 148 | should not fail. The kernel may fail the 64-bit mask not because the |
148 | 64-bit mask not because the platform is not capable of 64-bit | 149 | platform is not capable of 64-bit addressing. Rather, it may fail in |
149 | addressing. Rather, it may fail in this case simply because | 150 | this case simply because 32-bit addressing is done more efficiently |
150 | 32-bit SAC addressing is done more efficiently than DAC addressing. | 151 | than 64-bit addressing. For example, Sparc64 PCI SAC addressing is |
151 | Sparc64 is one platform which behaves in this way. | 152 | more efficient than DAC addressing. |
152 | 153 | ||
153 | Here is how you would handle a 64-bit capable device which can drive | 154 | Here is how you would handle a 64-bit capable device which can drive |
154 | all 64-bits when accessing streaming DMA: | 155 | all 64-bits when accessing streaming DMA: |
155 | 156 | ||
156 | int using_dac; | 157 | int using_dac; |
157 | 158 | ||
158 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 159 | if (!dma_set_mask(dev, DMA_BIT_MASK(64))) { |
159 | using_dac = 1; | 160 | using_dac = 1; |
160 | } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 161 | } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) { |
161 | using_dac = 0; | 162 | using_dac = 0; |
162 | } else { | 163 | } else { |
163 | printk(KERN_WARNING | 164 | printk(KERN_WARNING |
@@ -170,36 +171,36 @@ the case would look like this: | |||
170 | 171 | ||
171 | int using_dac, consistent_using_dac; | 172 | int using_dac, consistent_using_dac; |
172 | 173 | ||
173 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 174 | if (!dma_set_mask(dev, DMA_BIT_MASK(64))) { |
174 | using_dac = 1; | 175 | using_dac = 1; |
175 | consistent_using_dac = 1; | 176 | consistent_using_dac = 1; |
176 | pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | 177 | dma_set_coherent_mask(dev, DMA_BIT_MASK(64)); |
177 | } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 178 | } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) { |
178 | using_dac = 0; | 179 | using_dac = 0; |
179 | consistent_using_dac = 0; | 180 | consistent_using_dac = 0; |
180 | pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); | 181 | dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); |
181 | } else { | 182 | } else { |
182 | printk(KERN_WARNING | 183 | printk(KERN_WARNING |
183 | "mydev: No suitable DMA available.\n"); | 184 | "mydev: No suitable DMA available.\n"); |
184 | goto ignore_this_device; | 185 | goto ignore_this_device; |
185 | } | 186 | } |
186 | 187 | ||
187 | pci_set_consistent_dma_mask() will always be able to set the same or a | 188 | dma_set_coherent_mask() will always be able to set the same or a |
188 | smaller mask as pci_set_dma_mask(). However for the rare case that a | 189 | smaller mask as dma_set_mask(). However for the rare case that a |
189 | device driver only uses consistent allocations, one would have to | 190 | device driver only uses consistent allocations, one would have to |
190 | check the return value from pci_set_consistent_dma_mask(). | 191 | check the return value from dma_set_coherent_mask(). |
191 | 192 | ||
192 | Finally, if your device can only drive the low 24-bits of | 193 | Finally, if your device can only drive the low 24-bits of |
193 | address during PCI bus mastering you might do something like: | 194 | address you might do something like: |
194 | 195 | ||
195 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(24))) { | 196 | if (dma_set_mask(dev, DMA_BIT_MASK(24))) { |
196 | printk(KERN_WARNING | 197 | printk(KERN_WARNING |
197 | "mydev: 24-bit DMA addressing not available.\n"); | 198 | "mydev: 24-bit DMA addressing not available.\n"); |
198 | goto ignore_this_device; | 199 | goto ignore_this_device; |
199 | } | 200 | } |
200 | 201 | ||
201 | When pci_set_dma_mask() is successful, and returns zero, the PCI layer | 202 | When dma_set_mask() is successful, and returns zero, the kernel saves |
202 | saves away this mask you have provided. The PCI layer will use this | 203 | away this mask you have provided. The kernel will use this |
203 | information later when you make DMA mappings. | 204 | information later when you make DMA mappings. |
204 | 205 | ||
205 | There is a case which we are aware of at this time, which is worth | 206 | There is a case which we are aware of at this time, which is worth |
@@ -208,7 +209,7 @@ functions (for example a sound card provides playback and record | |||
208 | functions) and the various different functions have _different_ | 209 | functions) and the various different functions have _different_ |
209 | DMA addressing limitations, you may wish to probe each mask and | 210 | DMA addressing limitations, you may wish to probe each mask and |
210 | only provide the functionality which the machine can handle. It | 211 | only provide the functionality which the machine can handle. It |
211 | is important that the last call to pci_set_dma_mask() be for the | 212 | is important that the last call to dma_set_mask() be for the |
212 | most specific mask. | 213 | most specific mask. |
213 | 214 | ||
214 | Here is pseudo-code showing how this might be done: | 215 | Here is pseudo-code showing how this might be done: |
@@ -217,17 +218,17 @@ Here is pseudo-code showing how this might be done: | |||
217 | #define RECORD_ADDRESS_BITS DMA_BIT_MASK(24) | 218 | #define RECORD_ADDRESS_BITS DMA_BIT_MASK(24) |
218 | 219 | ||
219 | struct my_sound_card *card; | 220 | struct my_sound_card *card; |
220 | struct pci_dev *pdev; | 221 | struct device *dev; |
221 | 222 | ||
222 | ... | 223 | ... |
223 | if (!pci_set_dma_mask(pdev, PLAYBACK_ADDRESS_BITS)) { | 224 | if (!dma_set_mask(dev, PLAYBACK_ADDRESS_BITS)) { |
224 | card->playback_enabled = 1; | 225 | card->playback_enabled = 1; |
225 | } else { | 226 | } else { |
226 | card->playback_enabled = 0; | 227 | card->playback_enabled = 0; |
227 | printk(KERN_WARNING "%s: Playback disabled due to DMA limitations.\n", | 228 | printk(KERN_WARNING "%s: Playback disabled due to DMA limitations.\n", |
228 | card->name); | 229 | card->name); |
229 | } | 230 | } |
230 | if (!pci_set_dma_mask(pdev, RECORD_ADDRESS_BITS)) { | 231 | if (!dma_set_mask(dev, RECORD_ADDRESS_BITS)) { |
231 | card->record_enabled = 1; | 232 | card->record_enabled = 1; |
232 | } else { | 233 | } else { |
233 | card->record_enabled = 0; | 234 | card->record_enabled = 0; |
@@ -252,8 +253,8 @@ There are two types of DMA mappings: | |||
252 | Think of "consistent" as "synchronous" or "coherent". | 253 | Think of "consistent" as "synchronous" or "coherent". |
253 | 254 | ||
254 | The current default is to return consistent memory in the low 32 | 255 | The current default is to return consistent memory in the low 32 |
255 | bits of the PCI bus space. However, for future compatibility you | 256 | bits of the bus space. However, for future compatibility you should |
256 | should set the consistent mask even if this default is fine for your | 257 | set the consistent mask even if this default is fine for your |
257 | driver. | 258 | driver. |
258 | 259 | ||
259 | Good examples of what to use consistent mappings for are: | 260 | Good examples of what to use consistent mappings for are: |
@@ -285,9 +286,9 @@ There are two types of DMA mappings: | |||
285 | found in PCI bridges (such as by reading a register's value | 286 | found in PCI bridges (such as by reading a register's value |
286 | after writing it). | 287 | after writing it). |
287 | 288 | ||
288 | - Streaming DMA mappings which are usually mapped for one DMA transfer, | 289 | - Streaming DMA mappings which are usually mapped for one DMA |
289 | unmapped right after it (unless you use pci_dma_sync_* below) and for which | 290 | transfer, unmapped right after it (unless you use dma_sync_* below) |
290 | hardware can optimize for sequential accesses. | 291 | and for which hardware can optimize for sequential accesses. |
291 | 292 | ||
292 | This of "streaming" as "asynchronous" or "outside the coherency | 293 | This of "streaming" as "asynchronous" or "outside the coherency |
293 | domain". | 294 | domain". |
@@ -302,8 +303,8 @@ There are two types of DMA mappings: | |||
302 | optimizations the hardware allows. To this end, when using | 303 | optimizations the hardware allows. To this end, when using |
303 | such mappings you must be explicit about what you want to happen. | 304 | such mappings you must be explicit about what you want to happen. |
304 | 305 | ||
305 | Neither type of DMA mapping has alignment restrictions that come | 306 | Neither type of DMA mapping has alignment restrictions that come from |
306 | from PCI, although some devices may have such restrictions. | 307 | the underlying bus, although some devices may have such restrictions. |
307 | Also, systems with caches that aren't DMA-coherent will work better | 308 | Also, systems with caches that aren't DMA-coherent will work better |
308 | when the underlying buffers don't share cache lines with other data. | 309 | when the underlying buffers don't share cache lines with other data. |
309 | 310 | ||
@@ -315,33 +316,27 @@ you should do: | |||
315 | 316 | ||
316 | dma_addr_t dma_handle; | 317 | dma_addr_t dma_handle; |
317 | 318 | ||
318 | cpu_addr = pci_alloc_consistent(pdev, size, &dma_handle); | 319 | cpu_addr = dma_alloc_coherent(dev, size, &dma_handle, gfp); |
319 | |||
320 | where pdev is a struct pci_dev *. This may be called in interrupt context. | ||
321 | You should use dma_alloc_coherent (see DMA-API.txt) for buses | ||
322 | where devices don't have struct pci_dev (like ISA, EISA). | ||
323 | 320 | ||
324 | This argument is needed because the DMA translations may be bus | 321 | where device is a struct device *. This may be called in interrupt |
325 | specific (and often is private to the bus which the device is attached | 322 | context with the GFP_ATOMIC flag. |
326 | to). | ||
327 | 323 | ||
328 | Size is the length of the region you want to allocate, in bytes. | 324 | Size is the length of the region you want to allocate, in bytes. |
329 | 325 | ||
330 | This routine will allocate RAM for that region, so it acts similarly to | 326 | This routine will allocate RAM for that region, so it acts similarly to |
331 | __get_free_pages (but takes size instead of a page order). If your | 327 | __get_free_pages (but takes size instead of a page order). If your |
332 | driver needs regions sized smaller than a page, you may prefer using | 328 | driver needs regions sized smaller than a page, you may prefer using |
333 | the pci_pool interface, described below. | 329 | the dma_pool interface, described below. |
334 | 330 | ||
335 | The consistent DMA mapping interfaces, for non-NULL pdev, will by | 331 | The consistent DMA mapping interfaces, for non-NULL dev, will by |
336 | default return a DMA address which is SAC (Single Address Cycle) | 332 | default return a DMA address which is 32-bit addressable. Even if the |
337 | addressable. Even if the device indicates (via PCI dma mask) that it | 333 | device indicates (via DMA mask) that it may address the upper 32-bits, |
338 | may address the upper 32-bits and thus perform DAC cycles, consistent | 334 | consistent allocation will only return > 32-bit addresses for DMA if |
339 | allocation will only return > 32-bit PCI addresses for DMA if the | 335 | the consistent DMA mask has been explicitly changed via |
340 | consistent dma mask has been explicitly changed via | 336 | dma_set_coherent_mask(). This is true of the dma_pool interface as |
341 | pci_set_consistent_dma_mask(). This is true of the pci_pool interface | 337 | well. |
342 | as well. | 338 | |
343 | 339 | dma_alloc_coherent returns two values: the virtual address which you | |
344 | pci_alloc_consistent returns two values: the virtual address which you | ||
345 | can use to access it from the CPU and dma_handle which you pass to the | 340 | can use to access it from the CPU and dma_handle which you pass to the |
346 | card. | 341 | card. |
347 | 342 | ||
@@ -354,54 +349,54 @@ buffer you receive will not cross a 64K boundary. | |||
354 | 349 | ||
355 | To unmap and free such a DMA region, you call: | 350 | To unmap and free such a DMA region, you call: |
356 | 351 | ||
357 | pci_free_consistent(pdev, size, cpu_addr, dma_handle); | 352 | dma_free_coherent(dev, size, cpu_addr, dma_handle); |
358 | 353 | ||
359 | where pdev, size are the same as in the above call and cpu_addr and | 354 | where dev, size are the same as in the above call and cpu_addr and |
360 | dma_handle are the values pci_alloc_consistent returned to you. | 355 | dma_handle are the values dma_alloc_coherent returned to you. |
361 | This function may not be called in interrupt context. | 356 | This function may not be called in interrupt context. |
362 | 357 | ||
363 | If your driver needs lots of smaller memory regions, you can write | 358 | If your driver needs lots of smaller memory regions, you can write |
364 | custom code to subdivide pages returned by pci_alloc_consistent, | 359 | custom code to subdivide pages returned by dma_alloc_coherent, |
365 | or you can use the pci_pool API to do that. A pci_pool is like | 360 | or you can use the dma_pool API to do that. A dma_pool is like |
366 | a kmem_cache, but it uses pci_alloc_consistent not __get_free_pages. | 361 | a kmem_cache, but it uses dma_alloc_coherent not __get_free_pages. |
367 | Also, it understands common hardware constraints for alignment, | 362 | Also, it understands common hardware constraints for alignment, |
368 | like queue heads needing to be aligned on N byte boundaries. | 363 | like queue heads needing to be aligned on N byte boundaries. |
369 | 364 | ||
370 | Create a pci_pool like this: | 365 | Create a dma_pool like this: |
371 | 366 | ||
372 | struct pci_pool *pool; | 367 | struct dma_pool *pool; |
373 | 368 | ||
374 | pool = pci_pool_create(name, pdev, size, align, alloc); | 369 | pool = dma_pool_create(name, dev, size, align, alloc); |
375 | 370 | ||
376 | The "name" is for diagnostics (like a kmem_cache name); pdev and size | 371 | The "name" is for diagnostics (like a kmem_cache name); dev and size |
377 | are as above. The device's hardware alignment requirement for this | 372 | are as above. The device's hardware alignment requirement for this |
378 | type of data is "align" (which is expressed in bytes, and must be a | 373 | type of data is "align" (which is expressed in bytes, and must be a |
379 | power of two). If your device has no boundary crossing restrictions, | 374 | power of two). If your device has no boundary crossing restrictions, |
380 | pass 0 for alloc; passing 4096 says memory allocated from this pool | 375 | pass 0 for alloc; passing 4096 says memory allocated from this pool |
381 | must not cross 4KByte boundaries (but at that time it may be better to | 376 | must not cross 4KByte boundaries (but at that time it may be better to |
382 | go for pci_alloc_consistent directly instead). | 377 | go for dma_alloc_coherent directly instead). |
383 | 378 | ||
384 | Allocate memory from a pci pool like this: | 379 | Allocate memory from a dma pool like this: |
385 | 380 | ||
386 | cpu_addr = pci_pool_alloc(pool, flags, &dma_handle); | 381 | cpu_addr = dma_pool_alloc(pool, flags, &dma_handle); |
387 | 382 | ||
388 | flags are SLAB_KERNEL if blocking is permitted (not in_interrupt nor | 383 | flags are SLAB_KERNEL if blocking is permitted (not in_interrupt nor |
389 | holding SMP locks), SLAB_ATOMIC otherwise. Like pci_alloc_consistent, | 384 | holding SMP locks), SLAB_ATOMIC otherwise. Like dma_alloc_coherent, |
390 | this returns two values, cpu_addr and dma_handle. | 385 | this returns two values, cpu_addr and dma_handle. |
391 | 386 | ||
392 | Free memory that was allocated from a pci_pool like this: | 387 | Free memory that was allocated from a dma_pool like this: |
393 | 388 | ||
394 | pci_pool_free(pool, cpu_addr, dma_handle); | 389 | dma_pool_free(pool, cpu_addr, dma_handle); |
395 | 390 | ||
396 | where pool is what you passed to pci_pool_alloc, and cpu_addr and | 391 | where pool is what you passed to dma_pool_alloc, and cpu_addr and |
397 | dma_handle are the values pci_pool_alloc returned. This function | 392 | dma_handle are the values dma_pool_alloc returned. This function |
398 | may be called in interrupt context. | 393 | may be called in interrupt context. |
399 | 394 | ||
400 | Destroy a pci_pool by calling: | 395 | Destroy a dma_pool by calling: |
401 | 396 | ||
402 | pci_pool_destroy(pool); | 397 | dma_pool_destroy(pool); |
403 | 398 | ||
404 | Make sure you've called pci_pool_free for all memory allocated | 399 | Make sure you've called dma_pool_free for all memory allocated |
405 | from a pool before you destroy the pool. This function may not | 400 | from a pool before you destroy the pool. This function may not |
406 | be called in interrupt context. | 401 | be called in interrupt context. |
407 | 402 | ||
@@ -411,15 +406,15 @@ The interfaces described in subsequent portions of this document | |||
411 | take a DMA direction argument, which is an integer and takes on | 406 | take a DMA direction argument, which is an integer and takes on |
412 | one of the following values: | 407 | one of the following values: |
413 | 408 | ||
414 | PCI_DMA_BIDIRECTIONAL | 409 | DMA_BIDIRECTIONAL |
415 | PCI_DMA_TODEVICE | 410 | DMA_TO_DEVICE |
416 | PCI_DMA_FROMDEVICE | 411 | DMA_FROM_DEVICE |
417 | PCI_DMA_NONE | 412 | DMA_NONE |
418 | 413 | ||
419 | One should provide the exact DMA direction if you know it. | 414 | One should provide the exact DMA direction if you know it. |
420 | 415 | ||
421 | PCI_DMA_TODEVICE means "from main memory to the PCI device" | 416 | DMA_TO_DEVICE means "from main memory to the device" |
422 | PCI_DMA_FROMDEVICE means "from the PCI device to main memory" | 417 | DMA_FROM_DEVICE means "from the device to main memory" |
423 | It is the direction in which the data moves during the DMA | 418 | It is the direction in which the data moves during the DMA |
424 | transfer. | 419 | transfer. |
425 | 420 | ||
@@ -427,12 +422,12 @@ You are _strongly_ encouraged to specify this as precisely | |||
427 | as you possibly can. | 422 | as you possibly can. |
428 | 423 | ||
429 | If you absolutely cannot know the direction of the DMA transfer, | 424 | If you absolutely cannot know the direction of the DMA transfer, |
430 | specify PCI_DMA_BIDIRECTIONAL. It means that the DMA can go in | 425 | specify DMA_BIDIRECTIONAL. It means that the DMA can go in |
431 | either direction. The platform guarantees that you may legally | 426 | either direction. The platform guarantees that you may legally |
432 | specify this, and that it will work, but this may be at the | 427 | specify this, and that it will work, but this may be at the |
433 | cost of performance for example. | 428 | cost of performance for example. |
434 | 429 | ||
435 | The value PCI_DMA_NONE is to be used for debugging. One can | 430 | The value DMA_NONE is to be used for debugging. One can |
436 | hold this in a data structure before you come to know the | 431 | hold this in a data structure before you come to know the |
437 | precise direction, and this will help catch cases where your | 432 | precise direction, and this will help catch cases where your |
438 | direction tracking logic has failed to set things up properly. | 433 | direction tracking logic has failed to set things up properly. |
@@ -442,21 +437,21 @@ potential platform-specific optimizations of such) is for debugging. | |||
442 | Some platforms actually have a write permission boolean which DMA | 437 | Some platforms actually have a write permission boolean which DMA |
443 | mappings can be marked with, much like page protections in the user | 438 | mappings can be marked with, much like page protections in the user |
444 | program address space. Such platforms can and do report errors in the | 439 | program address space. Such platforms can and do report errors in the |
445 | kernel logs when the PCI controller hardware detects violation of the | 440 | kernel logs when the DMA controller hardware detects violation of the |
446 | permission setting. | 441 | permission setting. |
447 | 442 | ||
448 | Only streaming mappings specify a direction, consistent mappings | 443 | Only streaming mappings specify a direction, consistent mappings |
449 | implicitly have a direction attribute setting of | 444 | implicitly have a direction attribute setting of |
450 | PCI_DMA_BIDIRECTIONAL. | 445 | DMA_BIDIRECTIONAL. |
451 | 446 | ||
452 | The SCSI subsystem tells you the direction to use in the | 447 | The SCSI subsystem tells you the direction to use in the |
453 | 'sc_data_direction' member of the SCSI command your driver is | 448 | 'sc_data_direction' member of the SCSI command your driver is |
454 | working on. | 449 | working on. |
455 | 450 | ||
456 | For Networking drivers, it's a rather simple affair. For transmit | 451 | For Networking drivers, it's a rather simple affair. For transmit |
457 | packets, map/unmap them with the PCI_DMA_TODEVICE direction | 452 | packets, map/unmap them with the DMA_TO_DEVICE direction |
458 | specifier. For receive packets, just the opposite, map/unmap them | 453 | specifier. For receive packets, just the opposite, map/unmap them |
459 | with the PCI_DMA_FROMDEVICE direction specifier. | 454 | with the DMA_FROM_DEVICE direction specifier. |
460 | 455 | ||
461 | Using Streaming DMA mappings | 456 | Using Streaming DMA mappings |
462 | 457 | ||
@@ -467,43 +462,43 @@ scatterlist. | |||
467 | 462 | ||
468 | To map a single region, you do: | 463 | To map a single region, you do: |
469 | 464 | ||
470 | struct pci_dev *pdev = mydev->pdev; | 465 | struct device *dev = &my_dev->dev; |
471 | dma_addr_t dma_handle; | 466 | dma_addr_t dma_handle; |
472 | void *addr = buffer->ptr; | 467 | void *addr = buffer->ptr; |
473 | size_t size = buffer->len; | 468 | size_t size = buffer->len; |
474 | 469 | ||
475 | dma_handle = pci_map_single(pdev, addr, size, direction); | 470 | dma_handle = dma_map_single(dev, addr, size, direction); |
476 | 471 | ||
477 | and to unmap it: | 472 | and to unmap it: |
478 | 473 | ||
479 | pci_unmap_single(pdev, dma_handle, size, direction); | 474 | dma_unmap_single(dev, dma_handle, size, direction); |
480 | 475 | ||
481 | You should call pci_unmap_single when the DMA activity is finished, e.g. | 476 | You should call dma_unmap_single when the DMA activity is finished, e.g. |
482 | from the interrupt which told you that the DMA transfer is done. | 477 | from the interrupt which told you that the DMA transfer is done. |
483 | 478 | ||
484 | Using cpu pointers like this for single mappings has a disadvantage, | 479 | Using cpu pointers like this for single mappings has a disadvantage, |
485 | you cannot reference HIGHMEM memory in this way. Thus, there is a | 480 | you cannot reference HIGHMEM memory in this way. Thus, there is a |
486 | map/unmap interface pair akin to pci_{map,unmap}_single. These | 481 | map/unmap interface pair akin to dma_{map,unmap}_single. These |
487 | interfaces deal with page/offset pairs instead of cpu pointers. | 482 | interfaces deal with page/offset pairs instead of cpu pointers. |
488 | Specifically: | 483 | Specifically: |
489 | 484 | ||
490 | struct pci_dev *pdev = mydev->pdev; | 485 | struct device *dev = &my_dev->dev; |
491 | dma_addr_t dma_handle; | 486 | dma_addr_t dma_handle; |
492 | struct page *page = buffer->page; | 487 | struct page *page = buffer->page; |
493 | unsigned long offset = buffer->offset; | 488 | unsigned long offset = buffer->offset; |
494 | size_t size = buffer->len; | 489 | size_t size = buffer->len; |
495 | 490 | ||
496 | dma_handle = pci_map_page(pdev, page, offset, size, direction); | 491 | dma_handle = dma_map_page(dev, page, offset, size, direction); |
497 | 492 | ||
498 | ... | 493 | ... |
499 | 494 | ||
500 | pci_unmap_page(pdev, dma_handle, size, direction); | 495 | dma_unmap_page(dev, dma_handle, size, direction); |
501 | 496 | ||
502 | Here, "offset" means byte offset within the given page. | 497 | Here, "offset" means byte offset within the given page. |
503 | 498 | ||
504 | With scatterlists, you map a region gathered from several regions by: | 499 | With scatterlists, you map a region gathered from several regions by: |
505 | 500 | ||
506 | int i, count = pci_map_sg(pdev, sglist, nents, direction); | 501 | int i, count = dma_map_sg(dev, sglist, nents, direction); |
507 | struct scatterlist *sg; | 502 | struct scatterlist *sg; |
508 | 503 | ||
509 | for_each_sg(sglist, sg, count, i) { | 504 | for_each_sg(sglist, sg, count, i) { |
@@ -527,16 +522,16 @@ accessed sg->address and sg->length as shown above. | |||
527 | 522 | ||
528 | To unmap a scatterlist, just call: | 523 | To unmap a scatterlist, just call: |
529 | 524 | ||
530 | pci_unmap_sg(pdev, sglist, nents, direction); | 525 | dma_unmap_sg(dev, sglist, nents, direction); |
531 | 526 | ||
532 | Again, make sure DMA activity has already finished. | 527 | Again, make sure DMA activity has already finished. |
533 | 528 | ||
534 | PLEASE NOTE: The 'nents' argument to the pci_unmap_sg call must be | 529 | PLEASE NOTE: The 'nents' argument to the dma_unmap_sg call must be |
535 | the _same_ one you passed into the pci_map_sg call, | 530 | the _same_ one you passed into the dma_map_sg call, |
536 | it should _NOT_ be the 'count' value _returned_ from the | 531 | it should _NOT_ be the 'count' value _returned_ from the |
537 | pci_map_sg call. | 532 | dma_map_sg call. |
538 | 533 | ||
539 | Every pci_map_{single,sg} call should have its pci_unmap_{single,sg} | 534 | Every dma_map_{single,sg} call should have its dma_unmap_{single,sg} |
540 | counterpart, because the bus address space is a shared resource (although | 535 | counterpart, because the bus address space is a shared resource (although |
541 | in some ports the mapping is per each BUS so less devices contend for the | 536 | in some ports the mapping is per each BUS so less devices contend for the |
542 | same bus address space) and you could render the machine unusable by eating | 537 | same bus address space) and you could render the machine unusable by eating |
@@ -547,14 +542,14 @@ the data in between the DMA transfers, the buffer needs to be synced | |||
547 | properly in order for the cpu and device to see the most uptodate and | 542 | properly in order for the cpu and device to see the most uptodate and |
548 | correct copy of the DMA buffer. | 543 | correct copy of the DMA buffer. |
549 | 544 | ||
550 | So, firstly, just map it with pci_map_{single,sg}, and after each DMA | 545 | So, firstly, just map it with dma_map_{single,sg}, and after each DMA |
551 | transfer call either: | 546 | transfer call either: |
552 | 547 | ||
553 | pci_dma_sync_single_for_cpu(pdev, dma_handle, size, direction); | 548 | dma_sync_single_for_cpu(dev, dma_handle, size, direction); |
554 | 549 | ||
555 | or: | 550 | or: |
556 | 551 | ||
557 | pci_dma_sync_sg_for_cpu(pdev, sglist, nents, direction); | 552 | dma_sync_sg_for_cpu(dev, sglist, nents, direction); |
558 | 553 | ||
559 | as appropriate. | 554 | as appropriate. |
560 | 555 | ||
@@ -562,27 +557,27 @@ Then, if you wish to let the device get at the DMA area again, | |||
562 | finish accessing the data with the cpu, and then before actually | 557 | finish accessing the data with the cpu, and then before actually |
563 | giving the buffer to the hardware call either: | 558 | giving the buffer to the hardware call either: |
564 | 559 | ||
565 | pci_dma_sync_single_for_device(pdev, dma_handle, size, direction); | 560 | dma_sync_single_for_device(dev, dma_handle, size, direction); |
566 | 561 | ||
567 | or: | 562 | or: |
568 | 563 | ||
569 | pci_dma_sync_sg_for_device(dev, sglist, nents, direction); | 564 | dma_sync_sg_for_device(dev, sglist, nents, direction); |
570 | 565 | ||
571 | as appropriate. | 566 | as appropriate. |
572 | 567 | ||
573 | After the last DMA transfer call one of the DMA unmap routines | 568 | After the last DMA transfer call one of the DMA unmap routines |
574 | pci_unmap_{single,sg}. If you don't touch the data from the first pci_map_* | 569 | dma_unmap_{single,sg}. If you don't touch the data from the first dma_map_* |
575 | call till pci_unmap_*, then you don't have to call the pci_dma_sync_* | 570 | call till dma_unmap_*, then you don't have to call the dma_sync_* |
576 | routines at all. | 571 | routines at all. |
577 | 572 | ||
578 | Here is pseudo code which shows a situation in which you would need | 573 | Here is pseudo code which shows a situation in which you would need |
579 | to use the pci_dma_sync_*() interfaces. | 574 | to use the dma_sync_*() interfaces. |
580 | 575 | ||
581 | my_card_setup_receive_buffer(struct my_card *cp, char *buffer, int len) | 576 | my_card_setup_receive_buffer(struct my_card *cp, char *buffer, int len) |
582 | { | 577 | { |
583 | dma_addr_t mapping; | 578 | dma_addr_t mapping; |
584 | 579 | ||
585 | mapping = pci_map_single(cp->pdev, buffer, len, PCI_DMA_FROMDEVICE); | 580 | mapping = dma_map_single(cp->dev, buffer, len, DMA_FROM_DEVICE); |
586 | 581 | ||
587 | cp->rx_buf = buffer; | 582 | cp->rx_buf = buffer; |
588 | cp->rx_len = len; | 583 | cp->rx_len = len; |
@@ -606,25 +601,25 @@ to use the pci_dma_sync_*() interfaces. | |||
606 | * the DMA transfer with the CPU first | 601 | * the DMA transfer with the CPU first |
607 | * so that we see updated contents. | 602 | * so that we see updated contents. |
608 | */ | 603 | */ |
609 | pci_dma_sync_single_for_cpu(cp->pdev, cp->rx_dma, | 604 | dma_sync_single_for_cpu(&cp->dev, cp->rx_dma, |
610 | cp->rx_len, | 605 | cp->rx_len, |
611 | PCI_DMA_FROMDEVICE); | 606 | DMA_FROM_DEVICE); |
612 | 607 | ||
613 | /* Now it is safe to examine the buffer. */ | 608 | /* Now it is safe to examine the buffer. */ |
614 | hp = (struct my_card_header *) cp->rx_buf; | 609 | hp = (struct my_card_header *) cp->rx_buf; |
615 | if (header_is_ok(hp)) { | 610 | if (header_is_ok(hp)) { |
616 | pci_unmap_single(cp->pdev, cp->rx_dma, cp->rx_len, | 611 | dma_unmap_single(&cp->dev, cp->rx_dma, cp->rx_len, |
617 | PCI_DMA_FROMDEVICE); | 612 | DMA_FROM_DEVICE); |
618 | pass_to_upper_layers(cp->rx_buf); | 613 | pass_to_upper_layers(cp->rx_buf); |
619 | make_and_setup_new_rx_buf(cp); | 614 | make_and_setup_new_rx_buf(cp); |
620 | } else { | 615 | } else { |
621 | /* Just sync the buffer and give it back | 616 | /* Just sync the buffer and give it back |
622 | * to the card. | 617 | * to the card. |
623 | */ | 618 | */ |
624 | pci_dma_sync_single_for_device(cp->pdev, | 619 | dma_sync_single_for_device(&cp->dev, |
625 | cp->rx_dma, | 620 | cp->rx_dma, |
626 | cp->rx_len, | 621 | cp->rx_len, |
627 | PCI_DMA_FROMDEVICE); | 622 | DMA_FROM_DEVICE); |
628 | give_rx_buf_to_card(cp); | 623 | give_rx_buf_to_card(cp); |
629 | } | 624 | } |
630 | } | 625 | } |
@@ -634,19 +629,19 @@ Drivers converted fully to this interface should not use virt_to_bus any | |||
634 | longer, nor should they use bus_to_virt. Some drivers have to be changed a | 629 | longer, nor should they use bus_to_virt. Some drivers have to be changed a |
635 | little bit, because there is no longer an equivalent to bus_to_virt in the | 630 | little bit, because there is no longer an equivalent to bus_to_virt in the |
636 | dynamic DMA mapping scheme - you have to always store the DMA addresses | 631 | dynamic DMA mapping scheme - you have to always store the DMA addresses |
637 | returned by the pci_alloc_consistent, pci_pool_alloc, and pci_map_single | 632 | returned by the dma_alloc_coherent, dma_pool_alloc, and dma_map_single |
638 | calls (pci_map_sg stores them in the scatterlist itself if the platform | 633 | calls (dma_map_sg stores them in the scatterlist itself if the platform |
639 | supports dynamic DMA mapping in hardware) in your driver structures and/or | 634 | supports dynamic DMA mapping in hardware) in your driver structures and/or |
640 | in the card registers. | 635 | in the card registers. |
641 | 636 | ||
642 | All PCI drivers should be using these interfaces with no exceptions. | 637 | All drivers should be using these interfaces with no exceptions. It |
643 | It is planned to completely remove virt_to_bus() and bus_to_virt() as | 638 | is planned to completely remove virt_to_bus() and bus_to_virt() as |
644 | they are entirely deprecated. Some ports already do not provide these | 639 | they are entirely deprecated. Some ports already do not provide these |
645 | as it is impossible to correctly support them. | 640 | as it is impossible to correctly support them. |
646 | 641 | ||
647 | Optimizing Unmap State Space Consumption | 642 | Optimizing Unmap State Space Consumption |
648 | 643 | ||
649 | On many platforms, pci_unmap_{single,page}() is simply a nop. | 644 | On many platforms, dma_unmap_{single,page}() is simply a nop. |
650 | Therefore, keeping track of the mapping address and length is a waste | 645 | Therefore, keeping track of the mapping address and length is a waste |
651 | of space. Instead of filling your drivers up with ifdefs and the like | 646 | of space. Instead of filling your drivers up with ifdefs and the like |
652 | to "work around" this (which would defeat the whole purpose of a | 647 | to "work around" this (which would defeat the whole purpose of a |
@@ -655,7 +650,7 @@ portable API) the following facilities are provided. | |||
655 | Actually, instead of describing the macros one by one, we'll | 650 | Actually, instead of describing the macros one by one, we'll |
656 | transform some example code. | 651 | transform some example code. |
657 | 652 | ||
658 | 1) Use DECLARE_PCI_UNMAP_{ADDR,LEN} in state saving structures. | 653 | 1) Use DEFINE_DMA_UNMAP_{ADDR,LEN} in state saving structures. |
659 | Example, before: | 654 | Example, before: |
660 | 655 | ||
661 | struct ring_state { | 656 | struct ring_state { |
@@ -668,14 +663,11 @@ transform some example code. | |||
668 | 663 | ||
669 | struct ring_state { | 664 | struct ring_state { |
670 | struct sk_buff *skb; | 665 | struct sk_buff *skb; |
671 | DECLARE_PCI_UNMAP_ADDR(mapping) | 666 | DEFINE_DMA_UNMAP_ADDR(mapping); |
672 | DECLARE_PCI_UNMAP_LEN(len) | 667 | DEFINE_DMA_UNMAP_LEN(len); |
673 | }; | 668 | }; |
674 | 669 | ||
675 | NOTE: DO NOT put a semicolon at the end of the DECLARE_*() | 670 | 2) Use dma_unmap_{addr,len}_set to set these values. |
676 | macro. | ||
677 | |||
678 | 2) Use pci_unmap_{addr,len}_set to set these values. | ||
679 | Example, before: | 671 | Example, before: |
680 | 672 | ||
681 | ringp->mapping = FOO; | 673 | ringp->mapping = FOO; |
@@ -683,21 +675,21 @@ transform some example code. | |||
683 | 675 | ||
684 | after: | 676 | after: |
685 | 677 | ||
686 | pci_unmap_addr_set(ringp, mapping, FOO); | 678 | dma_unmap_addr_set(ringp, mapping, FOO); |
687 | pci_unmap_len_set(ringp, len, BAR); | 679 | dma_unmap_len_set(ringp, len, BAR); |
688 | 680 | ||
689 | 3) Use pci_unmap_{addr,len} to access these values. | 681 | 3) Use dma_unmap_{addr,len} to access these values. |
690 | Example, before: | 682 | Example, before: |
691 | 683 | ||
692 | pci_unmap_single(pdev, ringp->mapping, ringp->len, | 684 | dma_unmap_single(dev, ringp->mapping, ringp->len, |
693 | PCI_DMA_FROMDEVICE); | 685 | DMA_FROM_DEVICE); |
694 | 686 | ||
695 | after: | 687 | after: |
696 | 688 | ||
697 | pci_unmap_single(pdev, | 689 | dma_unmap_single(dev, |
698 | pci_unmap_addr(ringp, mapping), | 690 | dma_unmap_addr(ringp, mapping), |
699 | pci_unmap_len(ringp, len), | 691 | dma_unmap_len(ringp, len), |
700 | PCI_DMA_FROMDEVICE); | 692 | DMA_FROM_DEVICE); |
701 | 693 | ||
702 | It really should be self-explanatory. We treat the ADDR and LEN | 694 | It really should be self-explanatory. We treat the ADDR and LEN |
703 | separately, because it is possible for an implementation to only | 695 | separately, because it is possible for an implementation to only |
@@ -732,15 +724,15 @@ to "Closing". | |||
732 | DMA address space is limited on some architectures and an allocation | 724 | DMA address space is limited on some architectures and an allocation |
733 | failure can be determined by: | 725 | failure can be determined by: |
734 | 726 | ||
735 | - checking if pci_alloc_consistent returns NULL or pci_map_sg returns 0 | 727 | - checking if dma_alloc_coherent returns NULL or dma_map_sg returns 0 |
736 | 728 | ||
737 | - checking the returned dma_addr_t of pci_map_single and pci_map_page | 729 | - checking the returned dma_addr_t of dma_map_single and dma_map_page |
738 | by using pci_dma_mapping_error(): | 730 | by using dma_mapping_error(): |
739 | 731 | ||
740 | dma_addr_t dma_handle; | 732 | dma_addr_t dma_handle; |
741 | 733 | ||
742 | dma_handle = pci_map_single(pdev, addr, size, direction); | 734 | dma_handle = dma_map_single(dev, addr, size, direction); |
743 | if (pci_dma_mapping_error(pdev, dma_handle)) { | 735 | if (dma_mapping_error(dev, dma_handle)) { |
744 | /* | 736 | /* |
745 | * reduce current DMA mapping usage, | 737 | * reduce current DMA mapping usage, |
746 | * delay and try again later or | 738 | * delay and try again later or |
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt index 5aceb88b3f8b..05e2ae236865 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt | |||
@@ -4,20 +4,18 @@ | |||
4 | James E.J. Bottomley <James.Bottomley@HansenPartnership.com> | 4 | James E.J. Bottomley <James.Bottomley@HansenPartnership.com> |
5 | 5 | ||
6 | This document describes the DMA API. For a more gentle introduction | 6 | This document describes the DMA API. For a more gentle introduction |
7 | phrased in terms of the pci_ equivalents (and actual examples) see | 7 | of the API (and actual examples) see |
8 | Documentation/PCI/PCI-DMA-mapping.txt. | 8 | Documentation/DMA-API-HOWTO.txt. |
9 | 9 | ||
10 | This API is split into two pieces. Part I describes the API and the | 10 | This API is split into two pieces. Part I describes the API. Part II |
11 | corresponding pci_ API. Part II describes the extensions to the API | 11 | describes the extensions to the API for supporting non-consistent |
12 | for supporting non-consistent memory machines. Unless you know that | 12 | memory machines. Unless you know that your driver absolutely has to |
13 | your driver absolutely has to support non-consistent platforms (this | 13 | support non-consistent platforms (this is usually only legacy |
14 | is usually only legacy platforms) you should only use the API | 14 | platforms) you should only use the API described in part I. |
15 | described in part I. | ||
16 | 15 | ||
17 | Part I - pci_ and dma_ Equivalent API | 16 | Part I - dma_ API |
18 | ------------------------------------- | 17 | ------------------------------------- |
19 | 18 | ||
20 | To get the pci_ API, you must #include <linux/pci.h> | ||
21 | To get the dma_ API, you must #include <linux/dma-mapping.h> | 19 | To get the dma_ API, you must #include <linux/dma-mapping.h> |
22 | 20 | ||
23 | 21 | ||
@@ -27,9 +25,6 @@ Part Ia - Using large dma-coherent buffers | |||
27 | void * | 25 | void * |
28 | dma_alloc_coherent(struct device *dev, size_t size, | 26 | dma_alloc_coherent(struct device *dev, size_t size, |
29 | dma_addr_t *dma_handle, gfp_t flag) | 27 | dma_addr_t *dma_handle, gfp_t flag) |
30 | void * | ||
31 | pci_alloc_consistent(struct pci_dev *dev, size_t size, | ||
32 | dma_addr_t *dma_handle) | ||
33 | 28 | ||
34 | Consistent memory is memory for which a write by either the device or | 29 | Consistent memory is memory for which a write by either the device or |
35 | the processor can immediately be read by the processor or device | 30 | the processor can immediately be read by the processor or device |
@@ -53,15 +48,11 @@ The simplest way to do that is to use the dma_pool calls (see below). | |||
53 | The flag parameter (dma_alloc_coherent only) allows the caller to | 48 | The flag parameter (dma_alloc_coherent only) allows the caller to |
54 | specify the GFP_ flags (see kmalloc) for the allocation (the | 49 | specify the GFP_ flags (see kmalloc) for the allocation (the |
55 | implementation may choose to ignore flags that affect the location of | 50 | implementation may choose to ignore flags that affect the location of |
56 | the returned memory, like GFP_DMA). For pci_alloc_consistent, you | 51 | the returned memory, like GFP_DMA). |
57 | must assume GFP_ATOMIC behaviour. | ||
58 | 52 | ||
59 | void | 53 | void |
60 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | 54 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, |
61 | dma_addr_t dma_handle) | 55 | dma_addr_t dma_handle) |
62 | void | ||
63 | pci_free_consistent(struct pci_dev *dev, size_t size, void *cpu_addr, | ||
64 | dma_addr_t dma_handle) | ||
65 | 56 | ||
66 | Free the region of consistent memory you previously allocated. dev, | 57 | Free the region of consistent memory you previously allocated. dev, |
67 | size and dma_handle must all be the same as those passed into the | 58 | size and dma_handle must all be the same as those passed into the |
@@ -89,10 +80,6 @@ for alignment, like queue heads needing to be aligned on N-byte boundaries. | |||
89 | dma_pool_create(const char *name, struct device *dev, | 80 | dma_pool_create(const char *name, struct device *dev, |
90 | size_t size, size_t align, size_t alloc); | 81 | size_t size, size_t align, size_t alloc); |
91 | 82 | ||
92 | struct pci_pool * | ||
93 | pci_pool_create(const char *name, struct pci_device *dev, | ||
94 | size_t size, size_t align, size_t alloc); | ||
95 | |||
96 | The pool create() routines initialize a pool of dma-coherent buffers | 83 | The pool create() routines initialize a pool of dma-coherent buffers |
97 | for use with a given device. It must be called in a context which | 84 | for use with a given device. It must be called in a context which |
98 | can sleep. | 85 | can sleep. |
@@ -108,9 +95,6 @@ from this pool must not cross 4KByte boundaries. | |||
108 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags, | 95 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags, |
109 | dma_addr_t *dma_handle); | 96 | dma_addr_t *dma_handle); |
110 | 97 | ||
111 | void *pci_pool_alloc(struct pci_pool *pool, gfp_t gfp_flags, | ||
112 | dma_addr_t *dma_handle); | ||
113 | |||
114 | This allocates memory from the pool; the returned memory will meet the size | 98 | This allocates memory from the pool; the returned memory will meet the size |
115 | and alignment requirements specified at creation time. Pass GFP_ATOMIC to | 99 | and alignment requirements specified at creation time. Pass GFP_ATOMIC to |
116 | prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks), | 100 | prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks), |
@@ -122,9 +106,6 @@ pool's device. | |||
122 | void dma_pool_free(struct dma_pool *pool, void *vaddr, | 106 | void dma_pool_free(struct dma_pool *pool, void *vaddr, |
123 | dma_addr_t addr); | 107 | dma_addr_t addr); |
124 | 108 | ||
125 | void pci_pool_free(struct pci_pool *pool, void *vaddr, | ||
126 | dma_addr_t addr); | ||
127 | |||
128 | This puts memory back into the pool. The pool is what was passed to | 109 | This puts memory back into the pool. The pool is what was passed to |
129 | the pool allocation routine; the cpu (vaddr) and dma addresses are what | 110 | the pool allocation routine; the cpu (vaddr) and dma addresses are what |
130 | were returned when that routine allocated the memory being freed. | 111 | were returned when that routine allocated the memory being freed. |
@@ -132,8 +113,6 @@ were returned when that routine allocated the memory being freed. | |||
132 | 113 | ||
133 | void dma_pool_destroy(struct dma_pool *pool); | 114 | void dma_pool_destroy(struct dma_pool *pool); |
134 | 115 | ||
135 | void pci_pool_destroy(struct pci_pool *pool); | ||
136 | |||
137 | The pool destroy() routines free the resources of the pool. They must be | 116 | The pool destroy() routines free the resources of the pool. They must be |
138 | called in a context which can sleep. Make sure you've freed all allocated | 117 | called in a context which can sleep. Make sure you've freed all allocated |
139 | memory back to the pool before you destroy it. | 118 | memory back to the pool before you destroy it. |
@@ -144,8 +123,6 @@ Part Ic - DMA addressing limitations | |||
144 | 123 | ||
145 | int | 124 | int |
146 | dma_supported(struct device *dev, u64 mask) | 125 | dma_supported(struct device *dev, u64 mask) |
147 | int | ||
148 | pci_dma_supported(struct pci_dev *hwdev, u64 mask) | ||
149 | 126 | ||
150 | Checks to see if the device can support DMA to the memory described by | 127 | Checks to see if the device can support DMA to the memory described by |
151 | mask. | 128 | mask. |
@@ -159,8 +136,14 @@ driver writers. | |||
159 | 136 | ||
160 | int | 137 | int |
161 | dma_set_mask(struct device *dev, u64 mask) | 138 | dma_set_mask(struct device *dev, u64 mask) |
139 | |||
140 | Checks to see if the mask is possible and updates the device | ||
141 | parameters if it is. | ||
142 | |||
143 | Returns: 0 if successful and a negative error if not. | ||
144 | |||
162 | int | 145 | int |
163 | pci_set_dma_mask(struct pci_device *dev, u64 mask) | 146 | dma_set_coherent_mask(struct device *dev, u64 mask) |
164 | 147 | ||
165 | Checks to see if the mask is possible and updates the device | 148 | Checks to see if the mask is possible and updates the device |
166 | parameters if it is. | 149 | parameters if it is. |
@@ -187,9 +170,6 @@ Part Id - Streaming DMA mappings | |||
187 | dma_addr_t | 170 | dma_addr_t |
188 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, | 171 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, |
189 | enum dma_data_direction direction) | 172 | enum dma_data_direction direction) |
190 | dma_addr_t | ||
191 | pci_map_single(struct pci_dev *hwdev, void *cpu_addr, size_t size, | ||
192 | int direction) | ||
193 | 173 | ||
194 | Maps a piece of processor virtual memory so it can be accessed by the | 174 | Maps a piece of processor virtual memory so it can be accessed by the |
195 | device and returns the physical handle of the memory. | 175 | device and returns the physical handle of the memory. |
@@ -198,14 +178,10 @@ The direction for both api's may be converted freely by casting. | |||
198 | However the dma_ API uses a strongly typed enumerator for its | 178 | However the dma_ API uses a strongly typed enumerator for its |
199 | direction: | 179 | direction: |
200 | 180 | ||
201 | DMA_NONE = PCI_DMA_NONE no direction (used for | 181 | DMA_NONE no direction (used for debugging) |
202 | debugging) | 182 | DMA_TO_DEVICE data is going from the memory to the device |
203 | DMA_TO_DEVICE = PCI_DMA_TODEVICE data is going from the | 183 | DMA_FROM_DEVICE data is coming from the device to the memory |
204 | memory to the device | 184 | DMA_BIDIRECTIONAL direction isn't known |
205 | DMA_FROM_DEVICE = PCI_DMA_FROMDEVICE data is coming from | ||
206 | the device to the | ||
207 | memory | ||
208 | DMA_BIDIRECTIONAL = PCI_DMA_BIDIRECTIONAL direction isn't known | ||
209 | 185 | ||
210 | Notes: Not all memory regions in a machine can be mapped by this | 186 | Notes: Not all memory regions in a machine can be mapped by this |
211 | API. Further, regions that appear to be physically contiguous in | 187 | API. Further, regions that appear to be physically contiguous in |
@@ -268,9 +244,6 @@ cache lines are updated with data that the device may have changed). | |||
268 | void | 244 | void |
269 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | 245 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, |
270 | enum dma_data_direction direction) | 246 | enum dma_data_direction direction) |
271 | void | ||
272 | pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, | ||
273 | size_t size, int direction) | ||
274 | 247 | ||
275 | Unmaps the region previously mapped. All the parameters passed in | 248 | Unmaps the region previously mapped. All the parameters passed in |
276 | must be identical to those passed in (and returned) by the mapping | 249 | must be identical to those passed in (and returned) by the mapping |
@@ -280,15 +253,9 @@ dma_addr_t | |||
280 | dma_map_page(struct device *dev, struct page *page, | 253 | dma_map_page(struct device *dev, struct page *page, |
281 | unsigned long offset, size_t size, | 254 | unsigned long offset, size_t size, |
282 | enum dma_data_direction direction) | 255 | enum dma_data_direction direction) |
283 | dma_addr_t | ||
284 | pci_map_page(struct pci_dev *hwdev, struct page *page, | ||
285 | unsigned long offset, size_t size, int direction) | ||
286 | void | 256 | void |
287 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, | 257 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, |
288 | enum dma_data_direction direction) | 258 | enum dma_data_direction direction) |
289 | void | ||
290 | pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, | ||
291 | size_t size, int direction) | ||
292 | 259 | ||
293 | API for mapping and unmapping for pages. All the notes and warnings | 260 | API for mapping and unmapping for pages. All the notes and warnings |
294 | for the other mapping APIs apply here. Also, although the <offset> | 261 | for the other mapping APIs apply here. Also, although the <offset> |
@@ -299,9 +266,6 @@ cache width is. | |||
299 | int | 266 | int |
300 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 267 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
301 | 268 | ||
302 | int | ||
303 | pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr) | ||
304 | |||
305 | In some circumstances dma_map_single and dma_map_page will fail to create | 269 | In some circumstances dma_map_single and dma_map_page will fail to create |
306 | a mapping. A driver can check for these errors by testing the returned | 270 | a mapping. A driver can check for these errors by testing the returned |
307 | dma address with dma_mapping_error(). A non-zero return value means the mapping | 271 | dma address with dma_mapping_error(). A non-zero return value means the mapping |
@@ -311,9 +275,6 @@ reduce current DMA mapping usage or delay and try again later). | |||
311 | int | 275 | int |
312 | dma_map_sg(struct device *dev, struct scatterlist *sg, | 276 | dma_map_sg(struct device *dev, struct scatterlist *sg, |
313 | int nents, enum dma_data_direction direction) | 277 | int nents, enum dma_data_direction direction) |
314 | int | ||
315 | pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, | ||
316 | int nents, int direction) | ||
317 | 278 | ||
318 | Returns: the number of physical segments mapped (this may be shorter | 279 | Returns: the number of physical segments mapped (this may be shorter |
319 | than <nents> passed in if some elements of the scatter/gather list are | 280 | than <nents> passed in if some elements of the scatter/gather list are |
@@ -353,9 +314,6 @@ accessed sg->address and sg->length as shown above. | |||
353 | void | 314 | void |
354 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, | 315 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, |
355 | int nhwentries, enum dma_data_direction direction) | 316 | int nhwentries, enum dma_data_direction direction) |
356 | void | ||
357 | pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, | ||
358 | int nents, int direction) | ||
359 | 317 | ||
360 | Unmap the previously mapped scatter/gather list. All the parameters | 318 | Unmap the previously mapped scatter/gather list. All the parameters |
361 | must be the same as those and passed in to the scatter/gather mapping | 319 | must be the same as those and passed in to the scatter/gather mapping |
@@ -365,21 +323,23 @@ Note: <nents> must be the number you passed in, *not* the number of | |||
365 | physical entries returned. | 323 | physical entries returned. |
366 | 324 | ||
367 | void | 325 | void |
368 | dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, | 326 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, |
369 | enum dma_data_direction direction) | 327 | enum dma_data_direction direction) |
370 | void | 328 | void |
371 | pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, | 329 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, |
372 | size_t size, int direction) | 330 | enum dma_data_direction direction) |
373 | void | 331 | void |
374 | dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, | 332 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, |
375 | enum dma_data_direction direction) | 333 | enum dma_data_direction direction) |
376 | void | 334 | void |
377 | pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, | 335 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, |
378 | int nelems, int direction) | 336 | enum dma_data_direction direction) |
379 | 337 | ||
380 | Synchronise a single contiguous or scatter/gather mapping. All the | 338 | Synchronise a single contiguous or scatter/gather mapping for the cpu |
381 | parameters must be the same as those passed into the single mapping | 339 | and device. With the sync_sg API, all the parameters must be the same |
382 | API. | 340 | as those passed into the single mapping API. With the sync_single API, |
341 | you can use dma_handle and size parameters that aren't identical to | ||
342 | those passed into the single mapping API to do a partial sync. | ||
383 | 343 | ||
384 | Notes: You must do this: | 344 | Notes: You must do this: |
385 | 345 | ||
@@ -461,9 +421,9 @@ void whizco_dma_map_sg_attrs(struct device *dev, dma_addr_t dma_addr, | |||
461 | Part II - Advanced dma_ usage | 421 | Part II - Advanced dma_ usage |
462 | ----------------------------- | 422 | ----------------------------- |
463 | 423 | ||
464 | Warning: These pieces of the DMA API have no PCI equivalent. They | 424 | Warning: These pieces of the DMA API should not be used in the |
465 | should also not be used in the majority of cases, since they cater for | 425 | majority of cases, since they cater for unlikely corner cases that |
466 | unlikely corner cases that don't belong in usual drivers. | 426 | don't belong in usual drivers. |
467 | 427 | ||
468 | If you don't understand how cache line coherency works between a | 428 | If you don't understand how cache line coherency works between a |
469 | processor and an I/O device, you should not be using this part of the | 429 | processor and an I/O device, you should not be using this part of the |
@@ -514,16 +474,6 @@ into the width returned by this call. It will also always be a power | |||
514 | of two for easy alignment. | 474 | of two for easy alignment. |
515 | 475 | ||
516 | void | 476 | void |
517 | dma_sync_single_range(struct device *dev, dma_addr_t dma_handle, | ||
518 | unsigned long offset, size_t size, | ||
519 | enum dma_data_direction direction) | ||
520 | |||
521 | Does a partial sync, starting at offset and continuing for size. You | ||
522 | must be careful to observe the cache alignment and width when doing | ||
523 | anything like this. You must also be extra careful about accessing | ||
524 | memory you intend to sync partially. | ||
525 | |||
526 | void | ||
527 | dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 477 | dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
528 | enum dma_data_direction direction) | 478 | enum dma_data_direction direction) |
529 | 479 | ||
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl index 5e7d84b48505..133cd6c3f3c1 100644 --- a/Documentation/DocBook/mtdnand.tmpl +++ b/Documentation/DocBook/mtdnand.tmpl | |||
@@ -488,7 +488,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
488 | The ECC bytes must be placed immidiately after the data | 488 | The ECC bytes must be placed immidiately after the data |
489 | bytes in order to make the syndrome generator work. This | 489 | bytes in order to make the syndrome generator work. This |
490 | is contrary to the usual layout used by software ECC. The | 490 | is contrary to the usual layout used by software ECC. The |
491 | seperation of data and out of band area is not longer | 491 | separation of data and out of band area is not longer |
492 | possible. The nand driver code handles this layout and | 492 | possible. The nand driver code handles this layout and |
493 | the remaining free bytes in the oob area are managed by | 493 | the remaining free bytes in the oob area are managed by |
494 | the autoplacement code. Provide a matching oob-layout | 494 | the autoplacement code. Provide a matching oob-layout |
@@ -560,7 +560,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
560 | bad blocks. They have factory marked good blocks. The marker pattern | 560 | bad blocks. They have factory marked good blocks. The marker pattern |
561 | is erased when the block is erased to be reused. So in case of | 561 | is erased when the block is erased to be reused. So in case of |
562 | powerloss before writing the pattern back to the chip this block | 562 | powerloss before writing the pattern back to the chip this block |
563 | would be lost and added to the bad blocks. Therefor we scan the | 563 | would be lost and added to the bad blocks. Therefore we scan the |
564 | chip(s) when we detect them the first time for good blocks and | 564 | chip(s) when we detect them the first time for good blocks and |
565 | store this information in a bad block table before erasing any | 565 | store this information in a bad block table before erasing any |
566 | of the blocks. | 566 | of the blocks. |
@@ -1094,7 +1094,7 @@ in this page</entry> | |||
1094 | manufacturers specifications. This applies similar to the spare area. | 1094 | manufacturers specifications. This applies similar to the spare area. |
1095 | </para> | 1095 | </para> |
1096 | <para> | 1096 | <para> |
1097 | Therefor NAND aware filesystems must either write in page size chunks | 1097 | Therefore NAND aware filesystems must either write in page size chunks |
1098 | or hold a writebuffer to collect smaller writes until they sum up to | 1098 | or hold a writebuffer to collect smaller writes until they sum up to |
1099 | pagesize. Available NAND aware filesystems: JFFS2, YAFFS. | 1099 | pagesize. Available NAND aware filesystems: JFFS2, YAFFS. |
1100 | </para> | 1100 | </para> |
diff --git a/Documentation/DocBook/v4l/common.xml b/Documentation/DocBook/v4l/common.xml index c65f0ac9b6ee..cea23e1c4fc6 100644 --- a/Documentation/DocBook/v4l/common.xml +++ b/Documentation/DocBook/v4l/common.xml | |||
@@ -1170,7 +1170,7 @@ frames per second. If less than this number of frames is to be | |||
1170 | captured or output, applications can request frame skipping or | 1170 | captured or output, applications can request frame skipping or |
1171 | duplicating on the driver side. This is especially useful when using | 1171 | duplicating on the driver side. This is especially useful when using |
1172 | the &func-read; or &func-write;, which are not augmented by timestamps | 1172 | the &func-read; or &func-write;, which are not augmented by timestamps |
1173 | or sequence counters, and to avoid unneccessary data copying.</para> | 1173 | or sequence counters, and to avoid unnecessary data copying.</para> |
1174 | 1174 | ||
1175 | <para>Finally these ioctls can be used to determine the number of | 1175 | <para>Finally these ioctls can be used to determine the number of |
1176 | buffers used internally by a driver in read/write mode. For | 1176 | buffers used internally by a driver in read/write mode. For |
diff --git a/Documentation/DocBook/v4l/vidioc-g-parm.xml b/Documentation/DocBook/v4l/vidioc-g-parm.xml index 78332d365ce9..392aa9e5571e 100644 --- a/Documentation/DocBook/v4l/vidioc-g-parm.xml +++ b/Documentation/DocBook/v4l/vidioc-g-parm.xml | |||
@@ -55,7 +55,7 @@ captured or output, applications can request frame skipping or | |||
55 | duplicating on the driver side. This is especially useful when using | 55 | duplicating on the driver side. This is especially useful when using |
56 | the <function>read()</function> or <function>write()</function>, which | 56 | the <function>read()</function> or <function>write()</function>, which |
57 | are not augmented by timestamps or sequence counters, and to avoid | 57 | are not augmented by timestamps or sequence counters, and to avoid |
58 | unneccessary data copying.</para> | 58 | unnecessary data copying.</para> |
59 | 59 | ||
60 | <para>Further these ioctls can be used to determine the number of | 60 | <para>Further these ioctls can be used to determine the number of |
61 | buffers used internally by a driver in read/write mode. For | 61 | buffers used internally by a driver in read/write mode. For |
diff --git a/Documentation/HOWTO b/Documentation/HOWTO index 8495fc970391..f5395af88a41 100644 --- a/Documentation/HOWTO +++ b/Documentation/HOWTO | |||
@@ -221,8 +221,8 @@ branches. These different branches are: | |||
221 | - main 2.6.x kernel tree | 221 | - main 2.6.x kernel tree |
222 | - 2.6.x.y -stable kernel tree | 222 | - 2.6.x.y -stable kernel tree |
223 | - 2.6.x -git kernel patches | 223 | - 2.6.x -git kernel patches |
224 | - 2.6.x -mm kernel patches | ||
225 | - subsystem specific kernel trees and patches | 224 | - subsystem specific kernel trees and patches |
225 | - the 2.6.x -next kernel tree for integration tests | ||
226 | 226 | ||
227 | 2.6.x kernel tree | 227 | 2.6.x kernel tree |
228 | ----------------- | 228 | ----------------- |
@@ -232,7 +232,7 @@ process is as follows: | |||
232 | - As soon as a new kernel is released a two weeks window is open, | 232 | - As soon as a new kernel is released a two weeks window is open, |
233 | during this period of time maintainers can submit big diffs to | 233 | during this period of time maintainers can submit big diffs to |
234 | Linus, usually the patches that have already been included in the | 234 | Linus, usually the patches that have already been included in the |
235 | -mm kernel for a few weeks. The preferred way to submit big changes | 235 | -next kernel for a few weeks. The preferred way to submit big changes |
236 | is using git (the kernel's source management tool, more information | 236 | is using git (the kernel's source management tool, more information |
237 | can be found at http://git.or.cz/) but plain patches are also just | 237 | can be found at http://git.or.cz/) but plain patches are also just |
238 | fine. | 238 | fine. |
@@ -293,84 +293,43 @@ daily and represent the current state of Linus' tree. They are more | |||
293 | experimental than -rc kernels since they are generated automatically | 293 | experimental than -rc kernels since they are generated automatically |
294 | without even a cursory glance to see if they are sane. | 294 | without even a cursory glance to see if they are sane. |
295 | 295 | ||
296 | 2.6.x -mm kernel patches | ||
297 | ------------------------ | ||
298 | These are experimental kernel patches released by Andrew Morton. Andrew | ||
299 | takes all of the different subsystem kernel trees and patches and mushes | ||
300 | them together, along with a lot of patches that have been plucked from | ||
301 | the linux-kernel mailing list. This tree serves as a proving ground for | ||
302 | new features and patches. Once a patch has proved its worth in -mm for | ||
303 | a while Andrew or the subsystem maintainer pushes it on to Linus for | ||
304 | inclusion in mainline. | ||
305 | |||
306 | It is heavily encouraged that all new patches get tested in the -mm tree | ||
307 | before they are sent to Linus for inclusion in the main kernel tree. Code | ||
308 | which does not make an appearance in -mm before the opening of the merge | ||
309 | window will prove hard to merge into the mainline. | ||
310 | |||
311 | These kernels are not appropriate for use on systems that are supposed | ||
312 | to be stable and they are more risky to run than any of the other | ||
313 | branches. | ||
314 | |||
315 | If you wish to help out with the kernel development process, please test | ||
316 | and use these kernel releases and provide feedback to the linux-kernel | ||
317 | mailing list if you have any problems, and if everything works properly. | ||
318 | |||
319 | In addition to all the other experimental patches, these kernels usually | ||
320 | also contain any changes in the mainline -git kernels available at the | ||
321 | time of release. | ||
322 | |||
323 | The -mm kernels are not released on a fixed schedule, but usually a few | ||
324 | -mm kernels are released in between each -rc kernel (1 to 3 is common). | ||
325 | |||
326 | Subsystem Specific kernel trees and patches | 296 | Subsystem Specific kernel trees and patches |
327 | ------------------------------------------- | 297 | ------------------------------------------- |
328 | A number of the different kernel subsystem developers expose their | 298 | The maintainers of the various kernel subsystems --- and also many |
329 | development trees so that others can see what is happening in the | 299 | kernel subsystem developers --- expose their current state of |
330 | different areas of the kernel. These trees are pulled into the -mm | 300 | development in source repositories. That way, others can see what is |
331 | kernel releases as described above. | 301 | happening in the different areas of the kernel. In areas where |
332 | 302 | development is rapid, a developer may be asked to base his submissions | |
333 | Here is a list of some of the different kernel trees available: | 303 | onto such a subsystem kernel tree so that conflicts between the |
334 | git trees: | 304 | submission and other already ongoing work are avoided. |
335 | - Kbuild development tree, Sam Ravnborg <sam@ravnborg.org> | 305 | |
336 | git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git | 306 | Most of these repositories are git trees, but there are also other SCMs |
337 | 307 | in use, or patch queues being published as quilt series. Addresses of | |
338 | - ACPI development tree, Len Brown <len.brown@intel.com> | 308 | these subsystem repositories are listed in the MAINTAINERS file. Many |
339 | git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git | 309 | of them can be browsed at http://git.kernel.org/. |
340 | 310 | ||
341 | - Block development tree, Jens Axboe <jens.axboe@oracle.com> | 311 | Before a proposed patch is committed to such a subsystem tree, it is |
342 | git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git | 312 | subject to review which primarily happens on mailing lists (see the |
343 | 313 | respective section below). For several kernel subsystems, this review | |
344 | - DRM development tree, Dave Airlie <airlied@linux.ie> | 314 | process is tracked with the tool patchwork. Patchwork offers a web |
345 | git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git | 315 | interface which shows patch postings, any comments on a patch or |
346 | 316 | revisions to it, and maintainers can mark patches as under review, | |
347 | - ia64 development tree, Tony Luck <tony.luck@intel.com> | 317 | accepted, or rejected. Most of these patchwork sites are listed at |
348 | git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git | 318 | http://patchwork.kernel.org/ or http://patchwork.ozlabs.org/. |
349 | 319 | ||
350 | - infiniband, Roland Dreier <rolandd@cisco.com> | 320 | 2.6.x -next kernel tree for integration tests |
351 | git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git | 321 | --------------------------------------------- |
352 | 322 | Before updates from subsystem trees are merged into the mainline 2.6.x | |
353 | - libata, Jeff Garzik <jgarzik@pobox.com> | 323 | tree, they need to be integration-tested. For this purpose, a special |
354 | git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git | 324 | testing repository exists into which virtually all subsystem trees are |
355 | 325 | pulled on an almost daily basis: | |
356 | - network drivers, Jeff Garzik <jgarzik@pobox.com> | 326 | http://git.kernel.org/?p=linux/kernel/git/sfr/linux-next.git |
357 | git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git | 327 | http://linux.f-seidel.de/linux-next/pmwiki/ |
358 | 328 | ||
359 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> | 329 | This way, the -next kernel gives a summary outlook onto what will be |
360 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git | 330 | expected to go into the mainline kernel at the next merge period. |
361 | 331 | Adventurous testers are very welcome to runtime-test the -next kernel. | |
362 | - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com> | ||
363 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git | ||
364 | |||
365 | - x86, Ingo Molnar <mingo@elte.hu> | ||
366 | git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git | ||
367 | |||
368 | quilt trees: | ||
369 | - USB, Driver Core, and I2C, Greg Kroah-Hartman <gregkh@suse.de> | ||
370 | kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | ||
371 | 332 | ||
372 | Other kernel trees can be found listed at http://git.kernel.org/ and in | ||
373 | the MAINTAINERS file. | ||
374 | 333 | ||
375 | Bug Reporting | 334 | Bug Reporting |
376 | ------------- | 335 | ------------- |
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt index bc38283379f0..69dd29ed824e 100644 --- a/Documentation/IPMI.txt +++ b/Documentation/IPMI.txt | |||
@@ -365,6 +365,7 @@ You can change this at module load time (for a module) with: | |||
365 | regshifts=<shift1>,<shift2>,... | 365 | regshifts=<shift1>,<shift2>,... |
366 | slave_addrs=<addr1>,<addr2>,... | 366 | slave_addrs=<addr1>,<addr2>,... |
367 | force_kipmid=<enable1>,<enable2>,... | 367 | force_kipmid=<enable1>,<enable2>,... |
368 | kipmid_max_busy_us=<ustime1>,<ustime2>,... | ||
368 | unload_when_empty=[0|1] | 369 | unload_when_empty=[0|1] |
369 | 370 | ||
370 | Each of these except si_trydefaults is a list, the first item for the | 371 | Each of these except si_trydefaults is a list, the first item for the |
@@ -433,6 +434,7 @@ kernel command line as: | |||
433 | ipmi_si.regshifts=<shift1>,<shift2>,... | 434 | ipmi_si.regshifts=<shift1>,<shift2>,... |
434 | ipmi_si.slave_addrs=<addr1>,<addr2>,... | 435 | ipmi_si.slave_addrs=<addr1>,<addr2>,... |
435 | ipmi_si.force_kipmid=<enable1>,<enable2>,... | 436 | ipmi_si.force_kipmid=<enable1>,<enable2>,... |
437 | ipmi_si.kipmid_max_busy_us=<ustime1>,<ustime2>,... | ||
436 | 438 | ||
437 | It works the same as the module parameters of the same names. | 439 | It works the same as the module parameters of the same names. |
438 | 440 | ||
@@ -450,6 +452,16 @@ force this thread on or off. If you force it off and don't have | |||
450 | interrupts, the driver will run VERY slowly. Don't blame me, | 452 | interrupts, the driver will run VERY slowly. Don't blame me, |
451 | these interfaces suck. | 453 | these interfaces suck. |
452 | 454 | ||
455 | Unfortunately, this thread can use a lot of CPU depending on the | ||
456 | interface's performance. This can waste a lot of CPU and cause | ||
457 | various issues with detecting idle CPU and using extra power. To | ||
458 | avoid this, the kipmid_max_busy_us sets the maximum amount of time, in | ||
459 | microseconds, that kipmid will spin before sleeping for a tick. This | ||
460 | value sets a balance between performance and CPU waste and needs to be | ||
461 | tuned to your needs. Maybe, someday, auto-tuning will be added, but | ||
462 | that's not a simple thing and even the auto-tuning would need to be | ||
463 | tuned to the user's desired performance. | ||
464 | |||
453 | The driver supports a hot add and remove of interfaces. This way, | 465 | The driver supports a hot add and remove of interfaces. This way, |
454 | interfaces can be added or removed after the kernel is up and running. | 466 | interfaces can be added or removed after the kernel is up and running. |
455 | This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a | 467 | This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a |
diff --git a/Documentation/Makefile b/Documentation/Makefile index 94b945733534..6fc7ea1d1f9d 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile | |||
@@ -1,3 +1,3 @@ | |||
1 | obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ | 1 | obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ |
2 | filesystems/configfs/ ia64/ networking/ \ | 2 | filesystems/ filesystems/configfs/ ia64/ laptops/ networking/ \ |
3 | pcmcia/ spi/ video4linux/ vm/ watchdog/src/ | 3 | pcmcia/ spi/ timers/ video4linux/ vm/ watchdog/src/ |
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist index 1053a56be3b1..8916ca48bc95 100644 --- a/Documentation/SubmitChecklist +++ b/Documentation/SubmitChecklist | |||
@@ -9,10 +9,14 @@ Documentation/SubmittingPatches and elsewhere regarding submitting Linux | |||
9 | kernel patches. | 9 | kernel patches. |
10 | 10 | ||
11 | 11 | ||
12 | 1: Builds cleanly with applicable or modified CONFIG options =y, =m, and | 12 | 1: If you use a facility then #include the file that defines/declares |
13 | that facility. Don't depend on other header files pulling in ones | ||
14 | that you use. | ||
15 | |||
16 | 2: Builds cleanly with applicable or modified CONFIG options =y, =m, and | ||
13 | =n. No gcc warnings/errors, no linker warnings/errors. | 17 | =n. No gcc warnings/errors, no linker warnings/errors. |
14 | 18 | ||
15 | 2: Passes allnoconfig, allmodconfig | 19 | 2b: Passes allnoconfig, allmodconfig |
16 | 20 | ||
17 | 3: Builds on multiple CPU architectures by using local cross-compile tools | 21 | 3: Builds on multiple CPU architectures by using local cross-compile tools |
18 | or some other build farm. | 22 | or some other build farm. |
diff --git a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt index 76b3a11e90be..fa968aa99d67 100644 --- a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt +++ b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt | |||
@@ -14,8 +14,8 @@ Introduction | |||
14 | how the clocks are arranged. The first implementation used as single | 14 | how the clocks are arranged. The first implementation used as single |
15 | PLL to feed the ARM, memory and peripherals via a series of dividers | 15 | PLL to feed the ARM, memory and peripherals via a series of dividers |
16 | and muxes and this is the implementation that is documented here. A | 16 | and muxes and this is the implementation that is documented here. A |
17 | newer version where there is a seperate PLL and clock divider for the | 17 | newer version where there is a separate PLL and clock divider for the |
18 | ARM core is available as a seperate driver. | 18 | ARM core is available as a separate driver. |
19 | 19 | ||
20 | 20 | ||
21 | Layout | 21 | Layout |
diff --git a/Documentation/arm/Samsung/Overview.txt b/Documentation/arm/Samsung/Overview.txt new file mode 100644 index 000000000000..7cced1fea9c3 --- /dev/null +++ b/Documentation/arm/Samsung/Overview.txt | |||
@@ -0,0 +1,86 @@ | |||
1 | Samsung ARM Linux Overview | ||
2 | ========================== | ||
3 | |||
4 | Introduction | ||
5 | ------------ | ||
6 | |||
7 | The Samsung range of ARM SoCs spans many similar devices, from the initial | ||
8 | ARM9 through to the newest ARM cores. This document shows an overview of | ||
9 | the current kernel support, how to use it and where to find the code | ||
10 | that supports this. | ||
11 | |||
12 | The currently supported SoCs are: | ||
13 | |||
14 | - S3C24XX: See Documentation/arm/Samsung-S3C24XX/Overview.txt for full list | ||
15 | - S3C64XX: S3C6400 and S3C6410 | ||
16 | - S5PC6440 | ||
17 | |||
18 | S5PC100 and S5PC110 support is currently being merged | ||
19 | |||
20 | |||
21 | S3C24XX Systems | ||
22 | --------------- | ||
23 | |||
24 | There is still documentation in Documnetation/arm/Samsung-S3C24XX/ which | ||
25 | deals with the architecture and drivers specific to these devices. | ||
26 | |||
27 | See Documentation/arm/Samsung-S3C24XX/Overview.txt for more information | ||
28 | on the implementation details and specific support. | ||
29 | |||
30 | |||
31 | Configuration | ||
32 | ------------- | ||
33 | |||
34 | A number of configurations are supplied, as there is no current way of | ||
35 | unifying all the SoCs into one kernel. | ||
36 | |||
37 | s5p6440_defconfig - S5P6440 specific default configuration | ||
38 | s5pc100_defconfig - S5PC100 specific default configuration | ||
39 | |||
40 | |||
41 | Layout | ||
42 | ------ | ||
43 | |||
44 | The directory layout is currently being restructured, and consists of | ||
45 | several platform directories and then the machine specific directories | ||
46 | of the CPUs being built for. | ||
47 | |||
48 | plat-samsung provides the base for all the implementations, and is the | ||
49 | last in the line of include directories that are processed for the build | ||
50 | specific information. It contains the base clock, GPIO and device definitions | ||
51 | to get the system running. | ||
52 | |||
53 | plat-s3c is the s3c24xx/s3c64xx platform directory, although it is currently | ||
54 | involved in other builds this will be phased out once the relevant code is | ||
55 | moved elsewhere. | ||
56 | |||
57 | plat-s3c24xx is for s3c24xx specific builds, see the S3C24XX docs. | ||
58 | |||
59 | plat-s3c64xx is for the s3c64xx specific bits, see the S3C24XX docs. | ||
60 | |||
61 | plat-s5p is for s5p specific builds, more to be added. | ||
62 | |||
63 | |||
64 | [ to finish ] | ||
65 | |||
66 | |||
67 | Port Contributors | ||
68 | ----------------- | ||
69 | |||
70 | Ben Dooks (BJD) | ||
71 | Vincent Sanders | ||
72 | Herbert Potzl | ||
73 | Arnaud Patard (RTP) | ||
74 | Roc Wu | ||
75 | Klaus Fetscher | ||
76 | Dimitry Andric | ||
77 | Shannon Holland | ||
78 | Guillaume Gourat (NexVision) | ||
79 | Christer Weinigel (wingel) (Acer N30) | ||
80 | Lucas Correia Villa Real (S3C2400 port) | ||
81 | |||
82 | |||
83 | Document Author | ||
84 | --------------- | ||
85 | |||
86 | Copyright 2009-2010 Ben Dooks <ben-linux@fluff.org> | ||
diff --git a/Documentation/arm/Samsung/clksrc-change-registers.awk b/Documentation/arm/Samsung/clksrc-change-registers.awk new file mode 100755 index 000000000000..0c50220851fb --- /dev/null +++ b/Documentation/arm/Samsung/clksrc-change-registers.awk | |||
@@ -0,0 +1,167 @@ | |||
1 | #!/usr/bin/awk -f | ||
2 | # | ||
3 | # Copyright 2010 Ben Dooks <ben-linux@fluff.org> | ||
4 | # | ||
5 | # Released under GPLv2 | ||
6 | |||
7 | # example usage | ||
8 | # ./clksrc-change-registers.awk arch/arm/plat-s5pc1xx/include/plat/regs-clock.h < src > dst | ||
9 | |||
10 | function extract_value(s) | ||
11 | { | ||
12 | eqat = index(s, "=") | ||
13 | comat = index(s, ",") | ||
14 | return substr(s, eqat+2, (comat-eqat)-2) | ||
15 | } | ||
16 | |||
17 | function remove_brackets(b) | ||
18 | { | ||
19 | return substr(b, 2, length(b)-2) | ||
20 | } | ||
21 | |||
22 | function splitdefine(l, p) | ||
23 | { | ||
24 | r = split(l, tp) | ||
25 | |||
26 | p[0] = tp[2] | ||
27 | p[1] = remove_brackets(tp[3]) | ||
28 | } | ||
29 | |||
30 | function find_length(f) | ||
31 | { | ||
32 | if (0) | ||
33 | printf "find_length " f "\n" > "/dev/stderr" | ||
34 | |||
35 | if (f ~ /0x1/) | ||
36 | return 1 | ||
37 | else if (f ~ /0x3/) | ||
38 | return 2 | ||
39 | else if (f ~ /0x7/) | ||
40 | return 3 | ||
41 | else if (f ~ /0xf/) | ||
42 | return 4 | ||
43 | |||
44 | printf "unknown legnth " f "\n" > "/dev/stderr" | ||
45 | exit | ||
46 | } | ||
47 | |||
48 | function find_shift(s) | ||
49 | { | ||
50 | id = index(s, "<") | ||
51 | if (id <= 0) { | ||
52 | printf "cannot find shift " s "\n" > "/dev/stderr" | ||
53 | exit | ||
54 | } | ||
55 | |||
56 | return substr(s, id+2) | ||
57 | } | ||
58 | |||
59 | |||
60 | BEGIN { | ||
61 | if (ARGC < 2) { | ||
62 | print "too few arguments" > "/dev/stderr" | ||
63 | exit | ||
64 | } | ||
65 | |||
66 | # read the header file and find the mask values that we will need | ||
67 | # to replace and create an associative array of values | ||
68 | |||
69 | while (getline line < ARGV[1] > 0) { | ||
70 | if (line ~ /\#define.*_MASK/ && | ||
71 | !(line ~ /S5PC100_EPLL_MASK/) && | ||
72 | !(line ~ /USB_SIG_MASK/)) { | ||
73 | splitdefine(line, fields) | ||
74 | name = fields[0] | ||
75 | if (0) | ||
76 | printf "MASK " line "\n" > "/dev/stderr" | ||
77 | dmask[name,0] = find_length(fields[1]) | ||
78 | dmask[name,1] = find_shift(fields[1]) | ||
79 | if (0) | ||
80 | printf "=> '" name "' LENGTH=" dmask[name,0] " SHIFT=" dmask[name,1] "\n" > "/dev/stderr" | ||
81 | } else { | ||
82 | } | ||
83 | } | ||
84 | |||
85 | delete ARGV[1] | ||
86 | } | ||
87 | |||
88 | /clksrc_clk.*=.*{/ { | ||
89 | shift="" | ||
90 | mask="" | ||
91 | divshift="" | ||
92 | reg_div="" | ||
93 | reg_src="" | ||
94 | indent=1 | ||
95 | |||
96 | print $0 | ||
97 | |||
98 | for(; indent >= 1;) { | ||
99 | if ((getline line) <= 0) { | ||
100 | printf "unexpected end of file" > "/dev/stderr" | ||
101 | exit 1; | ||
102 | } | ||
103 | |||
104 | if (line ~ /\.shift/) { | ||
105 | shift = extract_value(line) | ||
106 | } else if (line ~ /\.mask/) { | ||
107 | mask = extract_value(line) | ||
108 | } else if (line ~ /\.reg_divider/) { | ||
109 | reg_div = extract_value(line) | ||
110 | } else if (line ~ /\.reg_source/) { | ||
111 | reg_src = extract_value(line) | ||
112 | } else if (line ~ /\.divider_shift/) { | ||
113 | divshift = extract_value(line) | ||
114 | } else if (line ~ /{/) { | ||
115 | indent++ | ||
116 | print line | ||
117 | } else if (line ~ /}/) { | ||
118 | indent-- | ||
119 | |||
120 | if (indent == 0) { | ||
121 | if (0) { | ||
122 | printf "shift '" shift "' ='" dmask[shift,0] "'\n" > "/dev/stderr" | ||
123 | printf "mask '" mask "'\n" > "/dev/stderr" | ||
124 | printf "dshft '" divshift "'\n" > "/dev/stderr" | ||
125 | printf "rdiv '" reg_div "'\n" > "/dev/stderr" | ||
126 | printf "rsrc '" reg_src "'\n" > "/dev/stderr" | ||
127 | } | ||
128 | |||
129 | generated = mask | ||
130 | sub(reg_src, reg_div, generated) | ||
131 | |||
132 | if (0) { | ||
133 | printf "/* rsrc " reg_src " */\n" | ||
134 | printf "/* rdiv " reg_div " */\n" | ||
135 | printf "/* shift " shift " */\n" | ||
136 | printf "/* mask " mask " */\n" | ||
137 | printf "/* generated " generated " */\n" | ||
138 | } | ||
139 | |||
140 | if (reg_div != "") { | ||
141 | printf "\t.reg_div = { " | ||
142 | printf ".reg = " reg_div ", " | ||
143 | printf ".shift = " dmask[generated,1] ", " | ||
144 | printf ".size = " dmask[generated,0] ", " | ||
145 | printf "},\n" | ||
146 | } | ||
147 | |||
148 | printf "\t.reg_src = { " | ||
149 | printf ".reg = " reg_src ", " | ||
150 | printf ".shift = " dmask[mask,1] ", " | ||
151 | printf ".size = " dmask[mask,0] ", " | ||
152 | |||
153 | printf "},\n" | ||
154 | |||
155 | } | ||
156 | |||
157 | print line | ||
158 | } else { | ||
159 | print line | ||
160 | } | ||
161 | |||
162 | if (0) | ||
163 | printf indent ":" line "\n" > "/dev/stderr" | ||
164 | } | ||
165 | } | ||
166 | |||
167 | // && ! /clksrc_clk.*=.*{/ { print $0 } | ||
diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd index 2c558cd6c1ef..f4dc9de2694e 100644 --- a/Documentation/cdrom/ide-cd +++ b/Documentation/cdrom/ide-cd | |||
@@ -159,42 +159,7 @@ two arguments: the CDROM device, and the slot number to which you wish | |||
159 | to change. If the slot number is -1, the drive is unloaded. | 159 | to change. If the slot number is -1, the drive is unloaded. |
160 | 160 | ||
161 | 161 | ||
162 | 4. Compilation options | 162 | 4. Common problems |
163 | ---------------------- | ||
164 | |||
165 | There are a few additional options which can be set when compiling the | ||
166 | driver. Most people should not need to mess with any of these; they | ||
167 | are listed here simply for completeness. A compilation option can be | ||
168 | enabled by adding a line of the form `#define <option> 1' to the top | ||
169 | of ide-cd.c. All these options are disabled by default. | ||
170 | |||
171 | VERBOSE_IDE_CD_ERRORS | ||
172 | If this is set, ATAPI error codes will be translated into textual | ||
173 | descriptions. In addition, a dump is made of the command which | ||
174 | provoked the error. This is off by default to save the memory used | ||
175 | by the (somewhat long) table of error descriptions. | ||
176 | |||
177 | STANDARD_ATAPI | ||
178 | If this is set, the code needed to deal with certain drives which do | ||
179 | not properly implement the ATAPI spec will be disabled. If you know | ||
180 | your drive implements ATAPI properly, you can turn this on to get a | ||
181 | slightly smaller kernel. | ||
182 | |||
183 | NO_DOOR_LOCKING | ||
184 | If this is set, the driver will never attempt to lock the door of | ||
185 | the drive. | ||
186 | |||
187 | CDROM_NBLOCKS_BUFFER | ||
188 | This sets the size of the buffer to be used for a CDROMREADAUDIO | ||
189 | ioctl. The default is 8. | ||
190 | |||
191 | TEST | ||
192 | This currently enables an additional ioctl which enables a user-mode | ||
193 | program to execute an arbitrary packet command. See the source for | ||
194 | details. This should be left off unless you know what you're doing. | ||
195 | |||
196 | |||
197 | 5. Common problems | ||
198 | ------------------ | 163 | ------------------ |
199 | 164 | ||
200 | This section discusses some common problems encountered when trying to | 165 | This section discusses some common problems encountered when trying to |
@@ -371,7 +336,7 @@ f. Data corruption. | |||
371 | expense of low system performance. | 336 | expense of low system performance. |
372 | 337 | ||
373 | 338 | ||
374 | 6. cdchange.c | 339 | 5. cdchange.c |
375 | ------------- | 340 | ------------- |
376 | 341 | ||
377 | /* | 342 | /* |
diff --git a/Documentation/cgroups/cgroup_event_listener.c b/Documentation/cgroups/cgroup_event_listener.c new file mode 100644 index 000000000000..8c2bfc4a6358 --- /dev/null +++ b/Documentation/cgroups/cgroup_event_listener.c | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * cgroup_event_listener.c - Simple listener of cgroup events | ||
3 | * | ||
4 | * Copyright (C) Kirill A. Shutemov <kirill@shutemov.name> | ||
5 | */ | ||
6 | |||
7 | #include <assert.h> | ||
8 | #include <errno.h> | ||
9 | #include <fcntl.h> | ||
10 | #include <libgen.h> | ||
11 | #include <limits.h> | ||
12 | #include <stdio.h> | ||
13 | #include <string.h> | ||
14 | #include <unistd.h> | ||
15 | |||
16 | #include <sys/eventfd.h> | ||
17 | |||
18 | #define USAGE_STR "Usage: cgroup_event_listener <path-to-control-file> <args>\n" | ||
19 | |||
20 | int main(int argc, char **argv) | ||
21 | { | ||
22 | int efd = -1; | ||
23 | int cfd = -1; | ||
24 | int event_control = -1; | ||
25 | char event_control_path[PATH_MAX]; | ||
26 | char line[LINE_MAX]; | ||
27 | int ret; | ||
28 | |||
29 | if (argc != 3) { | ||
30 | fputs(USAGE_STR, stderr); | ||
31 | return 1; | ||
32 | } | ||
33 | |||
34 | cfd = open(argv[1], O_RDONLY); | ||
35 | if (cfd == -1) { | ||
36 | fprintf(stderr, "Cannot open %s: %s\n", argv[1], | ||
37 | strerror(errno)); | ||
38 | goto out; | ||
39 | } | ||
40 | |||
41 | ret = snprintf(event_control_path, PATH_MAX, "%s/cgroup.event_control", | ||
42 | dirname(argv[1])); | ||
43 | if (ret >= PATH_MAX) { | ||
44 | fputs("Path to cgroup.event_control is too long\n", stderr); | ||
45 | goto out; | ||
46 | } | ||
47 | |||
48 | event_control = open(event_control_path, O_WRONLY); | ||
49 | if (event_control == -1) { | ||
50 | fprintf(stderr, "Cannot open %s: %s\n", event_control_path, | ||
51 | strerror(errno)); | ||
52 | goto out; | ||
53 | } | ||
54 | |||
55 | efd = eventfd(0, 0); | ||
56 | if (efd == -1) { | ||
57 | perror("eventfd() failed"); | ||
58 | goto out; | ||
59 | } | ||
60 | |||
61 | ret = snprintf(line, LINE_MAX, "%d %d %s", efd, cfd, argv[2]); | ||
62 | if (ret >= LINE_MAX) { | ||
63 | fputs("Arguments string is too long\n", stderr); | ||
64 | goto out; | ||
65 | } | ||
66 | |||
67 | ret = write(event_control, line, strlen(line) + 1); | ||
68 | if (ret == -1) { | ||
69 | perror("Cannot write to cgroup.event_control"); | ||
70 | goto out; | ||
71 | } | ||
72 | |||
73 | while (1) { | ||
74 | uint64_t result; | ||
75 | |||
76 | ret = read(efd, &result, sizeof(result)); | ||
77 | if (ret == -1) { | ||
78 | if (errno == EINTR) | ||
79 | continue; | ||
80 | perror("Cannot read from eventfd"); | ||
81 | break; | ||
82 | } | ||
83 | assert(ret == sizeof(result)); | ||
84 | |||
85 | ret = access(event_control_path, W_OK); | ||
86 | if ((ret == -1) && (errno == ENOENT)) { | ||
87 | puts("The cgroup seems to have removed."); | ||
88 | ret = 0; | ||
89 | break; | ||
90 | } | ||
91 | |||
92 | if (ret == -1) { | ||
93 | perror("cgroup.event_control " | ||
94 | "is not accessable any more"); | ||
95 | break; | ||
96 | } | ||
97 | |||
98 | printf("%s %s: crossed\n", argv[1], argv[2]); | ||
99 | } | ||
100 | |||
101 | out: | ||
102 | if (efd >= 0) | ||
103 | close(efd); | ||
104 | if (event_control >= 0) | ||
105 | close(event_control); | ||
106 | if (cfd >= 0) | ||
107 | close(cfd); | ||
108 | |||
109 | return (ret != 0); | ||
110 | } | ||
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 0b33bfe7dde9..fd588ff0e296 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -22,6 +22,8 @@ CONTENTS: | |||
22 | 2. Usage Examples and Syntax | 22 | 2. Usage Examples and Syntax |
23 | 2.1 Basic Usage | 23 | 2.1 Basic Usage |
24 | 2.2 Attaching processes | 24 | 2.2 Attaching processes |
25 | 2.3 Mounting hierarchies by name | ||
26 | 2.4 Notification API | ||
25 | 3. Kernel API | 27 | 3. Kernel API |
26 | 3.1 Overview | 28 | 3.1 Overview |
27 | 3.2 Synchronization | 29 | 3.2 Synchronization |
@@ -434,6 +436,25 @@ you give a subsystem a name. | |||
434 | The name of the subsystem appears as part of the hierarchy description | 436 | The name of the subsystem appears as part of the hierarchy description |
435 | in /proc/mounts and /proc/<pid>/cgroups. | 437 | in /proc/mounts and /proc/<pid>/cgroups. |
436 | 438 | ||
439 | 2.4 Notification API | ||
440 | -------------------- | ||
441 | |||
442 | There is mechanism which allows to get notifications about changing | ||
443 | status of a cgroup. | ||
444 | |||
445 | To register new notification handler you need: | ||
446 | - create a file descriptor for event notification using eventfd(2); | ||
447 | - open a control file to be monitored (e.g. memory.usage_in_bytes); | ||
448 | - write "<event_fd> <control_fd> <args>" to cgroup.event_control. | ||
449 | Interpretation of args is defined by control file implementation; | ||
450 | |||
451 | eventfd will be woken up by control file implementation or when the | ||
452 | cgroup is removed. | ||
453 | |||
454 | To unregister notification handler just close eventfd. | ||
455 | |||
456 | NOTE: Support of notifications should be implemented for the control | ||
457 | file. See documentation for the subsystem. | ||
437 | 458 | ||
438 | 3. Kernel API | 459 | 3. Kernel API |
439 | ============= | 460 | ============= |
@@ -488,6 +509,11 @@ Each subsystem should: | |||
488 | - add an entry in linux/cgroup_subsys.h | 509 | - add an entry in linux/cgroup_subsys.h |
489 | - define a cgroup_subsys object called <name>_subsys | 510 | - define a cgroup_subsys object called <name>_subsys |
490 | 511 | ||
512 | If a subsystem can be compiled as a module, it should also have in its | ||
513 | module initcall a call to cgroup_load_subsys(), and in its exitcall a | ||
514 | call to cgroup_unload_subsys(). It should also set its_subsys.module = | ||
515 | THIS_MODULE in its .c file. | ||
516 | |||
491 | Each subsystem may export the following methods. The only mandatory | 517 | Each subsystem may export the following methods. The only mandatory |
492 | methods are create/destroy. Any others that are null are presumed to | 518 | methods are create/destroy. Any others that are null are presumed to |
493 | be successful no-ops. | 519 | be successful no-ops. |
@@ -536,10 +562,21 @@ returns an error, this will abort the attach operation. If a NULL | |||
536 | task is passed, then a successful result indicates that *any* | 562 | task is passed, then a successful result indicates that *any* |
537 | unspecified task can be moved into the cgroup. Note that this isn't | 563 | unspecified task can be moved into the cgroup. Note that this isn't |
538 | called on a fork. If this method returns 0 (success) then this should | 564 | called on a fork. If this method returns 0 (success) then this should |
539 | remain valid while the caller holds cgroup_mutex. If threadgroup is | 565 | remain valid while the caller holds cgroup_mutex and it is ensured that either |
566 | attach() or cancel_attach() will be called in future. If threadgroup is | ||
540 | true, then a successful result indicates that all threads in the given | 567 | true, then a successful result indicates that all threads in the given |
541 | thread's threadgroup can be moved together. | 568 | thread's threadgroup can be moved together. |
542 | 569 | ||
570 | void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | ||
571 | struct task_struct *task, bool threadgroup) | ||
572 | (cgroup_mutex held by caller) | ||
573 | |||
574 | Called when a task attach operation has failed after can_attach() has succeeded. | ||
575 | A subsystem whose can_attach() has some side-effects should provide this | ||
576 | function, so that the subsytem can implement a rollback. If not, not necessary. | ||
577 | This will be called only about subsystems whose can_attach() operation have | ||
578 | succeeded. | ||
579 | |||
543 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 580 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
544 | struct cgroup *old_cgrp, struct task_struct *task, | 581 | struct cgroup *old_cgrp, struct task_struct *task, |
545 | bool threadgroup) | 582 | bool threadgroup) |
diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt index 1d7e9784439a..4160df82b3f5 100644 --- a/Documentation/cgroups/cpusets.txt +++ b/Documentation/cgroups/cpusets.txt | |||
@@ -168,20 +168,20 @@ Each cpuset is represented by a directory in the cgroup file system | |||
168 | containing (on top of the standard cgroup files) the following | 168 | containing (on top of the standard cgroup files) the following |
169 | files describing that cpuset: | 169 | files describing that cpuset: |
170 | 170 | ||
171 | - cpus: list of CPUs in that cpuset | 171 | - cpuset.cpus: list of CPUs in that cpuset |
172 | - mems: list of Memory Nodes in that cpuset | 172 | - cpuset.mems: list of Memory Nodes in that cpuset |
173 | - memory_migrate flag: if set, move pages to cpusets nodes | 173 | - cpuset.memory_migrate flag: if set, move pages to cpusets nodes |
174 | - cpu_exclusive flag: is cpu placement exclusive? | 174 | - cpuset.cpu_exclusive flag: is cpu placement exclusive? |
175 | - mem_exclusive flag: is memory placement exclusive? | 175 | - cpuset.mem_exclusive flag: is memory placement exclusive? |
176 | - mem_hardwall flag: is memory allocation hardwalled | 176 | - cpuset.mem_hardwall flag: is memory allocation hardwalled |
177 | - memory_pressure: measure of how much paging pressure in cpuset | 177 | - cpuset.memory_pressure: measure of how much paging pressure in cpuset |
178 | - memory_spread_page flag: if set, spread page cache evenly on allowed nodes | 178 | - cpuset.memory_spread_page flag: if set, spread page cache evenly on allowed nodes |
179 | - memory_spread_slab flag: if set, spread slab cache evenly on allowed nodes | 179 | - cpuset.memory_spread_slab flag: if set, spread slab cache evenly on allowed nodes |
180 | - sched_load_balance flag: if set, load balance within CPUs on that cpuset | 180 | - cpuset.sched_load_balance flag: if set, load balance within CPUs on that cpuset |
181 | - sched_relax_domain_level: the searching range when migrating tasks | 181 | - cpuset.sched_relax_domain_level: the searching range when migrating tasks |
182 | 182 | ||
183 | In addition, the root cpuset only has the following file: | 183 | In addition, the root cpuset only has the following file: |
184 | - memory_pressure_enabled flag: compute memory_pressure? | 184 | - cpuset.memory_pressure_enabled flag: compute memory_pressure? |
185 | 185 | ||
186 | New cpusets are created using the mkdir system call or shell | 186 | New cpusets are created using the mkdir system call or shell |
187 | command. The properties of a cpuset, such as its flags, allowed | 187 | command. The properties of a cpuset, such as its flags, allowed |
@@ -229,7 +229,7 @@ If a cpuset is cpu or mem exclusive, no other cpuset, other than | |||
229 | a direct ancestor or descendant, may share any of the same CPUs or | 229 | a direct ancestor or descendant, may share any of the same CPUs or |
230 | Memory Nodes. | 230 | Memory Nodes. |
231 | 231 | ||
232 | A cpuset that is mem_exclusive *or* mem_hardwall is "hardwalled", | 232 | A cpuset that is cpuset.mem_exclusive *or* cpuset.mem_hardwall is "hardwalled", |
233 | i.e. it restricts kernel allocations for page, buffer and other data | 233 | i.e. it restricts kernel allocations for page, buffer and other data |
234 | commonly shared by the kernel across multiple users. All cpusets, | 234 | commonly shared by the kernel across multiple users. All cpusets, |
235 | whether hardwalled or not, restrict allocations of memory for user | 235 | whether hardwalled or not, restrict allocations of memory for user |
@@ -304,15 +304,15 @@ times 1000. | |||
304 | --------------------------- | 304 | --------------------------- |
305 | There are two boolean flag files per cpuset that control where the | 305 | There are two boolean flag files per cpuset that control where the |
306 | kernel allocates pages for the file system buffers and related in | 306 | kernel allocates pages for the file system buffers and related in |
307 | kernel data structures. They are called 'memory_spread_page' and | 307 | kernel data structures. They are called 'cpuset.memory_spread_page' and |
308 | 'memory_spread_slab'. | 308 | 'cpuset.memory_spread_slab'. |
309 | 309 | ||
310 | If the per-cpuset boolean flag file 'memory_spread_page' is set, then | 310 | If the per-cpuset boolean flag file 'cpuset.memory_spread_page' is set, then |
311 | the kernel will spread the file system buffers (page cache) evenly | 311 | the kernel will spread the file system buffers (page cache) evenly |
312 | over all the nodes that the faulting task is allowed to use, instead | 312 | over all the nodes that the faulting task is allowed to use, instead |
313 | of preferring to put those pages on the node where the task is running. | 313 | of preferring to put those pages on the node where the task is running. |
314 | 314 | ||
315 | If the per-cpuset boolean flag file 'memory_spread_slab' is set, | 315 | If the per-cpuset boolean flag file 'cpuset.memory_spread_slab' is set, |
316 | then the kernel will spread some file system related slab caches, | 316 | then the kernel will spread some file system related slab caches, |
317 | such as for inodes and dentries evenly over all the nodes that the | 317 | such as for inodes and dentries evenly over all the nodes that the |
318 | faulting task is allowed to use, instead of preferring to put those | 318 | faulting task is allowed to use, instead of preferring to put those |
@@ -337,21 +337,21 @@ their containing tasks memory spread settings. If memory spreading | |||
337 | is turned off, then the currently specified NUMA mempolicy once again | 337 | is turned off, then the currently specified NUMA mempolicy once again |
338 | applies to memory page allocations. | 338 | applies to memory page allocations. |
339 | 339 | ||
340 | Both 'memory_spread_page' and 'memory_spread_slab' are boolean flag | 340 | Both 'cpuset.memory_spread_page' and 'cpuset.memory_spread_slab' are boolean flag |
341 | files. By default they contain "0", meaning that the feature is off | 341 | files. By default they contain "0", meaning that the feature is off |
342 | for that cpuset. If a "1" is written to that file, then that turns | 342 | for that cpuset. If a "1" is written to that file, then that turns |
343 | the named feature on. | 343 | the named feature on. |
344 | 344 | ||
345 | The implementation is simple. | 345 | The implementation is simple. |
346 | 346 | ||
347 | Setting the flag 'memory_spread_page' turns on a per-process flag | 347 | Setting the flag 'cpuset.memory_spread_page' turns on a per-process flag |
348 | PF_SPREAD_PAGE for each task that is in that cpuset or subsequently | 348 | PF_SPREAD_PAGE for each task that is in that cpuset or subsequently |
349 | joins that cpuset. The page allocation calls for the page cache | 349 | joins that cpuset. The page allocation calls for the page cache |
350 | is modified to perform an inline check for this PF_SPREAD_PAGE task | 350 | is modified to perform an inline check for this PF_SPREAD_PAGE task |
351 | flag, and if set, a call to a new routine cpuset_mem_spread_node() | 351 | flag, and if set, a call to a new routine cpuset_mem_spread_node() |
352 | returns the node to prefer for the allocation. | 352 | returns the node to prefer for the allocation. |
353 | 353 | ||
354 | Similarly, setting 'memory_spread_slab' turns on the flag | 354 | Similarly, setting 'cpuset.memory_spread_slab' turns on the flag |
355 | PF_SPREAD_SLAB, and appropriately marked slab caches will allocate | 355 | PF_SPREAD_SLAB, and appropriately marked slab caches will allocate |
356 | pages from the node returned by cpuset_mem_spread_node(). | 356 | pages from the node returned by cpuset_mem_spread_node(). |
357 | 357 | ||
@@ -404,24 +404,24 @@ the following two situations: | |||
404 | system overhead on those CPUs, including avoiding task load | 404 | system overhead on those CPUs, including avoiding task load |
405 | balancing if that is not needed. | 405 | balancing if that is not needed. |
406 | 406 | ||
407 | When the per-cpuset flag "sched_load_balance" is enabled (the default | 407 | When the per-cpuset flag "cpuset.sched_load_balance" is enabled (the default |
408 | setting), it requests that all the CPUs in that cpusets allowed 'cpus' | 408 | setting), it requests that all the CPUs in that cpusets allowed 'cpuset.cpus' |
409 | be contained in a single sched domain, ensuring that load balancing | 409 | be contained in a single sched domain, ensuring that load balancing |
410 | can move a task (not otherwised pinned, as by sched_setaffinity) | 410 | can move a task (not otherwised pinned, as by sched_setaffinity) |
411 | from any CPU in that cpuset to any other. | 411 | from any CPU in that cpuset to any other. |
412 | 412 | ||
413 | When the per-cpuset flag "sched_load_balance" is disabled, then the | 413 | When the per-cpuset flag "cpuset.sched_load_balance" is disabled, then the |
414 | scheduler will avoid load balancing across the CPUs in that cpuset, | 414 | scheduler will avoid load balancing across the CPUs in that cpuset, |
415 | --except-- in so far as is necessary because some overlapping cpuset | 415 | --except-- in so far as is necessary because some overlapping cpuset |
416 | has "sched_load_balance" enabled. | 416 | has "sched_load_balance" enabled. |
417 | 417 | ||
418 | So, for example, if the top cpuset has the flag "sched_load_balance" | 418 | So, for example, if the top cpuset has the flag "cpuset.sched_load_balance" |
419 | enabled, then the scheduler will have one sched domain covering all | 419 | enabled, then the scheduler will have one sched domain covering all |
420 | CPUs, and the setting of the "sched_load_balance" flag in any other | 420 | CPUs, and the setting of the "cpuset.sched_load_balance" flag in any other |
421 | cpusets won't matter, as we're already fully load balancing. | 421 | cpusets won't matter, as we're already fully load balancing. |
422 | 422 | ||
423 | Therefore in the above two situations, the top cpuset flag | 423 | Therefore in the above two situations, the top cpuset flag |
424 | "sched_load_balance" should be disabled, and only some of the smaller, | 424 | "cpuset.sched_load_balance" should be disabled, and only some of the smaller, |
425 | child cpusets have this flag enabled. | 425 | child cpusets have this flag enabled. |
426 | 426 | ||
427 | When doing this, you don't usually want to leave any unpinned tasks in | 427 | When doing this, you don't usually want to leave any unpinned tasks in |
@@ -433,7 +433,7 @@ scheduler might not consider the possibility of load balancing that | |||
433 | task to that underused CPU. | 433 | task to that underused CPU. |
434 | 434 | ||
435 | Of course, tasks pinned to a particular CPU can be left in a cpuset | 435 | Of course, tasks pinned to a particular CPU can be left in a cpuset |
436 | that disables "sched_load_balance" as those tasks aren't going anywhere | 436 | that disables "cpuset.sched_load_balance" as those tasks aren't going anywhere |
437 | else anyway. | 437 | else anyway. |
438 | 438 | ||
439 | There is an impedance mismatch here, between cpusets and sched domains. | 439 | There is an impedance mismatch here, between cpusets and sched domains. |
@@ -443,19 +443,19 @@ overlap and each CPU is in at most one sched domain. | |||
443 | It is necessary for sched domains to be flat because load balancing | 443 | It is necessary for sched domains to be flat because load balancing |
444 | across partially overlapping sets of CPUs would risk unstable dynamics | 444 | across partially overlapping sets of CPUs would risk unstable dynamics |
445 | that would be beyond our understanding. So if each of two partially | 445 | that would be beyond our understanding. So if each of two partially |
446 | overlapping cpusets enables the flag 'sched_load_balance', then we | 446 | overlapping cpusets enables the flag 'cpuset.sched_load_balance', then we |
447 | form a single sched domain that is a superset of both. We won't move | 447 | form a single sched domain that is a superset of both. We won't move |
448 | a task to a CPU outside it cpuset, but the scheduler load balancing | 448 | a task to a CPU outside it cpuset, but the scheduler load balancing |
449 | code might waste some compute cycles considering that possibility. | 449 | code might waste some compute cycles considering that possibility. |
450 | 450 | ||
451 | This mismatch is why there is not a simple one-to-one relation | 451 | This mismatch is why there is not a simple one-to-one relation |
452 | between which cpusets have the flag "sched_load_balance" enabled, | 452 | between which cpusets have the flag "cpuset.sched_load_balance" enabled, |
453 | and the sched domain configuration. If a cpuset enables the flag, it | 453 | and the sched domain configuration. If a cpuset enables the flag, it |
454 | will get balancing across all its CPUs, but if it disables the flag, | 454 | will get balancing across all its CPUs, but if it disables the flag, |
455 | it will only be assured of no load balancing if no other overlapping | 455 | it will only be assured of no load balancing if no other overlapping |
456 | cpuset enables the flag. | 456 | cpuset enables the flag. |
457 | 457 | ||
458 | If two cpusets have partially overlapping 'cpus' allowed, and only | 458 | If two cpusets have partially overlapping 'cpuset.cpus' allowed, and only |
459 | one of them has this flag enabled, then the other may find its | 459 | one of them has this flag enabled, then the other may find its |
460 | tasks only partially load balanced, just on the overlapping CPUs. | 460 | tasks only partially load balanced, just on the overlapping CPUs. |
461 | This is just the general case of the top_cpuset example given a few | 461 | This is just the general case of the top_cpuset example given a few |
@@ -468,23 +468,23 @@ load balancing to the other CPUs. | |||
468 | 1.7.1 sched_load_balance implementation details. | 468 | 1.7.1 sched_load_balance implementation details. |
469 | ------------------------------------------------ | 469 | ------------------------------------------------ |
470 | 470 | ||
471 | The per-cpuset flag 'sched_load_balance' defaults to enabled (contrary | 471 | The per-cpuset flag 'cpuset.sched_load_balance' defaults to enabled (contrary |
472 | to most cpuset flags.) When enabled for a cpuset, the kernel will | 472 | to most cpuset flags.) When enabled for a cpuset, the kernel will |
473 | ensure that it can load balance across all the CPUs in that cpuset | 473 | ensure that it can load balance across all the CPUs in that cpuset |
474 | (makes sure that all the CPUs in the cpus_allowed of that cpuset are | 474 | (makes sure that all the CPUs in the cpus_allowed of that cpuset are |
475 | in the same sched domain.) | 475 | in the same sched domain.) |
476 | 476 | ||
477 | If two overlapping cpusets both have 'sched_load_balance' enabled, | 477 | If two overlapping cpusets both have 'cpuset.sched_load_balance' enabled, |
478 | then they will be (must be) both in the same sched domain. | 478 | then they will be (must be) both in the same sched domain. |
479 | 479 | ||
480 | If, as is the default, the top cpuset has 'sched_load_balance' enabled, | 480 | If, as is the default, the top cpuset has 'cpuset.sched_load_balance' enabled, |
481 | then by the above that means there is a single sched domain covering | 481 | then by the above that means there is a single sched domain covering |
482 | the whole system, regardless of any other cpuset settings. | 482 | the whole system, regardless of any other cpuset settings. |
483 | 483 | ||
484 | The kernel commits to user space that it will avoid load balancing | 484 | The kernel commits to user space that it will avoid load balancing |
485 | where it can. It will pick as fine a granularity partition of sched | 485 | where it can. It will pick as fine a granularity partition of sched |
486 | domains as it can while still providing load balancing for any set | 486 | domains as it can while still providing load balancing for any set |
487 | of CPUs allowed to a cpuset having 'sched_load_balance' enabled. | 487 | of CPUs allowed to a cpuset having 'cpuset.sched_load_balance' enabled. |
488 | 488 | ||
489 | The internal kernel cpuset to scheduler interface passes from the | 489 | The internal kernel cpuset to scheduler interface passes from the |
490 | cpuset code to the scheduler code a partition of the load balanced | 490 | cpuset code to the scheduler code a partition of the load balanced |
@@ -495,9 +495,9 @@ all the CPUs that must be load balanced. | |||
495 | The cpuset code builds a new such partition and passes it to the | 495 | The cpuset code builds a new such partition and passes it to the |
496 | scheduler sched domain setup code, to have the sched domains rebuilt | 496 | scheduler sched domain setup code, to have the sched domains rebuilt |
497 | as necessary, whenever: | 497 | as necessary, whenever: |
498 | - the 'sched_load_balance' flag of a cpuset with non-empty CPUs changes, | 498 | - the 'cpuset.sched_load_balance' flag of a cpuset with non-empty CPUs changes, |
499 | - or CPUs come or go from a cpuset with this flag enabled, | 499 | - or CPUs come or go from a cpuset with this flag enabled, |
500 | - or 'sched_relax_domain_level' value of a cpuset with non-empty CPUs | 500 | - or 'cpuset.sched_relax_domain_level' value of a cpuset with non-empty CPUs |
501 | and with this flag enabled changes, | 501 | and with this flag enabled changes, |
502 | - or a cpuset with non-empty CPUs and with this flag enabled is removed, | 502 | - or a cpuset with non-empty CPUs and with this flag enabled is removed, |
503 | - or a cpu is offlined/onlined. | 503 | - or a cpu is offlined/onlined. |
@@ -542,7 +542,7 @@ As the result, task B on CPU X need to wait task A or wait load balance | |||
542 | on the next tick. For some applications in special situation, waiting | 542 | on the next tick. For some applications in special situation, waiting |
543 | 1 tick may be too long. | 543 | 1 tick may be too long. |
544 | 544 | ||
545 | The 'sched_relax_domain_level' file allows you to request changing | 545 | The 'cpuset.sched_relax_domain_level' file allows you to request changing |
546 | this searching range as you like. This file takes int value which | 546 | this searching range as you like. This file takes int value which |
547 | indicates size of searching range in levels ideally as follows, | 547 | indicates size of searching range in levels ideally as follows, |
548 | otherwise initial value -1 that indicates the cpuset has no request. | 548 | otherwise initial value -1 that indicates the cpuset has no request. |
@@ -559,8 +559,8 @@ The system default is architecture dependent. The system default | |||
559 | can be changed using the relax_domain_level= boot parameter. | 559 | can be changed using the relax_domain_level= boot parameter. |
560 | 560 | ||
561 | This file is per-cpuset and affect the sched domain where the cpuset | 561 | This file is per-cpuset and affect the sched domain where the cpuset |
562 | belongs to. Therefore if the flag 'sched_load_balance' of a cpuset | 562 | belongs to. Therefore if the flag 'cpuset.sched_load_balance' of a cpuset |
563 | is disabled, then 'sched_relax_domain_level' have no effect since | 563 | is disabled, then 'cpuset.sched_relax_domain_level' have no effect since |
564 | there is no sched domain belonging the cpuset. | 564 | there is no sched domain belonging the cpuset. |
565 | 565 | ||
566 | If multiple cpusets are overlapping and hence they form a single sched | 566 | If multiple cpusets are overlapping and hence they form a single sched |
@@ -607,9 +607,9 @@ from one cpuset to another, then the kernel will adjust the tasks | |||
607 | memory placement, as above, the next time that the kernel attempts | 607 | memory placement, as above, the next time that the kernel attempts |
608 | to allocate a page of memory for that task. | 608 | to allocate a page of memory for that task. |
609 | 609 | ||
610 | If a cpuset has its 'cpus' modified, then each task in that cpuset | 610 | If a cpuset has its 'cpuset.cpus' modified, then each task in that cpuset |
611 | will have its allowed CPU placement changed immediately. Similarly, | 611 | will have its allowed CPU placement changed immediately. Similarly, |
612 | if a tasks pid is written to another cpusets 'tasks' file, then its | 612 | if a tasks pid is written to another cpusets 'cpuset.tasks' file, then its |
613 | allowed CPU placement is changed immediately. If such a task had been | 613 | allowed CPU placement is changed immediately. If such a task had been |
614 | bound to some subset of its cpuset using the sched_setaffinity() call, | 614 | bound to some subset of its cpuset using the sched_setaffinity() call, |
615 | the task will be allowed to run on any CPU allowed in its new cpuset, | 615 | the task will be allowed to run on any CPU allowed in its new cpuset, |
@@ -622,8 +622,8 @@ and the processor placement is updated immediately. | |||
622 | Normally, once a page is allocated (given a physical page | 622 | Normally, once a page is allocated (given a physical page |
623 | of main memory) then that page stays on whatever node it | 623 | of main memory) then that page stays on whatever node it |
624 | was allocated, so long as it remains allocated, even if the | 624 | was allocated, so long as it remains allocated, even if the |
625 | cpusets memory placement policy 'mems' subsequently changes. | 625 | cpusets memory placement policy 'cpuset.mems' subsequently changes. |
626 | If the cpuset flag file 'memory_migrate' is set true, then when | 626 | If the cpuset flag file 'cpuset.memory_migrate' is set true, then when |
627 | tasks are attached to that cpuset, any pages that task had | 627 | tasks are attached to that cpuset, any pages that task had |
628 | allocated to it on nodes in its previous cpuset are migrated | 628 | allocated to it on nodes in its previous cpuset are migrated |
629 | to the tasks new cpuset. The relative placement of the page within | 629 | to the tasks new cpuset. The relative placement of the page within |
@@ -631,12 +631,12 @@ the cpuset is preserved during these migration operations if possible. | |||
631 | For example if the page was on the second valid node of the prior cpuset | 631 | For example if the page was on the second valid node of the prior cpuset |
632 | then the page will be placed on the second valid node of the new cpuset. | 632 | then the page will be placed on the second valid node of the new cpuset. |
633 | 633 | ||
634 | Also if 'memory_migrate' is set true, then if that cpusets | 634 | Also if 'cpuset.memory_migrate' is set true, then if that cpusets |
635 | 'mems' file is modified, pages allocated to tasks in that | 635 | 'cpuset.mems' file is modified, pages allocated to tasks in that |
636 | cpuset, that were on nodes in the previous setting of 'mems', | 636 | cpuset, that were on nodes in the previous setting of 'cpuset.mems', |
637 | will be moved to nodes in the new setting of 'mems.' | 637 | will be moved to nodes in the new setting of 'mems.' |
638 | Pages that were not in the tasks prior cpuset, or in the cpusets | 638 | Pages that were not in the tasks prior cpuset, or in the cpusets |
639 | prior 'mems' setting, will not be moved. | 639 | prior 'cpuset.mems' setting, will not be moved. |
640 | 640 | ||
641 | There is an exception to the above. If hotplug functionality is used | 641 | There is an exception to the above. If hotplug functionality is used |
642 | to remove all the CPUs that are currently assigned to a cpuset, | 642 | to remove all the CPUs that are currently assigned to a cpuset, |
@@ -678,8 +678,8 @@ and then start a subshell 'sh' in that cpuset: | |||
678 | cd /dev/cpuset | 678 | cd /dev/cpuset |
679 | mkdir Charlie | 679 | mkdir Charlie |
680 | cd Charlie | 680 | cd Charlie |
681 | /bin/echo 2-3 > cpus | 681 | /bin/echo 2-3 > cpuset.cpus |
682 | /bin/echo 1 > mems | 682 | /bin/echo 1 > cpuset.mems |
683 | /bin/echo $$ > tasks | 683 | /bin/echo $$ > tasks |
684 | sh | 684 | sh |
685 | # The subshell 'sh' is now running in cpuset Charlie | 685 | # The subshell 'sh' is now running in cpuset Charlie |
@@ -725,10 +725,13 @@ Now you want to do something with this cpuset. | |||
725 | 725 | ||
726 | In this directory you can find several files: | 726 | In this directory you can find several files: |
727 | # ls | 727 | # ls |
728 | cpu_exclusive memory_migrate mems tasks | 728 | cpuset.cpu_exclusive cpuset.memory_spread_slab |
729 | cpus memory_pressure notify_on_release | 729 | cpuset.cpus cpuset.mems |
730 | mem_exclusive memory_spread_page sched_load_balance | 730 | cpuset.mem_exclusive cpuset.sched_load_balance |
731 | mem_hardwall memory_spread_slab sched_relax_domain_level | 731 | cpuset.mem_hardwall cpuset.sched_relax_domain_level |
732 | cpuset.memory_migrate notify_on_release | ||
733 | cpuset.memory_pressure tasks | ||
734 | cpuset.memory_spread_page | ||
732 | 735 | ||
733 | Reading them will give you information about the state of this cpuset: | 736 | Reading them will give you information about the state of this cpuset: |
734 | the CPUs and Memory Nodes it can use, the processes that are using | 737 | the CPUs and Memory Nodes it can use, the processes that are using |
@@ -736,13 +739,13 @@ it, its properties. By writing to these files you can manipulate | |||
736 | the cpuset. | 739 | the cpuset. |
737 | 740 | ||
738 | Set some flags: | 741 | Set some flags: |
739 | # /bin/echo 1 > cpu_exclusive | 742 | # /bin/echo 1 > cpuset.cpu_exclusive |
740 | 743 | ||
741 | Add some cpus: | 744 | Add some cpus: |
742 | # /bin/echo 0-7 > cpus | 745 | # /bin/echo 0-7 > cpuset.cpus |
743 | 746 | ||
744 | Add some mems: | 747 | Add some mems: |
745 | # /bin/echo 0-7 > mems | 748 | # /bin/echo 0-7 > cpuset.mems |
746 | 749 | ||
747 | Now attach your shell to this cpuset: | 750 | Now attach your shell to this cpuset: |
748 | # /bin/echo $$ > tasks | 751 | # /bin/echo $$ > tasks |
@@ -774,28 +777,28 @@ echo "/sbin/cpuset_release_agent" > /dev/cpuset/release_agent | |||
774 | This is the syntax to use when writing in the cpus or mems files | 777 | This is the syntax to use when writing in the cpus or mems files |
775 | in cpuset directories: | 778 | in cpuset directories: |
776 | 779 | ||
777 | # /bin/echo 1-4 > cpus -> set cpus list to cpus 1,2,3,4 | 780 | # /bin/echo 1-4 > cpuset.cpus -> set cpus list to cpus 1,2,3,4 |
778 | # /bin/echo 1,2,3,4 > cpus -> set cpus list to cpus 1,2,3,4 | 781 | # /bin/echo 1,2,3,4 > cpuset.cpus -> set cpus list to cpus 1,2,3,4 |
779 | 782 | ||
780 | To add a CPU to a cpuset, write the new list of CPUs including the | 783 | To add a CPU to a cpuset, write the new list of CPUs including the |
781 | CPU to be added. To add 6 to the above cpuset: | 784 | CPU to be added. To add 6 to the above cpuset: |
782 | 785 | ||
783 | # /bin/echo 1-4,6 > cpus -> set cpus list to cpus 1,2,3,4,6 | 786 | # /bin/echo 1-4,6 > cpuset.cpus -> set cpus list to cpus 1,2,3,4,6 |
784 | 787 | ||
785 | Similarly to remove a CPU from a cpuset, write the new list of CPUs | 788 | Similarly to remove a CPU from a cpuset, write the new list of CPUs |
786 | without the CPU to be removed. | 789 | without the CPU to be removed. |
787 | 790 | ||
788 | To remove all the CPUs: | 791 | To remove all the CPUs: |
789 | 792 | ||
790 | # /bin/echo "" > cpus -> clear cpus list | 793 | # /bin/echo "" > cpuset.cpus -> clear cpus list |
791 | 794 | ||
792 | 2.3 Setting flags | 795 | 2.3 Setting flags |
793 | ----------------- | 796 | ----------------- |
794 | 797 | ||
795 | The syntax is very simple: | 798 | The syntax is very simple: |
796 | 799 | ||
797 | # /bin/echo 1 > cpu_exclusive -> set flag 'cpu_exclusive' | 800 | # /bin/echo 1 > cpuset.cpu_exclusive -> set flag 'cpuset.cpu_exclusive' |
798 | # /bin/echo 0 > cpu_exclusive -> unset flag 'cpu_exclusive' | 801 | # /bin/echo 0 > cpuset.cpu_exclusive -> unset flag 'cpuset.cpu_exclusive' |
799 | 802 | ||
800 | 2.4 Attaching processes | 803 | 2.4 Attaching processes |
801 | ----------------------- | 804 | ----------------------- |
diff --git a/Documentation/cgroups/memcg_test.txt b/Documentation/cgroups/memcg_test.txt index 72db89ed0609..f7f68b2ac199 100644 --- a/Documentation/cgroups/memcg_test.txt +++ b/Documentation/cgroups/memcg_test.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | Memory Resource Controller(Memcg) Implementation Memo. | 1 | Memory Resource Controller(Memcg) Implementation Memo. |
2 | Last Updated: 2009/1/20 | 2 | Last Updated: 2010/2 |
3 | Base Kernel Version: based on 2.6.29-rc2. | 3 | Base Kernel Version: based on 2.6.33-rc7-mm(candidate for 34). |
4 | 4 | ||
5 | Because VM is getting complex (one of reasons is memcg...), memcg's behavior | 5 | Because VM is getting complex (one of reasons is memcg...), memcg's behavior |
6 | is complex. This is a document for memcg's internal behavior. | 6 | is complex. This is a document for memcg's internal behavior. |
@@ -337,7 +337,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. | |||
337 | race and lock dependency with other cgroup subsystems. | 337 | race and lock dependency with other cgroup subsystems. |
338 | 338 | ||
339 | example) | 339 | example) |
340 | # mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices | 340 | # mount -t cgroup none /cgroup -o cpuset,memory,cpu,devices |
341 | 341 | ||
342 | and do task move, mkdir, rmdir etc...under this. | 342 | and do task move, mkdir, rmdir etc...under this. |
343 | 343 | ||
@@ -348,7 +348,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. | |||
348 | 348 | ||
349 | For example, test like following is good. | 349 | For example, test like following is good. |
350 | (Shell-A) | 350 | (Shell-A) |
351 | # mount -t cgroup none /cgroup -t memory | 351 | # mount -t cgroup none /cgroup -o memory |
352 | # mkdir /cgroup/test | 352 | # mkdir /cgroup/test |
353 | # echo 40M > /cgroup/test/memory.limit_in_bytes | 353 | # echo 40M > /cgroup/test/memory.limit_in_bytes |
354 | # echo 0 > /cgroup/test/tasks | 354 | # echo 0 > /cgroup/test/tasks |
@@ -378,3 +378,42 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. | |||
378 | #echo 50M > memory.limit_in_bytes | 378 | #echo 50M > memory.limit_in_bytes |
379 | #echo 50M > memory.memsw.limit_in_bytes | 379 | #echo 50M > memory.memsw.limit_in_bytes |
380 | run 51M of malloc | 380 | run 51M of malloc |
381 | |||
382 | 9.9 Move charges at task migration | ||
383 | Charges associated with a task can be moved along with task migration. | ||
384 | |||
385 | (Shell-A) | ||
386 | #mkdir /cgroup/A | ||
387 | #echo $$ >/cgroup/A/tasks | ||
388 | run some programs which uses some amount of memory in /cgroup/A. | ||
389 | |||
390 | (Shell-B) | ||
391 | #mkdir /cgroup/B | ||
392 | #echo 1 >/cgroup/B/memory.move_charge_at_immigrate | ||
393 | #echo "pid of the program running in group A" >/cgroup/B/tasks | ||
394 | |||
395 | You can see charges have been moved by reading *.usage_in_bytes or | ||
396 | memory.stat of both A and B. | ||
397 | See 8.2 of Documentation/cgroups/memory.txt to see what value should be | ||
398 | written to move_charge_at_immigrate. | ||
399 | |||
400 | 9.10 Memory thresholds | ||
401 | Memory controler implements memory thresholds using cgroups notification | ||
402 | API. You can use Documentation/cgroups/cgroup_event_listener.c to test | ||
403 | it. | ||
404 | |||
405 | (Shell-A) Create cgroup and run event listener | ||
406 | # mkdir /cgroup/A | ||
407 | # ./cgroup_event_listener /cgroup/A/memory.usage_in_bytes 5M | ||
408 | |||
409 | (Shell-B) Add task to cgroup and try to allocate and free memory | ||
410 | # echo $$ >/cgroup/A/tasks | ||
411 | # a="$(dd if=/dev/zero bs=1M count=10)" | ||
412 | # a= | ||
413 | |||
414 | You will see message from cgroup_event_listener every time you cross | ||
415 | the thresholds. | ||
416 | |||
417 | Use /cgroup/A/memory.memsw.usage_in_bytes to test memsw thresholds. | ||
418 | |||
419 | It's good idea to test root cgroup as well. | ||
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index b871f2552b45..3a6aecd078ba 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -182,6 +182,8 @@ list. | |||
182 | NOTE: Reclaim does not work for the root cgroup, since we cannot set any | 182 | NOTE: Reclaim does not work for the root cgroup, since we cannot set any |
183 | limits on the root cgroup. | 183 | limits on the root cgroup. |
184 | 184 | ||
185 | Note2: When panic_on_oom is set to "2", the whole system will panic. | ||
186 | |||
185 | 2. Locking | 187 | 2. Locking |
186 | 188 | ||
187 | The memory controller uses the following hierarchy | 189 | The memory controller uses the following hierarchy |
@@ -262,10 +264,12 @@ some of the pages cached in the cgroup (page cache pages). | |||
262 | 4.2 Task migration | 264 | 4.2 Task migration |
263 | 265 | ||
264 | When a task migrates from one cgroup to another, it's charge is not | 266 | When a task migrates from one cgroup to another, it's charge is not |
265 | carried forward. The pages allocated from the original cgroup still | 267 | carried forward by default. The pages allocated from the original cgroup still |
266 | remain charged to it, the charge is dropped when the page is freed or | 268 | remain charged to it, the charge is dropped when the page is freed or |
267 | reclaimed. | 269 | reclaimed. |
268 | 270 | ||
271 | Note: You can move charges of a task along with task migration. See 8. | ||
272 | |||
269 | 4.3 Removing a cgroup | 273 | 4.3 Removing a cgroup |
270 | 274 | ||
271 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a | 275 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a |
@@ -336,7 +340,7 @@ Note: | |||
336 | 5.3 swappiness | 340 | 5.3 swappiness |
337 | Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. | 341 | Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. |
338 | 342 | ||
339 | Following cgroups' swapiness can't be changed. | 343 | Following cgroups' swappiness can't be changed. |
340 | - root cgroup (uses /proc/sys/vm/swappiness). | 344 | - root cgroup (uses /proc/sys/vm/swappiness). |
341 | - a cgroup which uses hierarchy and it has child cgroup. | 345 | - a cgroup which uses hierarchy and it has child cgroup. |
342 | - a cgroup which uses hierarchy and not the root of hierarchy. | 346 | - a cgroup which uses hierarchy and not the root of hierarchy. |
@@ -377,7 +381,8 @@ The feature can be disabled by | |||
377 | NOTE1: Enabling/disabling will fail if the cgroup already has other | 381 | NOTE1: Enabling/disabling will fail if the cgroup already has other |
378 | cgroups created below it. | 382 | cgroups created below it. |
379 | 383 | ||
380 | NOTE2: This feature can be enabled/disabled per subtree. | 384 | NOTE2: When panic_on_oom is set to "2", the whole system will panic in |
385 | case of an oom event in any cgroup. | ||
381 | 386 | ||
382 | 7. Soft limits | 387 | 7. Soft limits |
383 | 388 | ||
@@ -414,7 +419,76 @@ NOTE1: Soft limits take effect over a long period of time, since they involve | |||
414 | NOTE2: It is recommended to set the soft limit always below the hard limit, | 419 | NOTE2: It is recommended to set the soft limit always below the hard limit, |
415 | otherwise the hard limit will take precedence. | 420 | otherwise the hard limit will take precedence. |
416 | 421 | ||
417 | 8. TODO | 422 | 8. Move charges at task migration |
423 | |||
424 | Users can move charges associated with a task along with task migration, that | ||
425 | is, uncharge task's pages from the old cgroup and charge them to the new cgroup. | ||
426 | This feature is not supported in !CONFIG_MMU environments because of lack of | ||
427 | page tables. | ||
428 | |||
429 | 8.1 Interface | ||
430 | |||
431 | This feature is disabled by default. It can be enabled(and disabled again) by | ||
432 | writing to memory.move_charge_at_immigrate of the destination cgroup. | ||
433 | |||
434 | If you want to enable it: | ||
435 | |||
436 | # echo (some positive value) > memory.move_charge_at_immigrate | ||
437 | |||
438 | Note: Each bits of move_charge_at_immigrate has its own meaning about what type | ||
439 | of charges should be moved. See 8.2 for details. | ||
440 | Note: Charges are moved only when you move mm->owner, IOW, a leader of a thread | ||
441 | group. | ||
442 | Note: If we cannot find enough space for the task in the destination cgroup, we | ||
443 | try to make space by reclaiming memory. Task migration may fail if we | ||
444 | cannot make enough space. | ||
445 | Note: It can take several seconds if you move charges in giga bytes order. | ||
446 | |||
447 | And if you want disable it again: | ||
448 | |||
449 | # echo 0 > memory.move_charge_at_immigrate | ||
450 | |||
451 | 8.2 Type of charges which can be move | ||
452 | |||
453 | Each bits of move_charge_at_immigrate has its own meaning about what type of | ||
454 | charges should be moved. | ||
455 | |||
456 | bit | what type of charges would be moved ? | ||
457 | -----+------------------------------------------------------------------------ | ||
458 | 0 | A charge of an anonymous page(or swap of it) used by the target task. | ||
459 | | Those pages and swaps must be used only by the target task. You must | ||
460 | | enable Swap Extension(see 2.4) to enable move of swap charges. | ||
461 | |||
462 | Note: Those pages and swaps must be charged to the old cgroup. | ||
463 | Note: More type of pages(e.g. file cache, shmem,) will be supported by other | ||
464 | bits in future. | ||
465 | |||
466 | 8.3 TODO | ||
467 | |||
468 | - Add support for other types of pages(e.g. file cache, shmem, etc.). | ||
469 | - Implement madvise(2) to let users decide the vma to be moved or not to be | ||
470 | moved. | ||
471 | - All of moving charge operations are done under cgroup_mutex. It's not good | ||
472 | behavior to hold the mutex too long, so we may need some trick. | ||
473 | |||
474 | 9. Memory thresholds | ||
475 | |||
476 | Memory controler implements memory thresholds using cgroups notification | ||
477 | API (see cgroups.txt). It allows to register multiple memory and memsw | ||
478 | thresholds and gets notifications when it crosses. | ||
479 | |||
480 | To register a threshold application need: | ||
481 | - create an eventfd using eventfd(2); | ||
482 | - open memory.usage_in_bytes or memory.memsw.usage_in_bytes; | ||
483 | - write string like "<event_fd> <memory.usage_in_bytes> <threshold>" to | ||
484 | cgroup.event_control. | ||
485 | |||
486 | Application will be notified through eventfd when memory usage crosses | ||
487 | threshold in any direction. | ||
488 | |||
489 | It's applicable for root and non-root cgroup. | ||
490 | |||
491 | 10. TODO | ||
418 | 492 | ||
419 | 1. Add support for accounting huge pages (as a separate controller) | 493 | 1. Add support for accounting huge pages (as a separate controller) |
420 | 2. Make per-cgroup scanner reclaim not-shared pages first | 494 | 2. Make per-cgroup scanner reclaim not-shared pages first |
diff --git a/Documentation/circular-buffers.txt b/Documentation/circular-buffers.txt new file mode 100644 index 000000000000..8117e5bf6065 --- /dev/null +++ b/Documentation/circular-buffers.txt | |||
@@ -0,0 +1,234 @@ | |||
1 | ================ | ||
2 | CIRCULAR BUFFERS | ||
3 | ================ | ||
4 | |||
5 | By: David Howells <dhowells@redhat.com> | ||
6 | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
7 | |||
8 | |||
9 | Linux provides a number of features that can be used to implement circular | ||
10 | buffering. There are two sets of such features: | ||
11 | |||
12 | (1) Convenience functions for determining information about power-of-2 sized | ||
13 | buffers. | ||
14 | |||
15 | (2) Memory barriers for when the producer and the consumer of objects in the | ||
16 | buffer don't want to share a lock. | ||
17 | |||
18 | To use these facilities, as discussed below, there needs to be just one | ||
19 | producer and just one consumer. It is possible to handle multiple producers by | ||
20 | serialising them, and to handle multiple consumers by serialising them. | ||
21 | |||
22 | |||
23 | Contents: | ||
24 | |||
25 | (*) What is a circular buffer? | ||
26 | |||
27 | (*) Measuring power-of-2 buffers. | ||
28 | |||
29 | (*) Using memory barriers with circular buffers. | ||
30 | - The producer. | ||
31 | - The consumer. | ||
32 | |||
33 | |||
34 | ========================== | ||
35 | WHAT IS A CIRCULAR BUFFER? | ||
36 | ========================== | ||
37 | |||
38 | First of all, what is a circular buffer? A circular buffer is a buffer of | ||
39 | fixed, finite size into which there are two indices: | ||
40 | |||
41 | (1) A 'head' index - the point at which the producer inserts items into the | ||
42 | buffer. | ||
43 | |||
44 | (2) A 'tail' index - the point at which the consumer finds the next item in | ||
45 | the buffer. | ||
46 | |||
47 | Typically when the tail pointer is equal to the head pointer, the buffer is | ||
48 | empty; and the buffer is full when the head pointer is one less than the tail | ||
49 | pointer. | ||
50 | |||
51 | The head index is incremented when items are added, and the tail index when | ||
52 | items are removed. The tail index should never jump the head index, and both | ||
53 | indices should be wrapped to 0 when they reach the end of the buffer, thus | ||
54 | allowing an infinite amount of data to flow through the buffer. | ||
55 | |||
56 | Typically, items will all be of the same unit size, but this isn't strictly | ||
57 | required to use the techniques below. The indices can be increased by more | ||
58 | than 1 if multiple items or variable-sized items are to be included in the | ||
59 | buffer, provided that neither index overtakes the other. The implementer must | ||
60 | be careful, however, as a region more than one unit in size may wrap the end of | ||
61 | the buffer and be broken into two segments. | ||
62 | |||
63 | |||
64 | ============================ | ||
65 | MEASURING POWER-OF-2 BUFFERS | ||
66 | ============================ | ||
67 | |||
68 | Calculation of the occupancy or the remaining capacity of an arbitrarily sized | ||
69 | circular buffer would normally be a slow operation, requiring the use of a | ||
70 | modulus (divide) instruction. However, if the buffer is of a power-of-2 size, | ||
71 | then a much quicker bitwise-AND instruction can be used instead. | ||
72 | |||
73 | Linux provides a set of macros for handling power-of-2 circular buffers. These | ||
74 | can be made use of by: | ||
75 | |||
76 | #include <linux/circ_buf.h> | ||
77 | |||
78 | The macros are: | ||
79 | |||
80 | (*) Measure the remaining capacity of a buffer: | ||
81 | |||
82 | CIRC_SPACE(head_index, tail_index, buffer_size); | ||
83 | |||
84 | This returns the amount of space left in the buffer[1] into which items | ||
85 | can be inserted. | ||
86 | |||
87 | |||
88 | (*) Measure the maximum consecutive immediate space in a buffer: | ||
89 | |||
90 | CIRC_SPACE_TO_END(head_index, tail_index, buffer_size); | ||
91 | |||
92 | This returns the amount of consecutive space left in the buffer[1] into | ||
93 | which items can be immediately inserted without having to wrap back to the | ||
94 | beginning of the buffer. | ||
95 | |||
96 | |||
97 | (*) Measure the occupancy of a buffer: | ||
98 | |||
99 | CIRC_CNT(head_index, tail_index, buffer_size); | ||
100 | |||
101 | This returns the number of items currently occupying a buffer[2]. | ||
102 | |||
103 | |||
104 | (*) Measure the non-wrapping occupancy of a buffer: | ||
105 | |||
106 | CIRC_CNT_TO_END(head_index, tail_index, buffer_size); | ||
107 | |||
108 | This returns the number of consecutive items[2] that can be extracted from | ||
109 | the buffer without having to wrap back to the beginning of the buffer. | ||
110 | |||
111 | |||
112 | Each of these macros will nominally return a value between 0 and buffer_size-1, | ||
113 | however: | ||
114 | |||
115 | [1] CIRC_SPACE*() are intended to be used in the producer. To the producer | ||
116 | they will return a lower bound as the producer controls the head index, | ||
117 | but the consumer may still be depleting the buffer on another CPU and | ||
118 | moving the tail index. | ||
119 | |||
120 | To the consumer it will show an upper bound as the producer may be busy | ||
121 | depleting the space. | ||
122 | |||
123 | [2] CIRC_CNT*() are intended to be used in the consumer. To the consumer they | ||
124 | will return a lower bound as the consumer controls the tail index, but the | ||
125 | producer may still be filling the buffer on another CPU and moving the | ||
126 | head index. | ||
127 | |||
128 | To the producer it will show an upper bound as the consumer may be busy | ||
129 | emptying the buffer. | ||
130 | |||
131 | [3] To a third party, the order in which the writes to the indices by the | ||
132 | producer and consumer become visible cannot be guaranteed as they are | ||
133 | independent and may be made on different CPUs - so the result in such a | ||
134 | situation will merely be a guess, and may even be negative. | ||
135 | |||
136 | |||
137 | =========================================== | ||
138 | USING MEMORY BARRIERS WITH CIRCULAR BUFFERS | ||
139 | =========================================== | ||
140 | |||
141 | By using memory barriers in conjunction with circular buffers, you can avoid | ||
142 | the need to: | ||
143 | |||
144 | (1) use a single lock to govern access to both ends of the buffer, thus | ||
145 | allowing the buffer to be filled and emptied at the same time; and | ||
146 | |||
147 | (2) use atomic counter operations. | ||
148 | |||
149 | There are two sides to this: the producer that fills the buffer, and the | ||
150 | consumer that empties it. Only one thing should be filling a buffer at any one | ||
151 | time, and only one thing should be emptying a buffer at any one time, but the | ||
152 | two sides can operate simultaneously. | ||
153 | |||
154 | |||
155 | THE PRODUCER | ||
156 | ------------ | ||
157 | |||
158 | The producer will look something like this: | ||
159 | |||
160 | spin_lock(&producer_lock); | ||
161 | |||
162 | unsigned long head = buffer->head; | ||
163 | unsigned long tail = ACCESS_ONCE(buffer->tail); | ||
164 | |||
165 | if (CIRC_SPACE(head, tail, buffer->size) >= 1) { | ||
166 | /* insert one item into the buffer */ | ||
167 | struct item *item = buffer[head]; | ||
168 | |||
169 | produce_item(item); | ||
170 | |||
171 | smp_wmb(); /* commit the item before incrementing the head */ | ||
172 | |||
173 | buffer->head = (head + 1) & (buffer->size - 1); | ||
174 | |||
175 | /* wake_up() will make sure that the head is committed before | ||
176 | * waking anyone up */ | ||
177 | wake_up(consumer); | ||
178 | } | ||
179 | |||
180 | spin_unlock(&producer_lock); | ||
181 | |||
182 | This will instruct the CPU that the contents of the new item must be written | ||
183 | before the head index makes it available to the consumer and then instructs the | ||
184 | CPU that the revised head index must be written before the consumer is woken. | ||
185 | |||
186 | Note that wake_up() doesn't have to be the exact mechanism used, but whatever | ||
187 | is used must guarantee a (write) memory barrier between the update of the head | ||
188 | index and the change of state of the consumer, if a change of state occurs. | ||
189 | |||
190 | |||
191 | THE CONSUMER | ||
192 | ------------ | ||
193 | |||
194 | The consumer will look something like this: | ||
195 | |||
196 | spin_lock(&consumer_lock); | ||
197 | |||
198 | unsigned long head = ACCESS_ONCE(buffer->head); | ||
199 | unsigned long tail = buffer->tail; | ||
200 | |||
201 | if (CIRC_CNT(head, tail, buffer->size) >= 1) { | ||
202 | /* read index before reading contents at that index */ | ||
203 | smp_read_barrier_depends(); | ||
204 | |||
205 | /* extract one item from the buffer */ | ||
206 | struct item *item = buffer[tail]; | ||
207 | |||
208 | consume_item(item); | ||
209 | |||
210 | smp_mb(); /* finish reading descriptor before incrementing tail */ | ||
211 | |||
212 | buffer->tail = (tail + 1) & (buffer->size - 1); | ||
213 | } | ||
214 | |||
215 | spin_unlock(&consumer_lock); | ||
216 | |||
217 | This will instruct the CPU to make sure the index is up to date before reading | ||
218 | the new item, and then it shall make sure the CPU has finished reading the item | ||
219 | before it writes the new tail pointer, which will erase the item. | ||
220 | |||
221 | |||
222 | Note the use of ACCESS_ONCE() in both algorithms to read the opposition index. | ||
223 | This prevents the compiler from discarding and reloading its cached value - | ||
224 | which some compilers will do across smp_read_barrier_depends(). This isn't | ||
225 | strictly needed if you can be sure that the opposition index will _only_ be | ||
226 | used the once. | ||
227 | |||
228 | |||
229 | =============== | ||
230 | FURTHER READING | ||
231 | =============== | ||
232 | |||
233 | See also Documentation/memory-barriers.txt for a description of Linux's memory | ||
234 | barrier facilities. | ||
diff --git a/Documentation/console/console.txt b/Documentation/console/console.txt index 877a1b26cc3d..926cf1b5e63e 100644 --- a/Documentation/console/console.txt +++ b/Documentation/console/console.txt | |||
@@ -74,7 +74,7 @@ driver takes over the consoles vacated by the driver. Binding, on the other | |||
74 | hand, will bind the driver to the consoles that are currently occupied by a | 74 | hand, will bind the driver to the consoles that are currently occupied by a |
75 | system driver. | 75 | system driver. |
76 | 76 | ||
77 | NOTE1: Binding and binding must be selected in Kconfig. It's under: | 77 | NOTE1: Binding and unbinding must be selected in Kconfig. It's under: |
78 | 78 | ||
79 | Device Drivers -> Character devices -> Support for binding and unbinding | 79 | Device Drivers -> Character devices -> Support for binding and unbinding |
80 | console drivers | 80 | console drivers |
diff --git a/Documentation/cpu-freq/pcc-cpufreq.txt b/Documentation/cpu-freq/pcc-cpufreq.txt new file mode 100644 index 000000000000..9e3c3b33514c --- /dev/null +++ b/Documentation/cpu-freq/pcc-cpufreq.txt | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * pcc-cpufreq.txt - PCC interface documentation | ||
3 | * | ||
4 | * Copyright (C) 2009 Red Hat, Matthew Garrett <mjg@redhat.com> | ||
5 | * Copyright (C) 2009 Hewlett-Packard Development Company, L.P. | ||
6 | * Nagananda Chumbalkar <nagananda.chumbalkar@hp.com> | ||
7 | * | ||
8 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; version 2 of the License. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, but | ||
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or NON | ||
17 | * INFRINGEMENT. See the GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | * | ||
23 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
24 | */ | ||
25 | |||
26 | |||
27 | Processor Clocking Control Driver | ||
28 | --------------------------------- | ||
29 | |||
30 | Contents: | ||
31 | --------- | ||
32 | 1. Introduction | ||
33 | 1.1 PCC interface | ||
34 | 1.1.1 Get Average Frequency | ||
35 | 1.1.2 Set Desired Frequency | ||
36 | 1.2 Platforms affected | ||
37 | 2. Driver and /sys details | ||
38 | 2.1 scaling_available_frequencies | ||
39 | 2.2 cpuinfo_transition_latency | ||
40 | 2.3 cpuinfo_cur_freq | ||
41 | 2.4 related_cpus | ||
42 | 3. Caveats | ||
43 | |||
44 | 1. Introduction: | ||
45 | ---------------- | ||
46 | Processor Clocking Control (PCC) is an interface between the platform | ||
47 | firmware and OSPM. It is a mechanism for coordinating processor | ||
48 | performance (ie: frequency) between the platform firmware and the OS. | ||
49 | |||
50 | The PCC driver (pcc-cpufreq) allows OSPM to take advantage of the PCC | ||
51 | interface. | ||
52 | |||
53 | OS utilizes the PCC interface to inform platform firmware what frequency the | ||
54 | OS wants for a logical processor. The platform firmware attempts to achieve | ||
55 | the requested frequency. If the request for the target frequency could not be | ||
56 | satisfied by platform firmware, then it usually means that power budget | ||
57 | conditions are in place, and "power capping" is taking place. | ||
58 | |||
59 | 1.1 PCC interface: | ||
60 | ------------------ | ||
61 | The complete PCC specification is available here: | ||
62 | http://www.acpica.org/download/Processor-Clocking-Control-v1p0.pdf | ||
63 | |||
64 | PCC relies on a shared memory region that provides a channel for communication | ||
65 | between the OS and platform firmware. PCC also implements a "doorbell" that | ||
66 | is used by the OS to inform the platform firmware that a command has been | ||
67 | sent. | ||
68 | |||
69 | The ACPI PCCH() method is used to discover the location of the PCC shared | ||
70 | memory region. The shared memory region header contains the "command" and | ||
71 | "status" interface. PCCH() also contains details on how to access the platform | ||
72 | doorbell. | ||
73 | |||
74 | The following commands are supported by the PCC interface: | ||
75 | * Get Average Frequency | ||
76 | * Set Desired Frequency | ||
77 | |||
78 | The ACPI PCCP() method is implemented for each logical processor and is | ||
79 | used to discover the offsets for the input and output buffers in the shared | ||
80 | memory region. | ||
81 | |||
82 | When PCC mode is enabled, the platform will not expose processor performance | ||
83 | or throttle states (_PSS, _TSS and related ACPI objects) to OSPM. Therefore, | ||
84 | the native P-state driver (such as acpi-cpufreq for Intel, powernow-k8 for | ||
85 | AMD) will not load. | ||
86 | |||
87 | However, OSPM remains in control of policy. The governor (eg: "ondemand") | ||
88 | computes the required performance for each processor based on server workload. | ||
89 | The PCC driver fills in the command interface, and the input buffer and | ||
90 | communicates the request to the platform firmware. The platform firmware is | ||
91 | responsible for delivering the requested performance. | ||
92 | |||
93 | Each PCC command is "global" in scope and can affect all the logical CPUs in | ||
94 | the system. Therefore, PCC is capable of performing "group" updates. With PCC | ||
95 | the OS is capable of getting/setting the frequency of all the logical CPUs in | ||
96 | the system with a single call to the BIOS. | ||
97 | |||
98 | 1.1.1 Get Average Frequency: | ||
99 | ---------------------------- | ||
100 | This command is used by the OSPM to query the running frequency of the | ||
101 | processor since the last time this command was completed. The output buffer | ||
102 | indicates the average unhalted frequency of the logical processor expressed as | ||
103 | a percentage of the nominal (ie: maximum) CPU frequency. The output buffer | ||
104 | also signifies if the CPU frequency is limited by a power budget condition. | ||
105 | |||
106 | 1.1.2 Set Desired Frequency: | ||
107 | ---------------------------- | ||
108 | This command is used by the OSPM to communicate to the platform firmware the | ||
109 | desired frequency for a logical processor. The output buffer is currently | ||
110 | ignored by OSPM. The next invocation of "Get Average Frequency" will inform | ||
111 | OSPM if the desired frequency was achieved or not. | ||
112 | |||
113 | 1.2 Platforms affected: | ||
114 | ----------------------- | ||
115 | The PCC driver will load on any system where the platform firmware: | ||
116 | * supports the PCC interface, and the associated PCCH() and PCCP() methods | ||
117 | * assumes responsibility for managing the hardware clocking controls in order | ||
118 | to deliver the requested processor performance | ||
119 | |||
120 | Currently, certain HP ProLiant platforms implement the PCC interface. On those | ||
121 | platforms PCC is the "default" choice. | ||
122 | |||
123 | However, it is possible to disable this interface via a BIOS setting. In | ||
124 | such an instance, as is also the case on platforms where the PCC interface | ||
125 | is not implemented, the PCC driver will fail to load silently. | ||
126 | |||
127 | 2. Driver and /sys details: | ||
128 | --------------------------- | ||
129 | When the driver loads, it merely prints the lowest and the highest CPU | ||
130 | frequencies supported by the platform firmware. | ||
131 | |||
132 | The PCC driver loads with a message such as: | ||
133 | pcc-cpufreq: (v1.00.00) driver loaded with frequency limits: 1600 MHz, 2933 | ||
134 | MHz | ||
135 | |||
136 | This means that the OPSM can request the CPU to run at any frequency in | ||
137 | between the limits (1600 MHz, and 2933 MHz) specified in the message. | ||
138 | |||
139 | Internally, there is no need for the driver to convert the "target" frequency | ||
140 | to a corresponding P-state. | ||
141 | |||
142 | The VERSION number for the driver will be of the format v.xy.ab. | ||
143 | eg: 1.00.02 | ||
144 | ----- -- | ||
145 | | | | ||
146 | | -- this will increase with bug fixes/enhancements to the driver | ||
147 | |-- this is the version of the PCC specification the driver adheres to | ||
148 | |||
149 | |||
150 | The following is a brief discussion on some of the fields exported via the | ||
151 | /sys filesystem and how their values are affected by the PCC driver: | ||
152 | |||
153 | 2.1 scaling_available_frequencies: | ||
154 | ---------------------------------- | ||
155 | scaling_available_frequencies is not created in /sys. No intermediate | ||
156 | frequencies need to be listed because the BIOS will try to achieve any | ||
157 | frequency, within limits, requested by the governor. A frequency does not have | ||
158 | to be strictly associated with a P-state. | ||
159 | |||
160 | 2.2 cpuinfo_transition_latency: | ||
161 | ------------------------------- | ||
162 | The cpuinfo_transition_latency field is 0. The PCC specification does | ||
163 | not include a field to expose this value currently. | ||
164 | |||
165 | 2.3 cpuinfo_cur_freq: | ||
166 | --------------------- | ||
167 | A) Often cpuinfo_cur_freq will show a value different than what is declared | ||
168 | in the scaling_available_frequencies or scaling_cur_freq, or scaling_max_freq. | ||
169 | This is due to "turbo boost" available on recent Intel processors. If certain | ||
170 | conditions are met the BIOS can achieve a slightly higher speed than requested | ||
171 | by OSPM. An example: | ||
172 | |||
173 | scaling_cur_freq : 2933000 | ||
174 | cpuinfo_cur_freq : 3196000 | ||
175 | |||
176 | B) There is a round-off error associated with the cpuinfo_cur_freq value. | ||
177 | Since the driver obtains the current frequency as a "percentage" (%) of the | ||
178 | nominal frequency from the BIOS, sometimes, the values displayed by | ||
179 | scaling_cur_freq and cpuinfo_cur_freq may not match. An example: | ||
180 | |||
181 | scaling_cur_freq : 1600000 | ||
182 | cpuinfo_cur_freq : 1583000 | ||
183 | |||
184 | In this example, the nominal frequency is 2933 MHz. The driver obtains the | ||
185 | current frequency, cpuinfo_cur_freq, as 54% of the nominal frequency: | ||
186 | |||
187 | 54% of 2933 MHz = 1583 MHz | ||
188 | |||
189 | Nominal frequency is the maximum frequency of the processor, and it usually | ||
190 | corresponds to the frequency of the P0 P-state. | ||
191 | |||
192 | 2.4 related_cpus: | ||
193 | ----------------- | ||
194 | The related_cpus field is identical to affected_cpus. | ||
195 | |||
196 | affected_cpus : 4 | ||
197 | related_cpus : 4 | ||
198 | |||
199 | Currently, the PCC driver does not evaluate _PSD. The platforms that support | ||
200 | PCC do not implement SW_ALL. So OSPM doesn't need to perform any coordination | ||
201 | to ensure that the same frequency is requested of all dependent CPUs. | ||
202 | |||
203 | 3. Caveats: | ||
204 | ----------- | ||
205 | The "cpufreq_stats" module in its present form cannot be loaded and | ||
206 | expected to work with the PCC driver. Since the "cpufreq_stats" module | ||
207 | provides information wrt each P-state, it is not applicable to the PCC driver. | ||
diff --git a/Documentation/device-mapper/snapshot.txt b/Documentation/device-mapper/snapshot.txt index e3a77b215135..0d5bc46dc167 100644 --- a/Documentation/device-mapper/snapshot.txt +++ b/Documentation/device-mapper/snapshot.txt | |||
@@ -122,3 +122,47 @@ volumeGroup-base: 0 2097152 snapshot-merge 254:11 254:12 P 16 | |||
122 | brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real | 122 | brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real |
123 | brw------- 1 root root 254, 12 29 ago 18:16 /dev/mapper/volumeGroup-base-cow | 123 | brw------- 1 root root 254, 12 29 ago 18:16 /dev/mapper/volumeGroup-base-cow |
124 | brw------- 1 root root 254, 10 29 ago 18:16 /dev/mapper/volumeGroup-base | 124 | brw------- 1 root root 254, 10 29 ago 18:16 /dev/mapper/volumeGroup-base |
125 | |||
126 | |||
127 | How to determine when a merging is complete | ||
128 | =========================================== | ||
129 | The snapshot-merge and snapshot status lines end with: | ||
130 | <sectors_allocated>/<total_sectors> <metadata_sectors> | ||
131 | |||
132 | Both <sectors_allocated> and <total_sectors> include both data and metadata. | ||
133 | During merging, the number of sectors allocated gets smaller and | ||
134 | smaller. Merging has finished when the number of sectors holding data | ||
135 | is zero, in other words <sectors_allocated> == <metadata_sectors>. | ||
136 | |||
137 | Here is a practical example (using a hybrid of lvm and dmsetup commands): | ||
138 | |||
139 | # lvs | ||
140 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | ||
141 | base volumeGroup owi-a- 4.00g | ||
142 | snap volumeGroup swi-a- 1.00g base 18.97 | ||
143 | |||
144 | # dmsetup status volumeGroup-snap | ||
145 | 0 8388608 snapshot 397896/2097152 1560 | ||
146 | ^^^^ metadata sectors | ||
147 | |||
148 | # lvconvert --merge -b volumeGroup/snap | ||
149 | Merging of volume snap started. | ||
150 | |||
151 | # lvs volumeGroup/snap | ||
152 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | ||
153 | base volumeGroup Owi-a- 4.00g 17.23 | ||
154 | |||
155 | # dmsetup status volumeGroup-base | ||
156 | 0 8388608 snapshot-merge 281688/2097152 1104 | ||
157 | |||
158 | # dmsetup status volumeGroup-base | ||
159 | 0 8388608 snapshot-merge 180480/2097152 712 | ||
160 | |||
161 | # dmsetup status volumeGroup-base | ||
162 | 0 8388608 snapshot-merge 16/2097152 16 | ||
163 | |||
164 | Merging has finished. | ||
165 | |||
166 | # lvs | ||
167 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | ||
168 | base volumeGroup owi-a- 4.00g | ||
diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt index 2e2c2ea90ceb..41f41632ee55 100644 --- a/Documentation/driver-model/platform.txt +++ b/Documentation/driver-model/platform.txt | |||
@@ -192,7 +192,7 @@ command line. This will execute all matching early_param() callbacks. | |||
192 | User specified early platform devices will be registered at this point. | 192 | User specified early platform devices will be registered at this point. |
193 | For the early serial console case the user can specify port on the | 193 | For the early serial console case the user can specify port on the |
194 | kernel command line as "earlyprintk=serial.0" where "earlyprintk" is | 194 | kernel command line as "earlyprintk=serial.0" where "earlyprintk" is |
195 | the class string, "serial" is the name of the platfrom driver and | 195 | the class string, "serial" is the name of the platform driver and |
196 | 0 is the platform device id. If the id is -1 then the dot and the | 196 | 0 is the platform device id. If the id is -1 then the dot and the |
197 | id can be omitted. | 197 | id can be omitted. |
198 | 198 | ||
diff --git a/Documentation/eisa.txt b/Documentation/eisa.txt index 60e361ba08c0..f297fc1202ae 100644 --- a/Documentation/eisa.txt +++ b/Documentation/eisa.txt | |||
@@ -171,7 +171,7 @@ device. | |||
171 | virtual_root.force_probe : | 171 | virtual_root.force_probe : |
172 | 172 | ||
173 | Force the probing code to probe EISA slots even when it cannot find an | 173 | Force the probing code to probe EISA slots even when it cannot find an |
174 | EISA compliant mainboard (nothing appears on slot 0). Defaultd to 0 | 174 | EISA compliant mainboard (nothing appears on slot 0). Defaults to 0 |
175 | (don't force), and set to 1 (force probing) when either | 175 | (don't force), and set to 1 (force probing) when either |
176 | CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. | 176 | CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. |
177 | 177 | ||
diff --git a/Documentation/email-clients.txt b/Documentation/email-clients.txt index a618efab7b15..945ff3fda433 100644 --- a/Documentation/email-clients.txt +++ b/Documentation/email-clients.txt | |||
@@ -216,26 +216,14 @@ Works. Use "Insert file..." or external editor. | |||
216 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 216 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
217 | Gmail (Web GUI) | 217 | Gmail (Web GUI) |
218 | 218 | ||
219 | If you just have to use Gmail to send patches, it CAN be made to work. It | 219 | Does not work for sending patches. |
220 | requires a bit of external help, though. | 220 | |
221 | 221 | Gmail web client converts tabs to spaces automatically. | |
222 | The first problem is that Gmail converts tabs to spaces. This will | 222 | |
223 | totally break your patches. To prevent this, you have to use a different | 223 | At the same time it wraps lines every 78 chars with CRLF style line breaks |
224 | editor. There is a firefox extension called "ViewSourceWith" | 224 | although tab2space problem can be solved with external editor. |
225 | (https://addons.mozilla.org/en-US/firefox/addon/394) which allows you to | 225 | |
226 | edit any text box in the editor of your choice. Configure it to launch | 226 | Another problem is that Gmail will base64-encode any message that has a |
227 | your favorite editor. When you want to send a patch, use this technique. | 227 | non-ASCII character. That includes things like European names. |
228 | Once you have crafted your messsage + patch, save and exit the editor, | ||
229 | which should reload the Gmail edit box. GMAIL WILL PRESERVE THE TABS. | ||
230 | Hoorah. Apparently you can cut-n-paste literal tabs, but Gmail will | ||
231 | convert those to spaces upon sending! | ||
232 | |||
233 | The second problem is that Gmail converts tabs to spaces on replies. If | ||
234 | you reply to a patch, don't expect to be able to apply it as a patch. | ||
235 | |||
236 | The last problem is that Gmail will base64-encode any message that has a | ||
237 | non-ASCII character. That includes things like European names. Be aware. | ||
238 | |||
239 | Gmail is not convenient for lkml patches, but CAN be made to work. | ||
240 | 228 | ||
241 | ### | 229 | ### |
diff --git a/Documentation/fault-injection/provoke-crashes.txt b/Documentation/fault-injection/provoke-crashes.txt new file mode 100644 index 000000000000..7a9d3d81525b --- /dev/null +++ b/Documentation/fault-injection/provoke-crashes.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | The lkdtm module provides an interface to crash or injure the kernel at | ||
2 | predefined crashpoints to evaluate the reliability of crash dumps obtained | ||
3 | using different dumping solutions. The module uses KPROBEs to instrument | ||
4 | crashing points, but can also crash the kernel directly without KRPOBE | ||
5 | support. | ||
6 | |||
7 | |||
8 | You can provide the way either through module arguments when inserting | ||
9 | the module, or through a debugfs interface. | ||
10 | |||
11 | Usage: insmod lkdtm.ko [recur_count={>0}] cpoint_name=<> cpoint_type=<> | ||
12 | [cpoint_count={>0}] | ||
13 | |||
14 | recur_count : Recursion level for the stack overflow test. Default is 10. | ||
15 | |||
16 | cpoint_name : Crash point where the kernel is to be crashed. It can be | ||
17 | one of INT_HARDWARE_ENTRY, INT_HW_IRQ_EN, INT_TASKLET_ENTRY, | ||
18 | FS_DEVRW, MEM_SWAPOUT, TIMERADD, SCSI_DISPATCH_CMD, | ||
19 | IDE_CORE_CP, DIRECT | ||
20 | |||
21 | cpoint_type : Indicates the action to be taken on hitting the crash point. | ||
22 | It can be one of PANIC, BUG, EXCEPTION, LOOP, OVERFLOW, | ||
23 | CORRUPT_STACK, UNALIGNED_LOAD_STORE_WRITE, OVERWRITE_ALLOCATION, | ||
24 | WRITE_AFTER_FREE, | ||
25 | |||
26 | cpoint_count : Indicates the number of times the crash point is to be hit | ||
27 | to trigger an action. The default is 10. | ||
28 | |||
29 | You can also induce failures by mounting debugfs and writing the type to | ||
30 | <mountpoint>/provoke-crash/<crashpoint>. E.g., | ||
31 | |||
32 | mount -t debugfs debugfs /mnt | ||
33 | echo EXCEPTION > /mnt/provoke-crash/INT_HARDWARE_ENTRY | ||
34 | |||
35 | |||
36 | A special file is `DIRECT' which will induce the crash directly without | ||
37 | KPROBE instrumentation. This mode is the only one available when the module | ||
38 | is built on a kernel without KPROBEs support. | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 73ef30dbe612..ed511af0f79a 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -117,19 +117,25 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org> | |||
117 | --------------------------- | 117 | --------------------------- |
118 | 118 | ||
119 | What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) | 119 | What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) |
120 | When: November 2005 | 120 | When: 2.6.35/2.6.36 |
121 | Files: drivers/pcmcia/: pcmcia_ioctl.c | 121 | Files: drivers/pcmcia/: pcmcia_ioctl.c |
122 | Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a | 122 | Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a |
123 | normal hotpluggable bus, and with it using the default kernel | 123 | normal hotpluggable bus, and with it using the default kernel |
124 | infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA | 124 | infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA |
125 | control ioctl needed by cardmgr and cardctl from pcmcia-cs is | 125 | control ioctl needed by cardmgr and cardctl from pcmcia-cs is |
126 | unnecessary, and makes further cleanups and integration of the | 126 | unnecessary and potentially harmful (it does not provide for |
127 | proper locking), and makes further cleanups and integration of the | ||
127 | PCMCIA subsystem into the Linux kernel device driver model more | 128 | PCMCIA subsystem into the Linux kernel device driver model more |
128 | difficult. The features provided by cardmgr and cardctl are either | 129 | difficult. The features provided by cardmgr and cardctl are either |
129 | handled by the kernel itself now or are available in the new | 130 | handled by the kernel itself now or are available in the new |
130 | pcmciautils package available at | 131 | pcmciautils package available at |
131 | http://kernel.org/pub/linux/utils/kernel/pcmcia/ | 132 | http://kernel.org/pub/linux/utils/kernel/pcmcia/ |
132 | Who: Dominik Brodowski <linux@brodo.de> | 133 | |
134 | For all architectures except ARM, the associated config symbol | ||
135 | has been removed from kernel 2.6.34; for ARM, it will be likely | ||
136 | be removed from kernel 2.6.35. The actual code will then likely | ||
137 | be removed from kernel 2.6.36. | ||
138 | Who: Dominik Brodowski <linux@dominikbrodowski.net> | ||
133 | 139 | ||
134 | --------------------------- | 140 | --------------------------- |
135 | 141 | ||
@@ -443,12 +449,6 @@ Who: Alok N Kataria <akataria@vmware.com> | |||
443 | 449 | ||
444 | ---------------------------- | 450 | ---------------------------- |
445 | 451 | ||
446 | What: adt7473 hardware monitoring driver | ||
447 | When: February 2010 | ||
448 | Why: Obsoleted by the adt7475 driver. | ||
449 | Who: Jean Delvare <khali@linux-fr.org> | ||
450 | |||
451 | --------------------------- | ||
452 | What: Support for lcd_switch and display_get in asus-laptop driver | 452 | What: Support for lcd_switch and display_get in asus-laptop driver |
453 | When: March 2010 | 453 | When: March 2010 |
454 | Why: These two features use non-standard interfaces. There are the | 454 | Why: These two features use non-standard interfaces. There are the |
@@ -550,3 +550,42 @@ Why: udev fully replaces this special file system that only contains CAPI | |||
550 | NCCI TTY device nodes. User space (pppdcapiplugin) works without | 550 | NCCI TTY device nodes. User space (pppdcapiplugin) works without |
551 | noticing the difference. | 551 | noticing the difference. |
552 | Who: Jan Kiszka <jan.kiszka@web.de> | 552 | Who: Jan Kiszka <jan.kiszka@web.de> |
553 | |||
554 | ---------------------------- | ||
555 | |||
556 | What: KVM memory aliases support | ||
557 | When: July 2010 | ||
558 | Why: Memory aliasing support is used for speeding up guest vga access | ||
559 | through the vga windows. | ||
560 | |||
561 | Modern userspace no longer uses this feature, so it's just bitrotted | ||
562 | code and can be removed with no impact. | ||
563 | Who: Avi Kivity <avi@redhat.com> | ||
564 | |||
565 | ---------------------------- | ||
566 | |||
567 | What: KVM kernel-allocated memory slots | ||
568 | When: July 2010 | ||
569 | Why: Since 2.6.25, kvm supports user-allocated memory slots, which are | ||
570 | much more flexible than kernel-allocated slots. All current userspace | ||
571 | supports the newer interface and this code can be removed with no | ||
572 | impact. | ||
573 | Who: Avi Kivity <avi@redhat.com> | ||
574 | |||
575 | ---------------------------- | ||
576 | |||
577 | What: KVM paravirt mmu host support | ||
578 | When: January 2011 | ||
579 | Why: The paravirt mmu host support is slower than non-paravirt mmu, both | ||
580 | on newer and older hardware. It is already not exposed to the guest, | ||
581 | and kept only for live migration purposes. | ||
582 | Who: Avi Kivity <avi@redhat.com> | ||
583 | |||
584 | ---------------------------- | ||
585 | |||
586 | What: "acpi=ht" boot option | ||
587 | When: 2.6.35 | ||
588 | Why: Useful in 2003, implementation is a hack. | ||
589 | Generally invoked by accident today. | ||
590 | Seen as doing more harm than good. | ||
591 | Who: Len Brown <len.brown@intel.com> | ||
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX index 875d49696b6e..4303614b5add 100644 --- a/Documentation/filesystems/00-INDEX +++ b/Documentation/filesystems/00-INDEX | |||
@@ -16,6 +16,8 @@ befs.txt | |||
16 | - information about the BeOS filesystem for Linux. | 16 | - information about the BeOS filesystem for Linux. |
17 | bfs.txt | 17 | bfs.txt |
18 | - info for the SCO UnixWare Boot Filesystem (BFS). | 18 | - info for the SCO UnixWare Boot Filesystem (BFS). |
19 | ceph.txt | ||
20 | - info for the Ceph Distributed File System | ||
19 | cifs.txt | 21 | cifs.txt |
20 | - description of the CIFS filesystem. | 22 | - description of the CIFS filesystem. |
21 | coda.txt | 23 | coda.txt |
@@ -32,6 +34,8 @@ dlmfs.txt | |||
32 | - info on the userspace interface to the OCFS2 DLM. | 34 | - info on the userspace interface to the OCFS2 DLM. |
33 | dnotify.txt | 35 | dnotify.txt |
34 | - info about directory notification in Linux. | 36 | - info about directory notification in Linux. |
37 | dnotify_test.c | ||
38 | - example program for dnotify | ||
35 | ecryptfs.txt | 39 | ecryptfs.txt |
36 | - docs on eCryptfs: stacked cryptographic filesystem for Linux. | 40 | - docs on eCryptfs: stacked cryptographic filesystem for Linux. |
37 | exofs.txt | 41 | exofs.txt |
@@ -62,6 +66,8 @@ jfs.txt | |||
62 | - info and mount options for the JFS filesystem. | 66 | - info and mount options for the JFS filesystem. |
63 | locks.txt | 67 | locks.txt |
64 | - info on file locking implementations, flock() vs. fcntl(), etc. | 68 | - info on file locking implementations, flock() vs. fcntl(), etc. |
69 | logfs.txt | ||
70 | - info on the LogFS flash filesystem. | ||
65 | mandatory-locking.txt | 71 | mandatory-locking.txt |
66 | - info on the Linux implementation of Sys V mandatory file locking. | 72 | - info on the Linux implementation of Sys V mandatory file locking. |
67 | ncpfs.txt | 73 | ncpfs.txt |
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 18b9d0ca0630..06bbbed71206 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -460,13 +460,6 @@ in sys_read() and friends. | |||
460 | 460 | ||
461 | --------------------------- dquot_operations ------------------------------- | 461 | --------------------------- dquot_operations ------------------------------- |
462 | prototypes: | 462 | prototypes: |
463 | int (*initialize) (struct inode *, int); | ||
464 | int (*drop) (struct inode *); | ||
465 | int (*alloc_space) (struct inode *, qsize_t, int); | ||
466 | int (*alloc_inode) (const struct inode *, unsigned long); | ||
467 | int (*free_space) (struct inode *, qsize_t); | ||
468 | int (*free_inode) (const struct inode *, unsigned long); | ||
469 | int (*transfer) (struct inode *, struct iattr *); | ||
470 | int (*write_dquot) (struct dquot *); | 463 | int (*write_dquot) (struct dquot *); |
471 | int (*acquire_dquot) (struct dquot *); | 464 | int (*acquire_dquot) (struct dquot *); |
472 | int (*release_dquot) (struct dquot *); | 465 | int (*release_dquot) (struct dquot *); |
@@ -479,13 +472,6 @@ a proper locking wrt the filesystem and call the generic quota operations. | |||
479 | What filesystem should expect from the generic quota functions: | 472 | What filesystem should expect from the generic quota functions: |
480 | 473 | ||
481 | FS recursion Held locks when called | 474 | FS recursion Held locks when called |
482 | initialize: yes maybe dqonoff_sem | ||
483 | drop: yes - | ||
484 | alloc_space: ->mark_dirty() - | ||
485 | alloc_inode: ->mark_dirty() - | ||
486 | free_space: ->mark_dirty() - | ||
487 | free_inode: ->mark_dirty() - | ||
488 | transfer: yes - | ||
489 | write_dquot: yes dqonoff_sem or dqptr_sem | 475 | write_dquot: yes dqonoff_sem or dqptr_sem |
490 | acquire_dquot: yes dqonoff_sem or dqptr_sem | 476 | acquire_dquot: yes dqonoff_sem or dqptr_sem |
491 | release_dquot: yes dqonoff_sem or dqptr_sem | 477 | release_dquot: yes dqonoff_sem or dqptr_sem |
@@ -495,10 +481,6 @@ write_info: yes dqonoff_sem | |||
495 | FS recursion means calling ->quota_read() and ->quota_write() from superblock | 481 | FS recursion means calling ->quota_read() and ->quota_write() from superblock |
496 | operations. | 482 | operations. |
497 | 483 | ||
498 | ->alloc_space(), ->alloc_inode(), ->free_space(), ->free_inode() are called | ||
499 | only directly by the filesystem and do not call any fs functions only | ||
500 | the ->mark_dirty() operation. | ||
501 | |||
502 | More details about quota locking can be found in fs/dquot.c. | 484 | More details about quota locking can be found in fs/dquot.c. |
503 | 485 | ||
504 | --------------------------- vm_operations_struct ----------------------------- | 486 | --------------------------- vm_operations_struct ----------------------------- |
diff --git a/Documentation/filesystems/Makefile b/Documentation/filesystems/Makefile new file mode 100644 index 000000000000..a5dd114da14f --- /dev/null +++ b/Documentation/filesystems/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := dnotify_test | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/filesystems/ceph.txt b/Documentation/filesystems/ceph.txt new file mode 100644 index 000000000000..0660c9f5deef --- /dev/null +++ b/Documentation/filesystems/ceph.txt | |||
@@ -0,0 +1,140 @@ | |||
1 | Ceph Distributed File System | ||
2 | ============================ | ||
3 | |||
4 | Ceph is a distributed network file system designed to provide good | ||
5 | performance, reliability, and scalability. | ||
6 | |||
7 | Basic features include: | ||
8 | |||
9 | * POSIX semantics | ||
10 | * Seamless scaling from 1 to many thousands of nodes | ||
11 | * High availability and reliability. No single point of failure. | ||
12 | * N-way replication of data across storage nodes | ||
13 | * Fast recovery from node failures | ||
14 | * Automatic rebalancing of data on node addition/removal | ||
15 | * Easy deployment: most FS components are userspace daemons | ||
16 | |||
17 | Also, | ||
18 | * Flexible snapshots (on any directory) | ||
19 | * Recursive accounting (nested files, directories, bytes) | ||
20 | |||
21 | In contrast to cluster filesystems like GFS, OCFS2, and GPFS that rely | ||
22 | on symmetric access by all clients to shared block devices, Ceph | ||
23 | separates data and metadata management into independent server | ||
24 | clusters, similar to Lustre. Unlike Lustre, however, metadata and | ||
25 | storage nodes run entirely as user space daemons. Storage nodes | ||
26 | utilize btrfs to store data objects, leveraging its advanced features | ||
27 | (checksumming, metadata replication, etc.). File data is striped | ||
28 | across storage nodes in large chunks to distribute workload and | ||
29 | facilitate high throughputs. When storage nodes fail, data is | ||
30 | re-replicated in a distributed fashion by the storage nodes themselves | ||
31 | (with some minimal coordination from a cluster monitor), making the | ||
32 | system extremely efficient and scalable. | ||
33 | |||
34 | Metadata servers effectively form a large, consistent, distributed | ||
35 | in-memory cache above the file namespace that is extremely scalable, | ||
36 | dynamically redistributes metadata in response to workload changes, | ||
37 | and can tolerate arbitrary (well, non-Byzantine) node failures. The | ||
38 | metadata server takes a somewhat unconventional approach to metadata | ||
39 | storage to significantly improve performance for common workloads. In | ||
40 | particular, inodes with only a single link are embedded in | ||
41 | directories, allowing entire directories of dentries and inodes to be | ||
42 | loaded into its cache with a single I/O operation. The contents of | ||
43 | extremely large directories can be fragmented and managed by | ||
44 | independent metadata servers, allowing scalable concurrent access. | ||
45 | |||
46 | The system offers automatic data rebalancing/migration when scaling | ||
47 | from a small cluster of just a few nodes to many hundreds, without | ||
48 | requiring an administrator carve the data set into static volumes or | ||
49 | go through the tedious process of migrating data between servers. | ||
50 | When the file system approaches full, new nodes can be easily added | ||
51 | and things will "just work." | ||
52 | |||
53 | Ceph includes flexible snapshot mechanism that allows a user to create | ||
54 | a snapshot on any subdirectory (and its nested contents) in the | ||
55 | system. Snapshot creation and deletion are as simple as 'mkdir | ||
56 | .snap/foo' and 'rmdir .snap/foo'. | ||
57 | |||
58 | Ceph also provides some recursive accounting on directories for nested | ||
59 | files and bytes. That is, a 'getfattr -d foo' on any directory in the | ||
60 | system will reveal the total number of nested regular files and | ||
61 | subdirectories, and a summation of all nested file sizes. This makes | ||
62 | the identification of large disk space consumers relatively quick, as | ||
63 | no 'du' or similar recursive scan of the file system is required. | ||
64 | |||
65 | |||
66 | Mount Syntax | ||
67 | ============ | ||
68 | |||
69 | The basic mount syntax is: | ||
70 | |||
71 | # mount -t ceph monip[:port][,monip2[:port]...]:/[subdir] mnt | ||
72 | |||
73 | You only need to specify a single monitor, as the client will get the | ||
74 | full list when it connects. (However, if the monitor you specify | ||
75 | happens to be down, the mount won't succeed.) The port can be left | ||
76 | off if the monitor is using the default. So if the monitor is at | ||
77 | 1.2.3.4, | ||
78 | |||
79 | # mount -t ceph 1.2.3.4:/ /mnt/ceph | ||
80 | |||
81 | is sufficient. If /sbin/mount.ceph is installed, a hostname can be | ||
82 | used instead of an IP address. | ||
83 | |||
84 | |||
85 | |||
86 | Mount Options | ||
87 | ============= | ||
88 | |||
89 | ip=A.B.C.D[:N] | ||
90 | Specify the IP and/or port the client should bind to locally. | ||
91 | There is normally not much reason to do this. If the IP is not | ||
92 | specified, the client's IP address is determined by looking at the | ||
93 | address it's connection to the monitor originates from. | ||
94 | |||
95 | wsize=X | ||
96 | Specify the maximum write size in bytes. By default there is no | ||
97 | maximum. Ceph will normally size writes based on the file stripe | ||
98 | size. | ||
99 | |||
100 | rsize=X | ||
101 | Specify the maximum readahead. | ||
102 | |||
103 | mount_timeout=X | ||
104 | Specify the timeout value for mount (in seconds), in the case | ||
105 | of a non-responsive Ceph file system. The default is 30 | ||
106 | seconds. | ||
107 | |||
108 | rbytes | ||
109 | When stat() is called on a directory, set st_size to 'rbytes', | ||
110 | the summation of file sizes over all files nested beneath that | ||
111 | directory. This is the default. | ||
112 | |||
113 | norbytes | ||
114 | When stat() is called on a directory, set st_size to the | ||
115 | number of entries in that directory. | ||
116 | |||
117 | nocrc | ||
118 | Disable CRC32C calculation for data writes. If set, the storage node | ||
119 | must rely on TCP's error correction to detect data corruption | ||
120 | in the data payload. | ||
121 | |||
122 | noasyncreaddir | ||
123 | Disable client's use its local cache to satisfy readdir | ||
124 | requests. (This does not change correctness; the client uses | ||
125 | cached metadata only when a lease or capability ensures it is | ||
126 | valid.) | ||
127 | |||
128 | |||
129 | More Information | ||
130 | ================ | ||
131 | |||
132 | For more information on Ceph, see the home page at | ||
133 | http://ceph.newdream.net/ | ||
134 | |||
135 | The Linux kernel client source tree is available at | ||
136 | git://ceph.newdream.net/git/ceph-client.git | ||
137 | git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git | ||
138 | |||
139 | and the source for the full system is at | ||
140 | git://ceph.newdream.net/git/ceph.git | ||
diff --git a/Documentation/filesystems/dnotify.txt b/Documentation/filesystems/dnotify.txt index 9f5d338ddbb8..6baf88f46859 100644 --- a/Documentation/filesystems/dnotify.txt +++ b/Documentation/filesystems/dnotify.txt | |||
@@ -62,38 +62,9 @@ disabled, fcntl(fd, F_NOTIFY, ...) will return -EINVAL. | |||
62 | 62 | ||
63 | Example | 63 | Example |
64 | ------- | 64 | ------- |
65 | See Documentation/filesystems/dnotify_test.c for an example. | ||
65 | 66 | ||
66 | #define _GNU_SOURCE /* needed to get the defines */ | 67 | NOTE |
67 | #include <fcntl.h> /* in glibc 2.2 this has the needed | 68 | ---- |
68 | values defined */ | 69 | Beginning with Linux 2.6.13, dnotify has been replaced by inotify. |
69 | #include <signal.h> | 70 | See Documentation/filesystems/inotify.txt for more information on it. |
70 | #include <stdio.h> | ||
71 | #include <unistd.h> | ||
72 | |||
73 | static volatile int event_fd; | ||
74 | |||
75 | static void handler(int sig, siginfo_t *si, void *data) | ||
76 | { | ||
77 | event_fd = si->si_fd; | ||
78 | } | ||
79 | |||
80 | int main(void) | ||
81 | { | ||
82 | struct sigaction act; | ||
83 | int fd; | ||
84 | |||
85 | act.sa_sigaction = handler; | ||
86 | sigemptyset(&act.sa_mask); | ||
87 | act.sa_flags = SA_SIGINFO; | ||
88 | sigaction(SIGRTMIN + 1, &act, NULL); | ||
89 | |||
90 | fd = open(".", O_RDONLY); | ||
91 | fcntl(fd, F_SETSIG, SIGRTMIN + 1); | ||
92 | fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT); | ||
93 | /* we will now be notified if any of the files | ||
94 | in "." is modified or new files are created */ | ||
95 | while (1) { | ||
96 | pause(); | ||
97 | printf("Got event on fd=%d\n", event_fd); | ||
98 | } | ||
99 | } | ||
diff --git a/Documentation/filesystems/dnotify_test.c b/Documentation/filesystems/dnotify_test.c new file mode 100644 index 000000000000..8b37b4a1e18d --- /dev/null +++ b/Documentation/filesystems/dnotify_test.c | |||
@@ -0,0 +1,34 @@ | |||
1 | #define _GNU_SOURCE /* needed to get the defines */ | ||
2 | #include <fcntl.h> /* in glibc 2.2 this has the needed | ||
3 | values defined */ | ||
4 | #include <signal.h> | ||
5 | #include <stdio.h> | ||
6 | #include <unistd.h> | ||
7 | |||
8 | static volatile int event_fd; | ||
9 | |||
10 | static void handler(int sig, siginfo_t *si, void *data) | ||
11 | { | ||
12 | event_fd = si->si_fd; | ||
13 | } | ||
14 | |||
15 | int main(void) | ||
16 | { | ||
17 | struct sigaction act; | ||
18 | int fd; | ||
19 | |||
20 | act.sa_sigaction = handler; | ||
21 | sigemptyset(&act.sa_mask); | ||
22 | act.sa_flags = SA_SIGINFO; | ||
23 | sigaction(SIGRTMIN + 1, &act, NULL); | ||
24 | |||
25 | fd = open(".", O_RDONLY); | ||
26 | fcntl(fd, F_SETSIG, SIGRTMIN + 1); | ||
27 | fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT); | ||
28 | /* we will now be notified if any of the files | ||
29 | in "." is modified or new files are created */ | ||
30 | while (1) { | ||
31 | pause(); | ||
32 | printf("Got event on fd=%d\n", event_fd); | ||
33 | } | ||
34 | } | ||
diff --git a/Documentation/filesystems/logfs.txt b/Documentation/filesystems/logfs.txt new file mode 100644 index 000000000000..e64c94ba401a --- /dev/null +++ b/Documentation/filesystems/logfs.txt | |||
@@ -0,0 +1,241 @@ | |||
1 | |||
2 | The LogFS Flash Filesystem | ||
3 | ========================== | ||
4 | |||
5 | Specification | ||
6 | ============= | ||
7 | |||
8 | Superblocks | ||
9 | ----------- | ||
10 | |||
11 | Two superblocks exist at the beginning and end of the filesystem. | ||
12 | Each superblock is 256 Bytes large, with another 3840 Bytes reserved | ||
13 | for future purposes, making a total of 4096 Bytes. | ||
14 | |||
15 | Superblock locations may differ for MTD and block devices. On MTD the | ||
16 | first non-bad block contains a superblock in the first 4096 Bytes and | ||
17 | the last non-bad block contains a superblock in the last 4096 Bytes. | ||
18 | On block devices, the first 4096 Bytes of the device contain the first | ||
19 | superblock and the last aligned 4096 Byte-block contains the second | ||
20 | superblock. | ||
21 | |||
22 | For the most part, the superblocks can be considered read-only. They | ||
23 | are written only to correct errors detected within the superblocks, | ||
24 | move the journal and change the filesystem parameters through tunefs. | ||
25 | As a result, the superblock does not contain any fields that require | ||
26 | constant updates, like the amount of free space, etc. | ||
27 | |||
28 | Segments | ||
29 | -------- | ||
30 | |||
31 | The space in the device is split up into equal-sized segments. | ||
32 | Segments are the primary write unit of LogFS. Within each segments, | ||
33 | writes happen from front (low addresses) to back (high addresses. If | ||
34 | only a partial segment has been written, the segment number, the | ||
35 | current position within and optionally a write buffer are stored in | ||
36 | the journal. | ||
37 | |||
38 | Segments are erased as a whole. Therefore Garbage Collection may be | ||
39 | required to completely free a segment before doing so. | ||
40 | |||
41 | Journal | ||
42 | -------- | ||
43 | |||
44 | The journal contains all global information about the filesystem that | ||
45 | is subject to frequent change. At mount time, it has to be scanned | ||
46 | for the most recent commit entry, which contains a list of pointers to | ||
47 | all currently valid entries. | ||
48 | |||
49 | Object Store | ||
50 | ------------ | ||
51 | |||
52 | All space except for the superblocks and journal is part of the object | ||
53 | store. Each segment contains a segment header and a number of | ||
54 | objects, each consisting of the object header and the payload. | ||
55 | Objects are either inodes, directory entries (dentries), file data | ||
56 | blocks or indirect blocks. | ||
57 | |||
58 | Levels | ||
59 | ------ | ||
60 | |||
61 | Garbage collection (GC) may fail if all data is written | ||
62 | indiscriminately. One requirement of GC is that data is seperated | ||
63 | roughly according to the distance between the tree root and the data. | ||
64 | Effectively that means all file data is on level 0, indirect blocks | ||
65 | are on levels 1, 2, 3 4 or 5 for 1x, 2x, 3x, 4x or 5x indirect blocks, | ||
66 | respectively. Inode file data is on level 6 for the inodes and 7-11 | ||
67 | for indirect blocks. | ||
68 | |||
69 | Each segment contains objects of a single level only. As a result, | ||
70 | each level requires its own seperate segment to be open for writing. | ||
71 | |||
72 | Inode File | ||
73 | ---------- | ||
74 | |||
75 | All inodes are stored in a special file, the inode file. Single | ||
76 | exception is the inode file's inode (master inode) which for obvious | ||
77 | reasons is stored in the journal instead. Instead of data blocks, the | ||
78 | leaf nodes of the inode files are inodes. | ||
79 | |||
80 | Aliases | ||
81 | ------- | ||
82 | |||
83 | Writes in LogFS are done by means of a wandering tree. A naïve | ||
84 | implementation would require that for each write or a block, all | ||
85 | parent blocks are written as well, since the block pointers have | ||
86 | changed. Such an implementation would not be very efficient. | ||
87 | |||
88 | In LogFS, the block pointer changes are cached in the journal by means | ||
89 | of alias entries. Each alias consists of its logical address - inode | ||
90 | number, block index, level and child number (index into block) - and | ||
91 | the changed data. Any 8-byte word can be changes in this manner. | ||
92 | |||
93 | Currently aliases are used for block pointers, file size, file used | ||
94 | bytes and the height of an inodes indirect tree. | ||
95 | |||
96 | Segment Aliases | ||
97 | --------------- | ||
98 | |||
99 | Related to regular aliases, these are used to handle bad blocks. | ||
100 | Initially, bad blocks are handled by moving the affected segment | ||
101 | content to a spare segment and noting this move in the journal with a | ||
102 | segment alias, a simple (to, from) tupel. GC will later empty this | ||
103 | segment and the alias can be removed again. This is used on MTD only. | ||
104 | |||
105 | Vim | ||
106 | --- | ||
107 | |||
108 | By cleverly predicting the life time of data, it is possible to | ||
109 | seperate long-living data from short-living data and thereby reduce | ||
110 | the GC overhead later. Each type of distinc life expectency (vim) can | ||
111 | have a seperate segment open for writing. Each (level, vim) tupel can | ||
112 | be open just once. If an open segment with unknown vim is encountered | ||
113 | at mount time, it is closed and ignored henceforth. | ||
114 | |||
115 | Indirect Tree | ||
116 | ------------- | ||
117 | |||
118 | Inodes in LogFS are similar to FFS-style filesystems with direct and | ||
119 | indirect block pointers. One difference is that LogFS uses a single | ||
120 | indirect pointer that can be either a 1x, 2x, etc. indirect pointer. | ||
121 | A height field in the inode defines the height of the indirect tree | ||
122 | and thereby the indirection of the pointer. | ||
123 | |||
124 | Another difference is the addressing of indirect blocks. In LogFS, | ||
125 | the first 16 pointers in the first indirect block are left empty, | ||
126 | corresponding to the 16 direct pointers in the inode. In ext2 (maybe | ||
127 | others as well) the first pointer in the first indirect block | ||
128 | corresponds to logical block 12, skipping the 12 direct pointers. | ||
129 | So where ext2 is using arithmetic to better utilize space, LogFS keeps | ||
130 | arithmetic simple and uses compression to save space. | ||
131 | |||
132 | Compression | ||
133 | ----------- | ||
134 | |||
135 | Both file data and metadata can be compressed. Compression for file | ||
136 | data can be enabled with chattr +c and disabled with chattr -c. Doing | ||
137 | so has no effect on existing data, but new data will be stored | ||
138 | accordingly. New inodes will inherit the compression flag of the | ||
139 | parent directory. | ||
140 | |||
141 | Metadata is always compressed. However, the space accounting ignores | ||
142 | this and charges for the uncompressed size. Failing to do so could | ||
143 | result in GC failures when, after moving some data, indirect blocks | ||
144 | compress worse than previously. Even on a 100% full medium, GC may | ||
145 | not consume any extra space, so the compression gains are lost space | ||
146 | to the user. | ||
147 | |||
148 | However, they are not lost space to the filesystem internals. By | ||
149 | cheating the user for those bytes, the filesystem gained some slack | ||
150 | space and GC will run less often and faster. | ||
151 | |||
152 | Garbage Collection and Wear Leveling | ||
153 | ------------------------------------ | ||
154 | |||
155 | Garbage collection is invoked whenever the number of free segments | ||
156 | falls below a threshold. The best (known) candidate is picked based | ||
157 | on the least amount of valid data contained in the segment. All | ||
158 | remaining valid data is copied elsewhere, thereby invalidating it. | ||
159 | |||
160 | The GC code also checks for aliases and writes then back if their | ||
161 | number gets too large. | ||
162 | |||
163 | Wear leveling is done by occasionally picking a suboptimal segment for | ||
164 | garbage collection. If a stale segments erase count is significantly | ||
165 | lower than the active segments' erase counts, it will be picked. Wear | ||
166 | leveling is rate limited, so it will never monopolize the device for | ||
167 | more than one segment worth at a time. | ||
168 | |||
169 | Values for "occasionally", "significantly lower" are compile time | ||
170 | constants. | ||
171 | |||
172 | Hashed directories | ||
173 | ------------------ | ||
174 | |||
175 | To satisfy efficient lookup(), directory entries are hashed and | ||
176 | located based on the hash. In order to both support large directories | ||
177 | and not be overly inefficient for small directories, several hash | ||
178 | tables of increasing size are used. For each table, the hash value | ||
179 | modulo the table size gives the table index. | ||
180 | |||
181 | Tables sizes are chosen to limit the number of indirect blocks with a | ||
182 | fully populated table to 0, 1, 2 or 3 respectively. So the first | ||
183 | table contains 16 entries, the second 512-16, etc. | ||
184 | |||
185 | The last table is special in several ways. First its size depends on | ||
186 | the effective 32bit limit on telldir/seekdir cookies. Since logfs | ||
187 | uses the upper half of the address space for indirect blocks, the size | ||
188 | is limited to 2^31. Secondly the table contains hash buckets with 16 | ||
189 | entries each. | ||
190 | |||
191 | Using single-entry buckets would result in birthday "attacks". At | ||
192 | just 2^16 used entries, hash collisions would be likely (P >= 0.5). | ||
193 | My math skills are insufficient to do the combinatorics for the 17x | ||
194 | collisions necessary to overflow a bucket, but testing showed that in | ||
195 | 10,000 runs the lowest directory fill before a bucket overflow was | ||
196 | 188,057,130 entries with an average of 315,149,915 entries. So for | ||
197 | directory sizes of up to a million, bucket overflows should be | ||
198 | virtually impossible under normal circumstances. | ||
199 | |||
200 | With carefully chosen filenames, it is obviously possible to cause an | ||
201 | overflow with just 21 entries (4 higher tables + 16 entries + 1). So | ||
202 | there may be a security concern if a malicious user has write access | ||
203 | to a directory. | ||
204 | |||
205 | Open For Discussion | ||
206 | =================== | ||
207 | |||
208 | Device Address Space | ||
209 | -------------------- | ||
210 | |||
211 | A device address space is used for caching. Both block devices and | ||
212 | MTD provide functions to either read a single page or write a segment. | ||
213 | Partial segments may be written for data integrity, but where possible | ||
214 | complete segments are written for performance on simple block device | ||
215 | flash media. | ||
216 | |||
217 | Meta Inodes | ||
218 | ----------- | ||
219 | |||
220 | Inodes are stored in the inode file, which is just a regular file for | ||
221 | most purposes. At umount time, however, the inode file needs to | ||
222 | remain open until all dirty inodes are written. So | ||
223 | generic_shutdown_super() may not close this inode, but shouldn't | ||
224 | complain about remaining inodes due to the inode file either. Same | ||
225 | goes for mapping inode of the device address space. | ||
226 | |||
227 | Currently logfs uses a hack that essentially copies part of fs/inode.c | ||
228 | code over. A general solution would be preferred. | ||
229 | |||
230 | Indirect block mapping | ||
231 | ---------------------- | ||
232 | |||
233 | With compression, the block device (or mapping inode) cannot be used | ||
234 | to cache indirect blocks. Some other place is required. Currently | ||
235 | logfs uses the top half of each inode's address space. The low 8TB | ||
236 | (on 32bit) are filled with file data, the high 8TB are used for | ||
237 | indirect blocks. | ||
238 | |||
239 | One problem is that 16TB files created on 64bit systems actually have | ||
240 | data in the top 8TB. But files >16TB would cause problems anyway, so | ||
241 | only the limit has changed. | ||
diff --git a/Documentation/filesystems/nfs/nfs41-server.txt b/Documentation/filesystems/nfs/nfs41-server.txt index 1bd0d0c05171..6a53a84afc72 100644 --- a/Documentation/filesystems/nfs/nfs41-server.txt +++ b/Documentation/filesystems/nfs/nfs41-server.txt | |||
@@ -17,8 +17,7 @@ kernels must turn 4.1 on or off *before* turning support for version 4 | |||
17 | on or off; rpc.nfsd does this correctly.) | 17 | on or off; rpc.nfsd does this correctly.) |
18 | 18 | ||
19 | The NFSv4 minorversion 1 (NFSv4.1) implementation in nfsd is based | 19 | The NFSv4 minorversion 1 (NFSv4.1) implementation in nfsd is based |
20 | on the latest NFSv4.1 Internet Draft: | 20 | on RFC 5661. |
21 | http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-29 | ||
22 | 21 | ||
23 | From the many new features in NFSv4.1 the current implementation | 22 | From the many new features in NFSv4.1 the current implementation |
24 | focuses on the mandatory-to-implement NFSv4.1 Sessions, providing | 23 | focuses on the mandatory-to-implement NFSv4.1 Sessions, providing |
@@ -44,7 +43,7 @@ interoperability problems with future clients. Known issues: | |||
44 | trunking, but this is a mandatory feature, and its use is | 43 | trunking, but this is a mandatory feature, and its use is |
45 | recommended to clients in a number of places. (E.g. to ensure | 44 | recommended to clients in a number of places. (E.g. to ensure |
46 | timely renewal in case an existing connection's retry timeouts | 45 | timely renewal in case an existing connection's retry timeouts |
47 | have gotten too long; see section 8.3 of the draft.) | 46 | have gotten too long; see section 8.3 of the RFC.) |
48 | Therefore, lack of this feature may cause future clients to | 47 | Therefore, lack of this feature may cause future clients to |
49 | fail. | 48 | fail. |
50 | - Incomplete backchannel support: incomplete backchannel gss | 49 | - Incomplete backchannel support: incomplete backchannel gss |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 0d07513a67a6..a4f30faa4f1f 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -164,6 +164,7 @@ read the file /proc/PID/status: | |||
164 | VmExe: 68 kB | 164 | VmExe: 68 kB |
165 | VmLib: 1412 kB | 165 | VmLib: 1412 kB |
166 | VmPTE: 20 kb | 166 | VmPTE: 20 kb |
167 | VmSwap: 0 kB | ||
167 | Threads: 1 | 168 | Threads: 1 |
168 | SigQ: 0/28578 | 169 | SigQ: 0/28578 |
169 | SigPnd: 0000000000000000 | 170 | SigPnd: 0000000000000000 |
@@ -188,7 +189,13 @@ memory usage. Its seven fields are explained in Table 1-3. The stat file | |||
188 | contains details information about the process itself. Its fields are | 189 | contains details information about the process itself. Its fields are |
189 | explained in Table 1-4. | 190 | explained in Table 1-4. |
190 | 191 | ||
191 | Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | 192 | (for SMP CONFIG users) |
193 | For making accounting scalable, RSS related information are handled in | ||
194 | asynchronous manner and the vaule may not be very precise. To see a precise | ||
195 | snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table. | ||
196 | It's slow but very precise. | ||
197 | |||
198 | Table 1-2: Contents of the status files (as of 2.6.30-rc7) | ||
192 | .............................................................................. | 199 | .............................................................................. |
193 | Field Content | 200 | Field Content |
194 | Name filename of the executable | 201 | Name filename of the executable |
@@ -213,6 +220,7 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | |||
213 | VmExe size of text segment | 220 | VmExe size of text segment |
214 | VmLib size of shared library code | 221 | VmLib size of shared library code |
215 | VmPTE size of page table entries | 222 | VmPTE size of page table entries |
223 | VmSwap size of swap usage (the number of referred swapents) | ||
216 | Threads number of threads | 224 | Threads number of threads |
217 | SigQ number of signals queued/max. number for queue | 225 | SigQ number of signals queued/max. number for queue |
218 | SigPnd bitmap of pending signals for the thread | 226 | SigPnd bitmap of pending signals for the thread |
@@ -430,6 +438,7 @@ Table 1-5: Kernel info in /proc | |||
430 | modules List of loaded modules | 438 | modules List of loaded modules |
431 | mounts Mounted filesystems | 439 | mounts Mounted filesystems |
432 | net Networking info (see text) | 440 | net Networking info (see text) |
441 | pagetypeinfo Additional page allocator information (see text) (2.5) | ||
433 | partitions Table of partitions known to the system | 442 | partitions Table of partitions known to the system |
434 | pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, | 443 | pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, |
435 | decoupled by lspci (2.4) | 444 | decoupled by lspci (2.4) |
@@ -584,7 +593,7 @@ Node 0, zone DMA 0 4 5 4 4 3 ... | |||
584 | Node 0, zone Normal 1 0 0 1 101 8 ... | 593 | Node 0, zone Normal 1 0 0 1 101 8 ... |
585 | Node 0, zone HighMem 2 0 0 1 1 0 ... | 594 | Node 0, zone HighMem 2 0 0 1 1 0 ... |
586 | 595 | ||
587 | Memory fragmentation is a problem under some workloads, and buddyinfo is a | 596 | External fragmentation is a problem under some workloads, and buddyinfo is a |
588 | useful tool for helping diagnose these problems. Buddyinfo will give you a | 597 | useful tool for helping diagnose these problems. Buddyinfo will give you a |
589 | clue as to how big an area you can safely allocate, or why a previous | 598 | clue as to how big an area you can safely allocate, or why a previous |
590 | allocation failed. | 599 | allocation failed. |
@@ -594,6 +603,48 @@ available. In this case, there are 0 chunks of 2^0*PAGE_SIZE available in | |||
594 | ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE | 603 | ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE |
595 | available in ZONE_NORMAL, etc... | 604 | available in ZONE_NORMAL, etc... |
596 | 605 | ||
606 | More information relevant to external fragmentation can be found in | ||
607 | pagetypeinfo. | ||
608 | |||
609 | > cat /proc/pagetypeinfo | ||
610 | Page block order: 9 | ||
611 | Pages per block: 512 | ||
612 | |||
613 | Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10 | ||
614 | Node 0, zone DMA, type Unmovable 0 0 0 1 1 1 1 1 1 1 0 | ||
615 | Node 0, zone DMA, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0 | ||
616 | Node 0, zone DMA, type Movable 1 1 2 1 2 1 1 0 1 0 2 | ||
617 | Node 0, zone DMA, type Reserve 0 0 0 0 0 0 0 0 0 1 0 | ||
618 | Node 0, zone DMA, type Isolate 0 0 0 0 0 0 0 0 0 0 0 | ||
619 | Node 0, zone DMA32, type Unmovable 103 54 77 1 1 1 11 8 7 1 9 | ||
620 | Node 0, zone DMA32, type Reclaimable 0 0 2 1 0 0 0 0 1 0 0 | ||
621 | Node 0, zone DMA32, type Movable 169 152 113 91 77 54 39 13 6 1 452 | ||
622 | Node 0, zone DMA32, type Reserve 1 2 2 2 2 0 1 1 1 1 0 | ||
623 | Node 0, zone DMA32, type Isolate 0 0 0 0 0 0 0 0 0 0 0 | ||
624 | |||
625 | Number of blocks type Unmovable Reclaimable Movable Reserve Isolate | ||
626 | Node 0, zone DMA 2 0 5 1 0 | ||
627 | Node 0, zone DMA32 41 6 967 2 0 | ||
628 | |||
629 | Fragmentation avoidance in the kernel works by grouping pages of different | ||
630 | migrate types into the same contiguous regions of memory called page blocks. | ||
631 | A page block is typically the size of the default hugepage size e.g. 2MB on | ||
632 | X86-64. By keeping pages grouped based on their ability to move, the kernel | ||
633 | can reclaim pages within a page block to satisfy a high-order allocation. | ||
634 | |||
635 | The pagetypinfo begins with information on the size of a page block. It | ||
636 | then gives the same type of information as buddyinfo except broken down | ||
637 | by migrate-type and finishes with details on how many page blocks of each | ||
638 | type exist. | ||
639 | |||
640 | If min_free_kbytes has been tuned correctly (recommendations made by hugeadm | ||
641 | from libhugetlbfs http://sourceforge.net/projects/libhugetlbfs/), one can | ||
642 | make an estimate of the likely number of huge pages that can be allocated | ||
643 | at a given point in time. All the "Movable" blocks should be allocatable | ||
644 | unless memory has been mlock()'d. Some of the Reclaimable blocks should | ||
645 | also be allocatable although a lot of filesystem metadata may have to be | ||
646 | reclaimed to achieve this. | ||
647 | |||
597 | .............................................................................. | 648 | .............................................................................. |
598 | 649 | ||
599 | meminfo: | 650 | meminfo: |
diff --git a/Documentation/filesystems/sharedsubtree.txt b/Documentation/filesystems/sharedsubtree.txt index 23a181074f94..fc0e39af43c3 100644 --- a/Documentation/filesystems/sharedsubtree.txt +++ b/Documentation/filesystems/sharedsubtree.txt | |||
@@ -837,6 +837,9 @@ replicas continue to be exactly same. | |||
837 | individual lists does not affect propagation or the way propagation | 837 | individual lists does not affect propagation or the way propagation |
838 | tree is modified by operations. | 838 | tree is modified by operations. |
839 | 839 | ||
840 | All vfsmounts in a peer group have the same ->mnt_master. If it is | ||
841 | non-NULL, they form a contiguous (ordered) segment of slave list. | ||
842 | |||
840 | A example propagation tree looks as shown in the figure below. | 843 | A example propagation tree looks as shown in the figure below. |
841 | [ NOTE: Though it looks like a forest, if we consider all the shared | 844 | [ NOTE: Though it looks like a forest, if we consider all the shared |
842 | mounts as a conceptual entity called 'pnode', it becomes a tree] | 845 | mounts as a conceptual entity called 'pnode', it becomes a tree] |
@@ -874,8 +877,19 @@ replicas continue to be exactly same. | |||
874 | 877 | ||
875 | NOTE: The propagation tree is orthogonal to the mount tree. | 878 | NOTE: The propagation tree is orthogonal to the mount tree. |
876 | 879 | ||
880 | 8B Locking: | ||
881 | |||
882 | ->mnt_share, ->mnt_slave, ->mnt_slave_list, ->mnt_master are protected | ||
883 | by namespace_sem (exclusive for modifications, shared for reading). | ||
884 | |||
885 | Normally we have ->mnt_flags modifications serialized by vfsmount_lock. | ||
886 | There are two exceptions: do_add_mount() and clone_mnt(). | ||
887 | The former modifies a vfsmount that has not been visible in any shared | ||
888 | data structures yet. | ||
889 | The latter holds namespace_sem and the only references to vfsmount | ||
890 | are in lists that can't be traversed without namespace_sem. | ||
877 | 891 | ||
878 | 8B Algorithm: | 892 | 8C Algorithm: |
879 | 893 | ||
880 | The crux of the implementation resides in rbind/move operation. | 894 | The crux of the implementation resides in rbind/move operation. |
881 | 895 | ||
diff --git a/Documentation/filesystems/tmpfs.txt b/Documentation/filesystems/tmpfs.txt index 3015da0c6b2a..fe09a2cb1858 100644 --- a/Documentation/filesystems/tmpfs.txt +++ b/Documentation/filesystems/tmpfs.txt | |||
@@ -82,11 +82,13 @@ tmpfs has a mount option to set the NUMA memory allocation policy for | |||
82 | all files in that instance (if CONFIG_NUMA is enabled) - which can be | 82 | all files in that instance (if CONFIG_NUMA is enabled) - which can be |
83 | adjusted on the fly via 'mount -o remount ...' | 83 | adjusted on the fly via 'mount -o remount ...' |
84 | 84 | ||
85 | mpol=default prefers to allocate memory from the local node | 85 | mpol=default use the process allocation policy |
86 | (see set_mempolicy(2)) | ||
86 | mpol=prefer:Node prefers to allocate memory from the given Node | 87 | mpol=prefer:Node prefers to allocate memory from the given Node |
87 | mpol=bind:NodeList allocates memory only from nodes in NodeList | 88 | mpol=bind:NodeList allocates memory only from nodes in NodeList |
88 | mpol=interleave prefers to allocate from each node in turn | 89 | mpol=interleave prefers to allocate from each node in turn |
89 | mpol=interleave:NodeList allocates from each node of NodeList in turn | 90 | mpol=interleave:NodeList allocates from each node of NodeList in turn |
91 | mpol=local prefers to allocate memory from the local node | ||
90 | 92 | ||
91 | NodeList format is a comma-separated list of decimal numbers and ranges, | 93 | NodeList format is a comma-separated list of decimal numbers and ranges, |
92 | a range being two hyphen-separated decimal numbers, the smallest and | 94 | a range being two hyphen-separated decimal numbers, the smallest and |
@@ -134,3 +136,5 @@ Author: | |||
134 | Christoph Rohland <cr@sap.com>, 1.12.01 | 136 | Christoph Rohland <cr@sap.com>, 1.12.01 |
135 | Updated: | 137 | Updated: |
136 | Hugh Dickins, 4 June 2007 | 138 | Hugh Dickins, 4 June 2007 |
139 | Updated: | ||
140 | KOSAKI Motohiro, 16 Mar 2010 | ||
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index 1866c27eec69..c2c6e9b39bbe 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -253,6 +253,70 @@ pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown). | |||
253 | Also note that it's your responsibility to have stopped using a GPIO | 253 | Also note that it's your responsibility to have stopped using a GPIO |
254 | before you free it. | 254 | before you free it. |
255 | 255 | ||
256 | Considering in most cases GPIOs are actually configured right after they | ||
257 | are claimed, three additional calls are defined: | ||
258 | |||
259 | /* request a single GPIO, with initial configuration specified by | ||
260 | * 'flags', identical to gpio_request() wrt other arguments and | ||
261 | * return value | ||
262 | */ | ||
263 | int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | ||
264 | |||
265 | /* request multiple GPIOs in a single call | ||
266 | */ | ||
267 | int gpio_request_array(struct gpio *array, size_t num); | ||
268 | |||
269 | /* release multiple GPIOs in a single call | ||
270 | */ | ||
271 | void gpio_free_array(struct gpio *array, size_t num); | ||
272 | |||
273 | where 'flags' is currently defined to specify the following properties: | ||
274 | |||
275 | * GPIOF_DIR_IN - to configure direction as input | ||
276 | * GPIOF_DIR_OUT - to configure direction as output | ||
277 | |||
278 | * GPIOF_INIT_LOW - as output, set initial level to LOW | ||
279 | * GPIOF_INIT_HIGH - as output, set initial level to HIGH | ||
280 | |||
281 | since GPIOF_INIT_* are only valid when configured as output, so group valid | ||
282 | combinations as: | ||
283 | |||
284 | * GPIOF_IN - configure as input | ||
285 | * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW | ||
286 | * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH | ||
287 | |||
288 | In the future, these flags can be extended to support more properties such | ||
289 | as open-drain status. | ||
290 | |||
291 | Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is | ||
292 | introduced to encapsulate all three fields as: | ||
293 | |||
294 | struct gpio { | ||
295 | unsigned gpio; | ||
296 | unsigned long flags; | ||
297 | const char *label; | ||
298 | }; | ||
299 | |||
300 | A typical example of usage: | ||
301 | |||
302 | static struct gpio leds_gpios[] = { | ||
303 | { 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */ | ||
304 | { 33, GPIOF_OUT_INIT_LOW, "Green LED" }, /* default to OFF */ | ||
305 | { 34, GPIOF_OUT_INIT_LOW, "Red LED" }, /* default to OFF */ | ||
306 | { 35, GPIOF_OUT_INIT_LOW, "Blue LED" }, /* default to OFF */ | ||
307 | { ... }, | ||
308 | }; | ||
309 | |||
310 | err = gpio_request_one(31, GPIOF_IN, "Reset Button"); | ||
311 | if (err) | ||
312 | ... | ||
313 | |||
314 | err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios)); | ||
315 | if (err) | ||
316 | ... | ||
317 | |||
318 | gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios)); | ||
319 | |||
256 | 320 | ||
257 | GPIOs mapped to IRQs | 321 | GPIOs mapped to IRQs |
258 | -------------------- | 322 | -------------------- |
diff --git a/Documentation/hwmon/abituguru b/Documentation/hwmon/abituguru index 87ffa0f5ec70..5eb3b9d5f0d5 100644 --- a/Documentation/hwmon/abituguru +++ b/Documentation/hwmon/abituguru | |||
@@ -30,7 +30,7 @@ Supported chips: | |||
30 | bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1 | 30 | bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1 |
31 | You may also need to specify the fan_sensors option for these boards | 31 | You may also need to specify the fan_sensors option for these boards |
32 | fan_sensors=5 | 32 | fan_sensors=5 |
33 | 2) There is a seperate abituguru3 driver for these motherboards, | 33 | 2) There is a separate abituguru3 driver for these motherboards, |
34 | the abituguru (without the 3 !) driver will not work on these | 34 | the abituguru (without the 3 !) driver will not work on these |
35 | motherboards (and visa versa)! | 35 | motherboards (and visa versa)! |
36 | 36 | ||
diff --git a/Documentation/hwmon/adt7411 b/Documentation/hwmon/adt7411 new file mode 100644 index 000000000000..1632960f9745 --- /dev/null +++ b/Documentation/hwmon/adt7411 | |||
@@ -0,0 +1,42 @@ | |||
1 | Kernel driver adt7411 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Analog Devices ADT7411 | ||
6 | Prefix: 'adt7411' | ||
7 | Addresses scanned: 0x48, 0x4a, 0x4b | ||
8 | Datasheet: Publicly available at the Analog Devices website | ||
9 | |||
10 | Author: Wolfram Sang (based on adt7470 by Darrick J. Wong) | ||
11 | |||
12 | Description | ||
13 | ----------- | ||
14 | |||
15 | This driver implements support for the Analog Devices ADT7411 chip. There may | ||
16 | be other chips that implement this interface. | ||
17 | |||
18 | The ADT7411 can use an I2C/SMBus compatible 2-wire interface or an | ||
19 | SPI-compatible 4-wire interface. It provides a 10-bit analog to digital | ||
20 | converter which measures 1 temperature, vdd and 8 input voltages. It has an | ||
21 | internal temperature sensor, but an external one can also be connected (one | ||
22 | loses 2 inputs then). There are high- and low-limit registers for all inputs. | ||
23 | |||
24 | Check the datasheet for details. | ||
25 | |||
26 | sysfs-Interface | ||
27 | --------------- | ||
28 | |||
29 | in0_input - vdd voltage input | ||
30 | in[1-8]_input - analog 1-8 input | ||
31 | temp1_input - temperature input | ||
32 | |||
33 | Besides standard interfaces, this driver adds (0 = off, 1 = on): | ||
34 | |||
35 | adc_ref_vdd - Use vdd as reference instead of 2.25 V | ||
36 | fast_sampling - Sample at 22.5 kHz instead of 1.4 kHz, but drop filters | ||
37 | no_average - Turn off averaging over 16 samples | ||
38 | |||
39 | Notes | ||
40 | ----- | ||
41 | |||
42 | SPI, external temperature sensor and limit registers are not supported yet. | ||
diff --git a/Documentation/hwmon/adt7473 b/Documentation/hwmon/adt7473 deleted file mode 100644 index 446612bd1fb9..000000000000 --- a/Documentation/hwmon/adt7473 +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | Kernel driver adt7473 | ||
2 | ====================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Analog Devices ADT7473 | ||
6 | Prefix: 'adt7473' | ||
7 | Addresses scanned: I2C 0x2C, 0x2D, 0x2E | ||
8 | Datasheet: Publicly available at the Analog Devices website | ||
9 | |||
10 | Author: Darrick J. Wong | ||
11 | |||
12 | This driver is depreacted, please use the adt7475 driver instead. | ||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | This driver implements support for the Analog Devices ADT7473 chip family. | ||
18 | |||
19 | The ADT7473 uses the 2-wire interface compatible with the SMBUS 2.0 | ||
20 | specification. Using an analog to digital converter it measures three (3) | ||
21 | temperatures and two (2) voltages. It has four (4) 16-bit counters for | ||
22 | measuring fan speed. There are three (3) PWM outputs that can be used | ||
23 | to control fan speed. | ||
24 | |||
25 | A sophisticated control system for the PWM outputs is designed into the | ||
26 | ADT7473 that allows fan speed to be adjusted automatically based on any of the | ||
27 | three temperature sensors. Each PWM output is individually adjustable and | ||
28 | programmable. Once configured, the ADT7473 will adjust the PWM outputs in | ||
29 | response to the measured temperatures without further host intervention. | ||
30 | This feature can also be disabled for manual control of the PWM's. | ||
31 | |||
32 | Each of the measured inputs (voltage, temperature, fan speed) has | ||
33 | corresponding high/low limit values. The ADT7473 will signal an ALARM if | ||
34 | any measured value exceeds either limit. | ||
35 | |||
36 | The ADT7473 samples all inputs continuously. The driver will not read | ||
37 | the registers more often than once every other second. Further, | ||
38 | configuration data is only read once per minute. | ||
39 | |||
40 | Special Features | ||
41 | ---------------- | ||
42 | |||
43 | The ADT7473 have a 10-bit ADC and can therefore measure temperatures | ||
44 | with 0.25 degC resolution. Temperature readings can be configured either | ||
45 | for twos complement format or "Offset 64" format, wherein 63 is subtracted | ||
46 | from the raw value to get the temperature value. | ||
47 | |||
48 | The Analog Devices datasheet is very detailed and describes a procedure for | ||
49 | determining an optimal configuration for the automatic PWM control. | ||
50 | |||
51 | Configuration Notes | ||
52 | ------------------- | ||
53 | |||
54 | Besides standard interfaces driver adds the following: | ||
55 | |||
56 | * PWM Control | ||
57 | |||
58 | * pwm#_auto_point1_pwm and temp#_auto_point1_temp and | ||
59 | * pwm#_auto_point2_pwm and temp#_auto_point2_temp - | ||
60 | |||
61 | point1: Set the pwm speed at a lower temperature bound. | ||
62 | point2: Set the pwm speed at a higher temperature bound. | ||
63 | |||
64 | The ADT7473 will scale the pwm between the lower and higher pwm speed when | ||
65 | the temperature is between the two temperature boundaries. PWM values range | ||
66 | from 0 (off) to 255 (full speed). Fan speed will be set to maximum when the | ||
67 | temperature sensor associated with the PWM control exceeds temp#_max. | ||
68 | |||
69 | Notes | ||
70 | ----- | ||
71 | |||
72 | The NVIDIA binary driver presents an ADT7473 chip via an on-card i2c bus. | ||
73 | Unfortunately, they fail to set the i2c adapter class, so this driver may | ||
74 | fail to find the chip until the nvidia driver is patched. | ||
diff --git a/Documentation/hwmon/asc7621 b/Documentation/hwmon/asc7621 new file mode 100644 index 000000000000..7287be7e1f21 --- /dev/null +++ b/Documentation/hwmon/asc7621 | |||
@@ -0,0 +1,296 @@ | |||
1 | Kernel driver asc7621 | ||
2 | ================== | ||
3 | |||
4 | Supported chips: | ||
5 | Andigilog aSC7621 and aSC7621a | ||
6 | Prefix: 'asc7621' | ||
7 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e | ||
8 | Datasheet: http://www.fairview5.com/linux/asc7621/asc7621.pdf | ||
9 | |||
10 | Author: | ||
11 | George Joseph | ||
12 | |||
13 | Description provided by Dave Pivin @ Andigilog: | ||
14 | |||
15 | Andigilog has both the PECI and pre-PECI versions of the Heceta-6, as | ||
16 | Intel calls them. Heceta-6e has high frequency PWM and Heceta-6p has | ||
17 | added PECI and a 4th thermal zone. The Andigilog aSC7611 is the | ||
18 | Heceta-6e part and aSC7621 is the Heceta-6p part. They are both in | ||
19 | volume production, shipping to Intel and their subs. | ||
20 | |||
21 | We have enhanced both parts relative to the governing Intel | ||
22 | specification. First enhancement is temperature reading resolution. We | ||
23 | have used registers below 20h for vendor-specific functions in addition | ||
24 | to those in the Intel-specified vendor range. | ||
25 | |||
26 | Our conversion process produces a result that is reported as two bytes. | ||
27 | The fan speed control uses this finer value to produce a "step-less" fan | ||
28 | PWM output. These two bytes are "read-locked" to guarantee that once a | ||
29 | high or low byte is read, the other byte is locked-in until after the | ||
30 | next read of any register. So to get an atomic reading, read high or low | ||
31 | byte, then the very next read should be the opposite byte. Our data | ||
32 | sheet says 10-bits of resolution, although you may find the lower bits | ||
33 | are active, they are not necessarily reliable or useful externally. We | ||
34 | chose not to mask them. | ||
35 | |||
36 | We employ significant filtering that is user tunable as described in the | ||
37 | data sheet. Our temperature reports and fan PWM outputs are very smooth | ||
38 | when compared to the competition, in addition to the higher resolution | ||
39 | temperature reports. The smoother PWM output does not require user | ||
40 | intervention. | ||
41 | |||
42 | We offer GPIO features on the former VID pins. These are open-drain | ||
43 | outputs or inputs and may be used as general purpose I/O or as alarm | ||
44 | outputs that are based on temperature limits. These are in 19h and 1Ah. | ||
45 | |||
46 | We offer flexible mapping of temperature readings to thermal zones. Any | ||
47 | temperature may be mapped to any zone, which has a default assignment | ||
48 | that follows Intel's specs. | ||
49 | |||
50 | Since there is a fan to zone assignment that allows for the "hotter" of | ||
51 | a set of zones to control the PWM of an individual fan, but there is no | ||
52 | indication to the user, we have added an indicator that shows which zone | ||
53 | is currently controlling the PWM for a given fan. This is in register | ||
54 | 00h. | ||
55 | |||
56 | Both remote diode temperature readings may be given an offset value such | ||
57 | that the reported reading as well as the temperature used to determine | ||
58 | PWM may be offset for system calibration purposes. | ||
59 | |||
60 | PECI Extended configuration allows for having more than two domains per | ||
61 | PECI address and also provides an enabling function for each PECI | ||
62 | address. One could use our flexible zone assignment to have a zone | ||
63 | assigned to up to 4 PECI addresses. This is not possible in the default | ||
64 | Intel configuration. This would be useful in multi-CPU systems with | ||
65 | individual fans on each that would benefit from individual fan control. | ||
66 | This is in register 0Eh. | ||
67 | |||
68 | The tachometer measurement system is flexible and able to adapt to many | ||
69 | fan types. We can also support pulse-stretched PWM so that 3-wire fans | ||
70 | may be used. These characteristics are in registers 04h to 07h. | ||
71 | |||
72 | Finally, we have added a tach disable function that turns off the tach | ||
73 | measurement system for individual tachs in order to save power. That is | ||
74 | in register 75h. | ||
75 | |||
76 | -- | ||
77 | aSC7621 Product Description | ||
78 | |||
79 | The aSC7621 has a two wire digital interface compatible with SMBus 2.0. | ||
80 | Using a 10-bit ADC, the aSC7621 measures the temperature of two remote diode | ||
81 | connected transistors as well as its own die. Support for Platform | ||
82 | Environmental Control Interface (PECI) is included. | ||
83 | |||
84 | Using temperature information from these four zones, an automatic fan speed | ||
85 | control algorithm is employed to minimize acoustic impact while achieving | ||
86 | recommended CPU temperature under varying operational loads. | ||
87 | |||
88 | To set fan speed, the aSC7621 has three independent pulse width modulation | ||
89 | (PWM) outputs that are controlled by one, or a combination of three, | ||
90 | temperature zones. Both high- and low-frequency PWM ranges are supported. | ||
91 | |||
92 | The aSC7621 also includes a digital filter that can be invoked to smooth | ||
93 | temperature readings for better control of fan speed and minimum acoustic | ||
94 | impact. | ||
95 | |||
96 | The aSC7621 has tachometer inputs to measure fan speed on up to four fans. | ||
97 | Limit and status registers for all measured values are included to alert | ||
98 | the system host that any measurements are outside of programmed limits | ||
99 | via status registers. | ||
100 | |||
101 | System voltages of VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard power are | ||
102 | monitored efficiently with internal scaling resistors. | ||
103 | |||
104 | Features | ||
105 | - Supports PECI interface and monitors internal and remote thermal diodes | ||
106 | - 2-wire, SMBus 2.0 compliant, serial interface | ||
107 | - 10-bit ADC | ||
108 | - Monitors VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard/processor supplies | ||
109 | - Programmable autonomous fan control based on temperature readings | ||
110 | - Noise filtering of temperature reading for fan speed control | ||
111 | - 0.25C digital temperature sensor resolution | ||
112 | - 3 PWM fan speed control outputs for 2-, 3- or 4-wire fans and up to 4 fan | ||
113 | tachometer inputs | ||
114 | - Enhanced measured temperature to Temperature Zone assignment. | ||
115 | - Provides high and low PWM frequency ranges | ||
116 | - 3 GPIO pins for custom use | ||
117 | - 24-Lead QSOP package | ||
118 | |||
119 | Configuration Notes | ||
120 | =================== | ||
121 | |||
122 | Except where noted below, the sysfs entries created by this driver follow | ||
123 | the standards defined in "sysfs-interface". | ||
124 | |||
125 | temp1_source | ||
126 | 0 (default) peci_legacy = 0, Remote 1 Temperature | ||
127 | peci_legacy = 1, PECI Processor Temperature 0 | ||
128 | 1 Remote 1 Temperature | ||
129 | 2 Remote 2 Temperature | ||
130 | 3 Internal Temperature | ||
131 | 4 PECI Processor Temperature 0 | ||
132 | 5 PECI Processor Temperature 1 | ||
133 | 6 PECI Processor Temperature 2 | ||
134 | 7 PECI Processor Temperature 3 | ||
135 | |||
136 | temp2_source | ||
137 | 0 (default) Internal Temperature | ||
138 | 1 Remote 1 Temperature | ||
139 | 2 Remote 2 Temperature | ||
140 | 3 Internal Temperature | ||
141 | 4 PECI Processor Temperature 0 | ||
142 | 5 PECI Processor Temperature 1 | ||
143 | 6 PECI Processor Temperature 2 | ||
144 | 7 PECI Processor Temperature 3 | ||
145 | |||
146 | temp3_source | ||
147 | 0 (default) Remote 2 Temperature | ||
148 | 1 Remote 1 Temperature | ||
149 | 2 Remote 2 Temperature | ||
150 | 3 Internal Temperature | ||
151 | 4 PECI Processor Temperature 0 | ||
152 | 5 PECI Processor Temperature 1 | ||
153 | 6 PECI Processor Temperature 2 | ||
154 | 7 PECI Processor Temperature 3 | ||
155 | |||
156 | temp4_source | ||
157 | 0 (default) peci_legacy = 0, PECI Processor Temperature 0 | ||
158 | peci_legacy = 1, Remote 1 Temperature | ||
159 | 1 Remote 1 Temperature | ||
160 | 2 Remote 2 Temperature | ||
161 | 3 Internal Temperature | ||
162 | 4 PECI Processor Temperature 0 | ||
163 | 5 PECI Processor Temperature 1 | ||
164 | 6 PECI Processor Temperature 2 | ||
165 | 7 PECI Processor Temperature 3 | ||
166 | |||
167 | temp[1-4]_smoothing_enable | ||
168 | temp[1-4]_smoothing_time | ||
169 | Smooths spikes in temp readings caused by noise. | ||
170 | Valid values in milliseconds are: | ||
171 | 35000 | ||
172 | 17600 | ||
173 | 11800 | ||
174 | 7000 | ||
175 | 4400 | ||
176 | 3000 | ||
177 | 1600 | ||
178 | 800 | ||
179 | |||
180 | temp[1-4]_crit | ||
181 | When the corresponding zone temperature reaches this value, | ||
182 | ALL pwm outputs will got to 100%. | ||
183 | |||
184 | temp[5-8]_input | ||
185 | temp[5-8]_enable | ||
186 | The aSC7621 can also read temperatures provided by the processor | ||
187 | via the PECI bus. Usually these are "core" temps and are relative | ||
188 | to the point where the automatic thermal control circuit starts | ||
189 | throttling. This means that these are usually negative numbers. | ||
190 | |||
191 | pwm[1-3]_enable | ||
192 | 0 Fan off. | ||
193 | 1 Fan on manual control. | ||
194 | 2 Fan on automatic control and will run at the minimum pwm | ||
195 | if the temperature for the zone is below the minimum. | ||
196 | 3 Fan on automatic control but will be off if the temperature | ||
197 | for the zone is below the minimum. | ||
198 | 4-254 Ignored. | ||
199 | 255 Fan on full. | ||
200 | |||
201 | pwm[1-3]_auto_channels | ||
202 | Bitmap as described in sysctl-interface with the following | ||
203 | exceptions... | ||
204 | Only the following combination of zones (and their corresponding masks) | ||
205 | are valid: | ||
206 | 1 | ||
207 | 2 | ||
208 | 3 | ||
209 | 2,3 | ||
210 | 1,2,3 | ||
211 | 4 | ||
212 | 1,2,3,4 | ||
213 | |||
214 | Special values: | ||
215 | 0 Disabled. | ||
216 | 16 Fan on manual control. | ||
217 | 31 Fan on full. | ||
218 | |||
219 | |||
220 | pwm[1-3]_invert | ||
221 | When set, inverts the meaning of pwm[1-3]. | ||
222 | i.e. when pwm = 0, the fan will be on full and | ||
223 | when pwm = 255 the fan will be off. | ||
224 | |||
225 | pwm[1-3]_freq | ||
226 | PWM frequency in Hz | ||
227 | Valid values in Hz are: | ||
228 | |||
229 | 10 | ||
230 | 15 | ||
231 | 23 | ||
232 | 30 (default) | ||
233 | 38 | ||
234 | 47 | ||
235 | 62 | ||
236 | 94 | ||
237 | 23000 | ||
238 | 24000 | ||
239 | 25000 | ||
240 | 26000 | ||
241 | 27000 | ||
242 | 28000 | ||
243 | 29000 | ||
244 | 30000 | ||
245 | |||
246 | Setting any other value will be ignored. | ||
247 | |||
248 | peci_enable | ||
249 | Enables or disables PECI | ||
250 | |||
251 | peci_avg | ||
252 | Input filter average time. | ||
253 | |||
254 | 0 0 Sec. (no Smoothing) (default) | ||
255 | 1 0.25 Sec. | ||
256 | 2 0.5 Sec. | ||
257 | 3 1.0 Sec. | ||
258 | 4 2.0 Sec. | ||
259 | 5 4.0 Sec. | ||
260 | 6 8.0 Sec. | ||
261 | 7 0.0 Sec. | ||
262 | |||
263 | peci_legacy | ||
264 | |||
265 | 0 Standard Mode (default) | ||
266 | Remote Diode 1 reading is associated with | ||
267 | Temperature Zone 1, PECI is associated with | ||
268 | Zone 4 | ||
269 | |||
270 | 1 Legacy Mode | ||
271 | PECI is associated with Temperature Zone 1, | ||
272 | Remote Diode 1 is associated with Zone 4 | ||
273 | |||
274 | peci_diode | ||
275 | Diode filter | ||
276 | |||
277 | 0 0.25 Sec. | ||
278 | 1 1.1 Sec. | ||
279 | 2 2.4 Sec. (default) | ||
280 | 3 3.4 Sec. | ||
281 | 4 5.0 Sec. | ||
282 | 5 6.8 Sec. | ||
283 | 6 10.2 Sec. | ||
284 | 7 16.4 Sec. | ||
285 | |||
286 | peci_4domain | ||
287 | Four domain enable | ||
288 | |||
289 | 0 1 or 2 Domains for enabled processors (default) | ||
290 | 1 3 or 4 Domains for enabled processors | ||
291 | |||
292 | peci_domain | ||
293 | Domain | ||
294 | |||
295 | 0 Processor contains a single domain (0) (default) | ||
296 | 1 Processor contains two domains (0,1) | ||
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87 index f9ba96c0ac4a..8d08bf0d38ed 100644 --- a/Documentation/hwmon/it87 +++ b/Documentation/hwmon/it87 | |||
@@ -5,31 +5,23 @@ Supported chips: | |||
5 | * IT8705F | 5 | * IT8705F |
6 | Prefix: 'it87' | 6 | Prefix: 'it87' |
7 | Addresses scanned: from Super I/O config space (8 I/O ports) | 7 | Addresses scanned: from Super I/O config space (8 I/O ports) |
8 | Datasheet: Publicly available at the ITE website | 8 | Datasheet: Once publicly available at the ITE website, but no longer |
9 | http://www.ite.com.tw/product_info/file/pc/IT8705F_V.0.4.1.pdf | ||
10 | * IT8712F | 9 | * IT8712F |
11 | Prefix: 'it8712' | 10 | Prefix: 'it8712' |
12 | Addresses scanned: from Super I/O config space (8 I/O ports) | 11 | Addresses scanned: from Super I/O config space (8 I/O ports) |
13 | Datasheet: Publicly available at the ITE website | 12 | Datasheet: Once publicly available at the ITE website, but no longer |
14 | http://www.ite.com.tw/product_info/file/pc/IT8712F_V0.9.1.pdf | ||
15 | http://www.ite.com.tw/product_info/file/pc/Errata%20V0.1%20for%20IT8712F%20V0.9.1.pdf | ||
16 | http://www.ite.com.tw/product_info/file/pc/IT8712F_V0.9.3.pdf | ||
17 | * IT8716F/IT8726F | 13 | * IT8716F/IT8726F |
18 | Prefix: 'it8716' | 14 | Prefix: 'it8716' |
19 | Addresses scanned: from Super I/O config space (8 I/O ports) | 15 | Addresses scanned: from Super I/O config space (8 I/O ports) |
20 | Datasheet: Publicly available at the ITE website | 16 | Datasheet: Once publicly available at the ITE website, but no longer |
21 | http://www.ite.com.tw/product_info/file/pc/IT8716F_V0.3.ZIP | ||
22 | http://www.ite.com.tw/product_info/file/pc/IT8726F_V0.3.pdf | ||
23 | * IT8718F | 17 | * IT8718F |
24 | Prefix: 'it8718' | 18 | Prefix: 'it8718' |
25 | Addresses scanned: from Super I/O config space (8 I/O ports) | 19 | Addresses scanned: from Super I/O config space (8 I/O ports) |
26 | Datasheet: Publicly available at the ITE website | 20 | Datasheet: Once publicly available at the ITE website, but no longer |
27 | http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip | ||
28 | http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip | ||
29 | * IT8720F | 21 | * IT8720F |
30 | Prefix: 'it8720' | 22 | Prefix: 'it8720' |
31 | Addresses scanned: from Super I/O config space (8 I/O ports) | 23 | Addresses scanned: from Super I/O config space (8 I/O ports) |
32 | Datasheet: Not yet publicly available. | 24 | Datasheet: Not publicly available |
33 | * SiS950 [clone of IT8705F] | 25 | * SiS950 [clone of IT8705F] |
34 | Prefix: 'it87' | 26 | Prefix: 'it87' |
35 | Addresses scanned: from Super I/O config space (8 I/O ports) | 27 | Addresses scanned: from Super I/O config space (8 I/O ports) |
@@ -136,6 +128,10 @@ registers are read whenever any data is read (unless it is less than 1.5 | |||
136 | seconds since the last update). This means that you can easily miss | 128 | seconds since the last update). This means that you can easily miss |
137 | once-only alarms. | 129 | once-only alarms. |
138 | 130 | ||
131 | Out-of-limit readings can also result in beeping, if the chip is properly | ||
132 | wired and configured. Beeping can be enabled or disabled per sensor type | ||
133 | (temperatures, voltages and fans.) | ||
134 | |||
139 | The IT87xx only updates its values each 1.5 seconds; reading it more often | 135 | The IT87xx only updates its values each 1.5 seconds; reading it more often |
140 | will do no harm, but will return 'old' values. | 136 | will do no harm, but will return 'old' values. |
141 | 137 | ||
@@ -150,11 +146,38 @@ Fan speed control | |||
150 | ----------------- | 146 | ----------------- |
151 | 147 | ||
152 | The fan speed control features are limited to manual PWM mode. Automatic | 148 | The fan speed control features are limited to manual PWM mode. Automatic |
153 | "Smart Guardian" mode control handling is not implemented. However | 149 | "Smart Guardian" mode control handling is only implemented for older chips |
154 | if you want to go for "manual mode" just write 1 to pwmN_enable. | 150 | (see below.) However if you want to go for "manual mode" just write 1 to |
151 | pwmN_enable. | ||
155 | 152 | ||
156 | If you are only able to control the fan speed with very small PWM values, | 153 | If you are only able to control the fan speed with very small PWM values, |
157 | try lowering the PWM base frequency (pwm1_freq). Depending on the fan, | 154 | try lowering the PWM base frequency (pwm1_freq). Depending on the fan, |
158 | it may give you a somewhat greater control range. The same frequency is | 155 | it may give you a somewhat greater control range. The same frequency is |
159 | used to drive all fan outputs, which is why pwm2_freq and pwm3_freq are | 156 | used to drive all fan outputs, which is why pwm2_freq and pwm3_freq are |
160 | read-only. | 157 | read-only. |
158 | |||
159 | |||
160 | Automatic fan speed control (old interface) | ||
161 | ------------------------------------------- | ||
162 | |||
163 | The driver supports the old interface to automatic fan speed control | ||
164 | which is implemented by IT8705F chips up to revision F and IT8712F | ||
165 | chips up to revision G. | ||
166 | |||
167 | This interface implements 4 temperature vs. PWM output trip points. | ||
168 | The PWM output of trip point 4 is always the maximum value (fan running | ||
169 | at full speed) while the PWM output of the other 3 trip points can be | ||
170 | freely chosen. The temperature of all 4 trip points can be freely chosen. | ||
171 | Additionally, trip point 1 has an hysteresis temperature attached, to | ||
172 | prevent fast switching between fan on and off. | ||
173 | |||
174 | The chip automatically computes the PWM output value based on the input | ||
175 | temperature, based on this simple rule: if the temperature value is | ||
176 | between trip point N and trip point N+1 then the PWM output value is | ||
177 | the one of trip point N. The automatic control mode is less flexible | ||
178 | than the manual control mode, but it reacts faster, is more robust and | ||
179 | doesn't use CPU cycles. | ||
180 | |||
181 | Trip points must be set properly before switching to automatic fan speed | ||
182 | control mode. The driver will perform basic integrity checks before | ||
183 | actually switching to automatic control mode. | ||
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90 index 93d8e3d55150..6a03dd4bcc94 100644 --- a/Documentation/hwmon/lm90 +++ b/Documentation/hwmon/lm90 | |||
@@ -84,6 +84,10 @@ Supported chips: | |||
84 | Addresses scanned: I2C 0x4c | 84 | Addresses scanned: I2C 0x4c |
85 | Datasheet: Publicly available at the Maxim website | 85 | Datasheet: Publicly available at the Maxim website |
86 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500 | 86 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500 |
87 | * Winbond/Nuvoton W83L771AWG/ASG | ||
88 | Prefix: 'w83l771' | ||
89 | Addresses scanned: I2C 0x4c | ||
90 | Datasheet: Not publicly available, can be requested from Nuvoton | ||
87 | 91 | ||
88 | 92 | ||
89 | Author: Jean Delvare <khali@linux-fr.org> | 93 | Author: Jean Delvare <khali@linux-fr.org> |
@@ -147,6 +151,12 @@ MAX6680 and MAX6681: | |||
147 | * Selectable address | 151 | * Selectable address |
148 | * Remote sensor type selection | 152 | * Remote sensor type selection |
149 | 153 | ||
154 | W83L771AWG/ASG | ||
155 | * The AWG and ASG variants only differ in package format. | ||
156 | * Filter and alert configuration register at 0xBF | ||
157 | * Diode ideality factor configuration (remote sensor) at 0xE3 | ||
158 | * Moving average (depending on conversion rate) | ||
159 | |||
150 | All temperature values are given in degrees Celsius. Resolution | 160 | All temperature values are given in degrees Celsius. Resolution |
151 | is 1.0 degree for the local temperature, 0.125 degree for the remote | 161 | is 1.0 degree for the local temperature, 0.125 degree for the remote |
152 | temperature, except for the MAX6657, MAX6658 and MAX6659 which have a | 162 | temperature, except for the MAX6657, MAX6658 and MAX6659 which have a |
@@ -163,6 +173,18 @@ The lm90 driver will not update its values more frequently than every | |||
163 | other second; reading them more often will do no harm, but will return | 173 | other second; reading them more often will do no harm, but will return |
164 | 'old' values. | 174 | 'old' values. |
165 | 175 | ||
176 | SMBus Alert Support | ||
177 | ------------------- | ||
178 | |||
179 | This driver has basic support for SMBus alert. When an alert is received, | ||
180 | the status register is read and the faulty temperature channel is logged. | ||
181 | |||
182 | The Analog Devices chips (ADM1032 and ADT7461) do not implement the SMBus | ||
183 | alert protocol properly so additional care is needed: the ALERT output is | ||
184 | disabled when an alert is received, and is re-enabled only when the alarm | ||
185 | is gone. Otherwise the chip would block alerts from other chips in the bus | ||
186 | as long as the alarm is active. | ||
187 | |||
166 | PEC Support | 188 | PEC Support |
167 | ----------- | 189 | ----------- |
168 | 190 | ||
diff --git a/Documentation/init.txt b/Documentation/init.txt new file mode 100644 index 000000000000..535ad5e82b98 --- /dev/null +++ b/Documentation/init.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | Explaining the dreaded "No init found." boot hang message | ||
2 | ========================================================= | ||
3 | |||
4 | OK, so you've got this pretty unintuitive message (currently located | ||
5 | in init/main.c) and are wondering what the H*** went wrong. | ||
6 | Some high-level reasons for failure (listed roughly in order of execution) | ||
7 | to load the init binary are: | ||
8 | A) Unable to mount root FS | ||
9 | B) init binary doesn't exist on rootfs | ||
10 | C) broken console device | ||
11 | D) binary exists but dependencies not available | ||
12 | E) binary cannot be loaded | ||
13 | |||
14 | Detailed explanations: | ||
15 | 0) Set "debug" kernel parameter (in bootloader config file or CONFIG_CMDLINE) | ||
16 | to get more detailed kernel messages. | ||
17 | A) make sure you have the correct root FS type | ||
18 | (and root= kernel parameter points to the correct partition), | ||
19 | required drivers such as storage hardware (such as SCSI or USB!) | ||
20 | and filesystem (ext3, jffs2 etc.) are builtin (alternatively as modules, | ||
21 | to be pre-loaded by an initrd) | ||
22 | C) Possibly a conflict in console= setup --> initial console unavailable. | ||
23 | E.g. some serial consoles are unreliable due to serial IRQ issues (e.g. | ||
24 | missing interrupt-based configuration). | ||
25 | Try using a different console= device or e.g. netconsole= . | ||
26 | D) e.g. required library dependencies of the init binary such as | ||
27 | /lib/ld-linux.so.2 missing or broken. Use readelf -d <INIT>|grep NEEDED | ||
28 | to find out which libraries are required. | ||
29 | E) make sure the binary's architecture matches your hardware. | ||
30 | E.g. i386 vs. x86_64 mismatch, or trying to load x86 on ARM hardware. | ||
31 | In case you tried loading a non-binary file here (shell script?), | ||
32 | you should make sure that the script specifies an interpreter in its shebang | ||
33 | header line (#!/...) that is fully working (including its library | ||
34 | dependencies). And before tackling scripts, better first test a simple | ||
35 | non-script binary such as /bin/sh and confirm its successful execution. | ||
36 | To find out more, add code to init/main.c to display kernel_execve()s | ||
37 | return values. | ||
38 | |||
39 | Please extend this explanation whenever you find new failure causes | ||
40 | (after all loading the init binary is a CRITICAL and hard transition step | ||
41 | which needs to be made as painless as possible), then submit patch to LKML. | ||
42 | Further TODOs: | ||
43 | - Implement the various run_init_process() invocations via a struct array | ||
44 | which can then store the kernel_execve() result value and on failure | ||
45 | log it all by iterating over _all_ results (very important usability fix). | ||
46 | - try to make the implementation itself more helpful in general, | ||
47 | e.g. by providing additional error messages at affected places. | ||
48 | |||
49 | Andreas Mohr <andi at lisas period de> | ||
diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt index 3a6aec40c0b0..8b4129de1d2d 100644 --- a/Documentation/input/rotary-encoder.txt +++ b/Documentation/input/rotary-encoder.txt | |||
@@ -75,7 +75,7 @@ and the number of steps or will clamp at the maximum and zero depending on | |||
75 | the configuration. | 75 | the configuration. |
76 | 76 | ||
77 | Because GPIO to IRQ mapping is platform specific, this information must | 77 | Because GPIO to IRQ mapping is platform specific, this information must |
78 | be given in seperately to the driver. See the example below. | 78 | be given in separately to the driver. See the example below. |
79 | 79 | ||
80 | ---------<snip>--------- | 80 | ---------<snip>--------- |
81 | 81 | ||
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index 35c9b51d20ea..dd5806f4fcc4 100644 --- a/Documentation/ioctl/ioctl-number.txt +++ b/Documentation/ioctl/ioctl-number.txt | |||
@@ -291,6 +291,7 @@ Code Seq#(hex) Include File Comments | |||
291 | 0x92 00-0F drivers/usb/mon/mon_bin.c | 291 | 0x92 00-0F drivers/usb/mon/mon_bin.c |
292 | 0x93 60-7F linux/auto_fs.h | 292 | 0x93 60-7F linux/auto_fs.h |
293 | 0x94 all fs/btrfs/ioctl.h | 293 | 0x94 all fs/btrfs/ioctl.h |
294 | 0x97 00-7F fs/ceph/ioctl.h Ceph file system | ||
294 | 0x99 00-0F 537-Addinboard driver | 295 | 0x99 00-0F 537-Addinboard driver |
295 | <mailto:buk@buks.ipn.de> | 296 | <mailto:buk@buks.ipn.de> |
296 | 0xA0 all linux/sdp/sdp.h Industrial Device Project | 297 | 0xA0 all linux/sdp/sdp.h Industrial Device Project |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index e0df679c3902..23f95eaf7c07 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -201,10 +201,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
201 | acpi_display_output=video | 201 | acpi_display_output=video |
202 | See above. | 202 | See above. |
203 | 203 | ||
204 | acpi_early_pdc_eval [HW,ACPI] Evaluate processor _PDC methods | ||
205 | early. Needed on some platforms to properly | ||
206 | initialize the EC. | ||
207 | |||
208 | acpi_irq_balance [HW,ACPI] | 204 | acpi_irq_balance [HW,ACPI] |
209 | ACPI will balance active IRQs | 205 | ACPI will balance active IRQs |
210 | default in APIC mode | 206 | default in APIC mode |
@@ -2844,6 +2840,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2844 | default x2apic cluster mode on platforms | 2840 | default x2apic cluster mode on platforms |
2845 | supporting x2apic. | 2841 | supporting x2apic. |
2846 | 2842 | ||
2843 | x86_mrst_timer= [X86-32,APBT] | ||
2844 | Choose timer option for x86 Moorestown MID platform. | ||
2845 | Two valid options are apbt timer only and lapic timer | ||
2846 | plus one apbt timer for broadcast timer. | ||
2847 | x86_mrst_timer=apbt_only | lapic_and_apbt | ||
2848 | |||
2847 | xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks. | 2849 | xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks. |
2848 | xd_geo= See header of drivers/block/xd.c. | 2850 | xd_geo= See header of drivers/block/xd.c. |
2849 | 2851 | ||
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt index c79ab996dada..3ab2472509cb 100644 --- a/Documentation/kobject.txt +++ b/Documentation/kobject.txt | |||
@@ -59,37 +59,56 @@ nice to have in other objects. The C language does not allow for the | |||
59 | direct expression of inheritance, so other techniques - such as structure | 59 | direct expression of inheritance, so other techniques - such as structure |
60 | embedding - must be used. | 60 | embedding - must be used. |
61 | 61 | ||
62 | So, for example, the UIO code has a structure that defines the memory | 62 | (As an aside, for those familiar with the kernel linked list implementation, |
63 | region associated with a uio device: | 63 | this is analogous as to how "list_head" structs are rarely useful on |
64 | their own, but are invariably found embedded in the larger objects of | ||
65 | interest.) | ||
64 | 66 | ||
65 | struct uio_mem { | 67 | So, for example, the UIO code in drivers/uio/uio.c has a structure that |
68 | defines the memory region associated with a uio device: | ||
69 | |||
70 | struct uio_map { | ||
66 | struct kobject kobj; | 71 | struct kobject kobj; |
67 | unsigned long addr; | 72 | struct uio_mem *mem; |
68 | unsigned long size; | 73 | }; |
69 | int memtype; | ||
70 | void __iomem *internal_addr; | ||
71 | }; | ||
72 | 74 | ||
73 | If you have a struct uio_mem structure, finding its embedded kobject is | 75 | If you have a struct uio_map structure, finding its embedded kobject is |
74 | just a matter of using the kobj member. Code that works with kobjects will | 76 | just a matter of using the kobj member. Code that works with kobjects will |
75 | often have the opposite problem, however: given a struct kobject pointer, | 77 | often have the opposite problem, however: given a struct kobject pointer, |
76 | what is the pointer to the containing structure? You must avoid tricks | 78 | what is the pointer to the containing structure? You must avoid tricks |
77 | (such as assuming that the kobject is at the beginning of the structure) | 79 | (such as assuming that the kobject is at the beginning of the structure) |
78 | and, instead, use the container_of() macro, found in <linux/kernel.h>: | 80 | and, instead, use the container_of() macro, found in <linux/kernel.h>: |
79 | 81 | ||
80 | container_of(pointer, type, member) | 82 | container_of(pointer, type, member) |
83 | |||
84 | where: | ||
85 | |||
86 | * "pointer" is the pointer to the embedded kobject, | ||
87 | * "type" is the type of the containing structure, and | ||
88 | * "member" is the name of the structure field to which "pointer" points. | ||
89 | |||
90 | The return value from container_of() is a pointer to the corresponding | ||
91 | container type. So, for example, a pointer "kp" to a struct kobject | ||
92 | embedded *within* a struct uio_map could be converted to a pointer to the | ||
93 | *containing* uio_map structure with: | ||
94 | |||
95 | struct uio_map *u_map = container_of(kp, struct uio_map, kobj); | ||
96 | |||
97 | For convenience, programmers often define a simple macro for "back-casting" | ||
98 | kobject pointers to the containing type. Exactly this happens in the | ||
99 | earlier drivers/uio/uio.c, as you can see here: | ||
100 | |||
101 | struct uio_map { | ||
102 | struct kobject kobj; | ||
103 | struct uio_mem *mem; | ||
104 | }; | ||
81 | 105 | ||
82 | where pointer is the pointer to the embedded kobject, type is the type of | 106 | #define to_map(map) container_of(map, struct uio_map, kobj) |
83 | the containing structure, and member is the name of the structure field to | ||
84 | which pointer points. The return value from container_of() is a pointer to | ||
85 | the given type. So, for example, a pointer "kp" to a struct kobject | ||
86 | embedded within a struct uio_mem could be converted to a pointer to the | ||
87 | containing uio_mem structure with: | ||
88 | 107 | ||
89 | struct uio_mem *u_mem = container_of(kp, struct uio_mem, kobj); | 108 | where the macro argument "map" is a pointer to the struct kobject in |
109 | question. That macro is subsequently invoked with: | ||
90 | 110 | ||
91 | Programmers often define a simple macro for "back-casting" kobject pointers | 111 | struct uio_map *map = to_map(kobj); |
92 | to the containing type. | ||
93 | 112 | ||
94 | 113 | ||
95 | Initialization of kobjects | 114 | Initialization of kobjects |
@@ -266,7 +285,7 @@ kobj_type: | |||
266 | 285 | ||
267 | struct kobj_type { | 286 | struct kobj_type { |
268 | void (*release)(struct kobject *); | 287 | void (*release)(struct kobject *); |
269 | struct sysfs_ops *sysfs_ops; | 288 | const struct sysfs_ops *sysfs_ops; |
270 | struct attribute **default_attrs; | 289 | struct attribute **default_attrs; |
271 | }; | 290 | }; |
272 | 291 | ||
@@ -387,4 +406,5 @@ called, and the objects in the former circle release each other. | |||
387 | Example code to copy from | 406 | Example code to copy from |
388 | 407 | ||
389 | For a more complete example of using ksets and kobjects properly, see the | 408 | For a more complete example of using ksets and kobjects properly, see the |
390 | sample/kobject/kset-example.c code. | 409 | example programs samples/kobject/{kobject-example.c,kset-example.c}, |
410 | which will be built as loadable modules if you select CONFIG_SAMPLE_KOBJECT. | ||
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 053037a1fe6d..2f9115c0ae62 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -1,6 +1,7 @@ | |||
1 | Title : Kernel Probes (Kprobes) | 1 | Title : Kernel Probes (Kprobes) |
2 | Authors : Jim Keniston <jkenisto@us.ibm.com> | 2 | Authors : Jim Keniston <jkenisto@us.ibm.com> |
3 | : Prasanna S Panchamukhi <prasanna@in.ibm.com> | 3 | : Prasanna S Panchamukhi <prasanna.panchamukhi@gmail.com> |
4 | : Masami Hiramatsu <mhiramat@redhat.com> | ||
4 | 5 | ||
5 | CONTENTS | 6 | CONTENTS |
6 | 7 | ||
@@ -15,6 +16,7 @@ CONTENTS | |||
15 | 9. Jprobes Example | 16 | 9. Jprobes Example |
16 | 10. Kretprobes Example | 17 | 10. Kretprobes Example |
17 | Appendix A: The kprobes debugfs interface | 18 | Appendix A: The kprobes debugfs interface |
19 | Appendix B: The kprobes sysctl interface | ||
18 | 20 | ||
19 | 1. Concepts: Kprobes, Jprobes, Return Probes | 21 | 1. Concepts: Kprobes, Jprobes, Return Probes |
20 | 22 | ||
@@ -42,13 +44,13 @@ registration/unregistration of a group of *probes. These functions | |||
42 | can speed up unregistration process when you have to unregister | 44 | can speed up unregistration process when you have to unregister |
43 | a lot of probes at once. | 45 | a lot of probes at once. |
44 | 46 | ||
45 | The next three subsections explain how the different types of | 47 | The next four subsections explain how the different types of |
46 | probes work. They explain certain things that you'll need to | 48 | probes work and how jump optimization works. They explain certain |
47 | know in order to make the best use of Kprobes -- e.g., the | 49 | things that you'll need to know in order to make the best use of |
48 | difference between a pre_handler and a post_handler, and how | 50 | Kprobes -- e.g., the difference between a pre_handler and |
49 | to use the maxactive and nmissed fields of a kretprobe. But | 51 | a post_handler, and how to use the maxactive and nmissed fields of |
50 | if you're in a hurry to start using Kprobes, you can skip ahead | 52 | a kretprobe. But if you're in a hurry to start using Kprobes, you |
51 | to section 2. | 53 | can skip ahead to section 2. |
52 | 54 | ||
53 | 1.1 How Does a Kprobe Work? | 55 | 1.1 How Does a Kprobe Work? |
54 | 56 | ||
@@ -161,13 +163,125 @@ In case probed function is entered but there is no kretprobe_instance | |||
161 | object available, then in addition to incrementing the nmissed count, | 163 | object available, then in addition to incrementing the nmissed count, |
162 | the user entry_handler invocation is also skipped. | 164 | the user entry_handler invocation is also skipped. |
163 | 165 | ||
166 | 1.4 How Does Jump Optimization Work? | ||
167 | |||
168 | If you configured your kernel with CONFIG_OPTPROBES=y (currently | ||
169 | this option is supported on x86/x86-64, non-preemptive kernel) and | ||
170 | the "debug.kprobes_optimization" kernel parameter is set to 1 (see | ||
171 | sysctl(8)), Kprobes tries to reduce probe-hit overhead by using a jump | ||
172 | instruction instead of a breakpoint instruction at each probepoint. | ||
173 | |||
174 | 1.4.1 Init a Kprobe | ||
175 | |||
176 | When a probe is registered, before attempting this optimization, | ||
177 | Kprobes inserts an ordinary, breakpoint-based kprobe at the specified | ||
178 | address. So, even if it's not possible to optimize this particular | ||
179 | probepoint, there'll be a probe there. | ||
180 | |||
181 | 1.4.2 Safety Check | ||
182 | |||
183 | Before optimizing a probe, Kprobes performs the following safety checks: | ||
184 | |||
185 | - Kprobes verifies that the region that will be replaced by the jump | ||
186 | instruction (the "optimized region") lies entirely within one function. | ||
187 | (A jump instruction is multiple bytes, and so may overlay multiple | ||
188 | instructions.) | ||
189 | |||
190 | - Kprobes analyzes the entire function and verifies that there is no | ||
191 | jump into the optimized region. Specifically: | ||
192 | - the function contains no indirect jump; | ||
193 | - the function contains no instruction that causes an exception (since | ||
194 | the fixup code triggered by the exception could jump back into the | ||
195 | optimized region -- Kprobes checks the exception tables to verify this); | ||
196 | and | ||
197 | - there is no near jump to the optimized region (other than to the first | ||
198 | byte). | ||
199 | |||
200 | - For each instruction in the optimized region, Kprobes verifies that | ||
201 | the instruction can be executed out of line. | ||
202 | |||
203 | 1.4.3 Preparing Detour Buffer | ||
204 | |||
205 | Next, Kprobes prepares a "detour" buffer, which contains the following | ||
206 | instruction sequence: | ||
207 | - code to push the CPU's registers (emulating a breakpoint trap) | ||
208 | - a call to the trampoline code which calls user's probe handlers. | ||
209 | - code to restore registers | ||
210 | - the instructions from the optimized region | ||
211 | - a jump back to the original execution path. | ||
212 | |||
213 | 1.4.4 Pre-optimization | ||
214 | |||
215 | After preparing the detour buffer, Kprobes verifies that none of the | ||
216 | following situations exist: | ||
217 | - The probe has either a break_handler (i.e., it's a jprobe) or a | ||
218 | post_handler. | ||
219 | - Other instructions in the optimized region are probed. | ||
220 | - The probe is disabled. | ||
221 | In any of the above cases, Kprobes won't start optimizing the probe. | ||
222 | Since these are temporary situations, Kprobes tries to start | ||
223 | optimizing it again if the situation is changed. | ||
224 | |||
225 | If the kprobe can be optimized, Kprobes enqueues the kprobe to an | ||
226 | optimizing list, and kicks the kprobe-optimizer workqueue to optimize | ||
227 | it. If the to-be-optimized probepoint is hit before being optimized, | ||
228 | Kprobes returns control to the original instruction path by setting | ||
229 | the CPU's instruction pointer to the copied code in the detour buffer | ||
230 | -- thus at least avoiding the single-step. | ||
231 | |||
232 | 1.4.5 Optimization | ||
233 | |||
234 | The Kprobe-optimizer doesn't insert the jump instruction immediately; | ||
235 | rather, it calls synchronize_sched() for safety first, because it's | ||
236 | possible for a CPU to be interrupted in the middle of executing the | ||
237 | optimized region(*). As you know, synchronize_sched() can ensure | ||
238 | that all interruptions that were active when synchronize_sched() | ||
239 | was called are done, but only if CONFIG_PREEMPT=n. So, this version | ||
240 | of kprobe optimization supports only kernels with CONFIG_PREEMPT=n.(**) | ||
241 | |||
242 | After that, the Kprobe-optimizer calls stop_machine() to replace | ||
243 | the optimized region with a jump instruction to the detour buffer, | ||
244 | using text_poke_smp(). | ||
245 | |||
246 | 1.4.6 Unoptimization | ||
247 | |||
248 | When an optimized kprobe is unregistered, disabled, or blocked by | ||
249 | another kprobe, it will be unoptimized. If this happens before | ||
250 | the optimization is complete, the kprobe is just dequeued from the | ||
251 | optimized list. If the optimization has been done, the jump is | ||
252 | replaced with the original code (except for an int3 breakpoint in | ||
253 | the first byte) by using text_poke_smp(). | ||
254 | |||
255 | (*)Please imagine that the 2nd instruction is interrupted and then | ||
256 | the optimizer replaces the 2nd instruction with the jump *address* | ||
257 | while the interrupt handler is running. When the interrupt | ||
258 | returns to original address, there is no valid instruction, | ||
259 | and it causes an unexpected result. | ||
260 | |||
261 | (**)This optimization-safety checking may be replaced with the | ||
262 | stop-machine method that ksplice uses for supporting a CONFIG_PREEMPT=y | ||
263 | kernel. | ||
264 | |||
265 | NOTE for geeks: | ||
266 | The jump optimization changes the kprobe's pre_handler behavior. | ||
267 | Without optimization, the pre_handler can change the kernel's execution | ||
268 | path by changing regs->ip and returning 1. However, when the probe | ||
269 | is optimized, that modification is ignored. Thus, if you want to | ||
270 | tweak the kernel's execution path, you need to suppress optimization, | ||
271 | using one of the following techniques: | ||
272 | - Specify an empty function for the kprobe's post_handler or break_handler. | ||
273 | or | ||
274 | - Config CONFIG_OPTPROBES=n. | ||
275 | or | ||
276 | - Execute 'sysctl -w debug.kprobes_optimization=n' | ||
277 | |||
164 | 2. Architectures Supported | 278 | 2. Architectures Supported |
165 | 279 | ||
166 | Kprobes, jprobes, and return probes are implemented on the following | 280 | Kprobes, jprobes, and return probes are implemented on the following |
167 | architectures: | 281 | architectures: |
168 | 282 | ||
169 | - i386 | 283 | - i386 (Supports jump optimization) |
170 | - x86_64 (AMD-64, EM64T) | 284 | - x86_64 (AMD-64, EM64T) (Supports jump optimization) |
171 | - ppc64 | 285 | - ppc64 |
172 | - ia64 (Does not support probes on instruction slot1.) | 286 | - ia64 (Does not support probes on instruction slot1.) |
173 | - sparc64 (Return probes not yet implemented.) | 287 | - sparc64 (Return probes not yet implemented.) |
@@ -193,6 +307,10 @@ it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO), | |||
193 | so you can use "objdump -d -l vmlinux" to see the source-to-object | 307 | so you can use "objdump -d -l vmlinux" to see the source-to-object |
194 | code mapping. | 308 | code mapping. |
195 | 309 | ||
310 | If you want to reduce probing overhead, set "Kprobes jump optimization | ||
311 | support" (CONFIG_OPTPROBES) to "y". You can find this option under the | ||
312 | "Kprobes" line. | ||
313 | |||
196 | 4. API Reference | 314 | 4. API Reference |
197 | 315 | ||
198 | The Kprobes API includes a "register" function and an "unregister" | 316 | The Kprobes API includes a "register" function and an "unregister" |
@@ -389,7 +507,10 @@ the probe which has been registered. | |||
389 | 507 | ||
390 | Kprobes allows multiple probes at the same address. Currently, | 508 | Kprobes allows multiple probes at the same address. Currently, |
391 | however, there cannot be multiple jprobes on the same function at | 509 | however, there cannot be multiple jprobes on the same function at |
392 | the same time. | 510 | the same time. Also, a probepoint for which there is a jprobe or |
511 | a post_handler cannot be optimized. So if you install a jprobe, | ||
512 | or a kprobe with a post_handler, at an optimized probepoint, the | ||
513 | probepoint will be unoptimized automatically. | ||
393 | 514 | ||
394 | In general, you can install a probe anywhere in the kernel. | 515 | In general, you can install a probe anywhere in the kernel. |
395 | In particular, you can probe interrupt handlers. Known exceptions | 516 | In particular, you can probe interrupt handlers. Known exceptions |
@@ -453,6 +574,38 @@ reason, Kprobes doesn't support return probes (or kprobes or jprobes) | |||
453 | on the x86_64 version of __switch_to(); the registration functions | 574 | on the x86_64 version of __switch_to(); the registration functions |
454 | return -EINVAL. | 575 | return -EINVAL. |
455 | 576 | ||
577 | On x86/x86-64, since the Jump Optimization of Kprobes modifies | ||
578 | instructions widely, there are some limitations to optimization. To | ||
579 | explain it, we introduce some terminology. Imagine a 3-instruction | ||
580 | sequence consisting of a two 2-byte instructions and one 3-byte | ||
581 | instruction. | ||
582 | |||
583 | IA | ||
584 | | | ||
585 | [-2][-1][0][1][2][3][4][5][6][7] | ||
586 | [ins1][ins2][ ins3 ] | ||
587 | [<- DCR ->] | ||
588 | [<- JTPR ->] | ||
589 | |||
590 | ins1: 1st Instruction | ||
591 | ins2: 2nd Instruction | ||
592 | ins3: 3rd Instruction | ||
593 | IA: Insertion Address | ||
594 | JTPR: Jump Target Prohibition Region | ||
595 | DCR: Detoured Code Region | ||
596 | |||
597 | The instructions in DCR are copied to the out-of-line buffer | ||
598 | of the kprobe, because the bytes in DCR are replaced by | ||
599 | a 5-byte jump instruction. So there are several limitations. | ||
600 | |||
601 | a) The instructions in DCR must be relocatable. | ||
602 | b) The instructions in DCR must not include a call instruction. | ||
603 | c) JTPR must not be targeted by any jump or call instruction. | ||
604 | d) DCR must not straddle the border betweeen functions. | ||
605 | |||
606 | Anyway, these limitations are checked by the in-kernel instruction | ||
607 | decoder, so you don't need to worry about that. | ||
608 | |||
456 | 6. Probe Overhead | 609 | 6. Probe Overhead |
457 | 610 | ||
458 | On a typical CPU in use in 2005, a kprobe hit takes 0.5 to 1.0 | 611 | On a typical CPU in use in 2005, a kprobe hit takes 0.5 to 1.0 |
@@ -476,6 +629,19 @@ k = 0.49 usec; j = 0.76; r = 0.80; kr = 0.82; jr = 1.07 | |||
476 | ppc64: POWER5 (gr), 1656 MHz (SMT disabled, 1 virtual CPU per physical CPU) | 629 | ppc64: POWER5 (gr), 1656 MHz (SMT disabled, 1 virtual CPU per physical CPU) |
477 | k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99 | 630 | k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99 |
478 | 631 | ||
632 | 6.1 Optimized Probe Overhead | ||
633 | |||
634 | Typically, an optimized kprobe hit takes 0.07 to 0.1 microseconds to | ||
635 | process. Here are sample overhead figures (in usec) for x86 architectures. | ||
636 | k = unoptimized kprobe, b = boosted (single-step skipped), o = optimized kprobe, | ||
637 | r = unoptimized kretprobe, rb = boosted kretprobe, ro = optimized kretprobe. | ||
638 | |||
639 | i386: Intel(R) Xeon(R) E5410, 2.33GHz, 4656.90 bogomips | ||
640 | k = 0.80 usec; b = 0.33; o = 0.05; r = 1.10; rb = 0.61; ro = 0.33 | ||
641 | |||
642 | x86-64: Intel(R) Xeon(R) E5410, 2.33GHz, 4656.90 bogomips | ||
643 | k = 0.99 usec; b = 0.43; o = 0.06; r = 1.24; rb = 0.68; ro = 0.30 | ||
644 | |||
479 | 7. TODO | 645 | 7. TODO |
480 | 646 | ||
481 | a. SystemTap (http://sourceware.org/systemtap): Provides a simplified | 647 | a. SystemTap (http://sourceware.org/systemtap): Provides a simplified |
@@ -523,7 +689,8 @@ is also specified. Following columns show probe status. If the probe is on | |||
523 | a virtual address that is no longer valid (module init sections, module | 689 | a virtual address that is no longer valid (module init sections, module |
524 | virtual addresses that correspond to modules that've been unloaded), | 690 | virtual addresses that correspond to modules that've been unloaded), |
525 | such probes are marked with [GONE]. If the probe is temporarily disabled, | 691 | such probes are marked with [GONE]. If the probe is temporarily disabled, |
526 | such probes are marked with [DISABLED]. | 692 | such probes are marked with [DISABLED]. If the probe is optimized, it is |
693 | marked with [OPTIMIZED]. | ||
527 | 694 | ||
528 | /sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly. | 695 | /sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly. |
529 | 696 | ||
@@ -533,3 +700,19 @@ registered probes will be disarmed, till such time a "1" is echoed to this | |||
533 | file. Note that this knob just disarms and arms all kprobes and doesn't | 700 | file. Note that this knob just disarms and arms all kprobes and doesn't |
534 | change each probe's disabling state. This means that disabled kprobes (marked | 701 | change each probe's disabling state. This means that disabled kprobes (marked |
535 | [DISABLED]) will be not enabled if you turn ON all kprobes by this knob. | 702 | [DISABLED]) will be not enabled if you turn ON all kprobes by this knob. |
703 | |||
704 | |||
705 | Appendix B: The kprobes sysctl interface | ||
706 | |||
707 | /proc/sys/debug/kprobes-optimization: Turn kprobes optimization ON/OFF. | ||
708 | |||
709 | When CONFIG_OPTPROBES=y, this sysctl interface appears and it provides | ||
710 | a knob to globally and forcibly turn jump optimization (see section | ||
711 | 1.4) ON or OFF. By default, jump optimization is allowed (ON). | ||
712 | If you echo "0" to this file or set "debug.kprobes_optimization" to | ||
713 | 0 via sysctl, all optimized probes will be unoptimized, and any new | ||
714 | probes registered after that will not be optimized. Note that this | ||
715 | knob *changes* the optimized state. This means that optimized probes | ||
716 | (marked [OPTIMIZED]) will be unoptimized ([OPTIMIZED] tag will be | ||
717 | removed). If the knob is turned on, they will be optimized again. | ||
718 | |||
diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index 2811e452f756..c6416a398163 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt | |||
@@ -23,12 +23,12 @@ of a virtual machine. The ioctls belong to three classes | |||
23 | Only run vcpu ioctls from the same thread that was used to create the | 23 | Only run vcpu ioctls from the same thread that was used to create the |
24 | vcpu. | 24 | vcpu. |
25 | 25 | ||
26 | 2. File descritpors | 26 | 2. File descriptors |
27 | 27 | ||
28 | The kvm API is centered around file descriptors. An initial | 28 | The kvm API is centered around file descriptors. An initial |
29 | open("/dev/kvm") obtains a handle to the kvm subsystem; this handle | 29 | open("/dev/kvm") obtains a handle to the kvm subsystem; this handle |
30 | can be used to issue system ioctls. A KVM_CREATE_VM ioctl on this | 30 | can be used to issue system ioctls. A KVM_CREATE_VM ioctl on this |
31 | handle will create a VM file descripror which can be used to issue VM | 31 | handle will create a VM file descriptor which can be used to issue VM |
32 | ioctls. A KVM_CREATE_VCPU ioctl on a VM fd will create a virtual cpu | 32 | ioctls. A KVM_CREATE_VCPU ioctl on a VM fd will create a virtual cpu |
33 | and return a file descriptor pointing to it. Finally, ioctls on a vcpu | 33 | and return a file descriptor pointing to it. Finally, ioctls on a vcpu |
34 | fd can be used to control the vcpu, including the important task of | 34 | fd can be used to control the vcpu, including the important task of |
@@ -643,7 +643,7 @@ Type: vm ioctl | |||
643 | Parameters: struct kvm_clock_data (in) | 643 | Parameters: struct kvm_clock_data (in) |
644 | Returns: 0 on success, -1 on error | 644 | Returns: 0 on success, -1 on error |
645 | 645 | ||
646 | Sets the current timestamp of kvmclock to the valued specific in its parameter. | 646 | Sets the current timestamp of kvmclock to the value specified in its parameter. |
647 | In conjunction with KVM_GET_CLOCK, it is used to ensure monotonicity on scenarios | 647 | In conjunction with KVM_GET_CLOCK, it is used to ensure monotonicity on scenarios |
648 | such as migration. | 648 | such as migration. |
649 | 649 | ||
@@ -795,11 +795,11 @@ Unused. | |||
795 | __u64 data_offset; /* relative to kvm_run start */ | 795 | __u64 data_offset; /* relative to kvm_run start */ |
796 | } io; | 796 | } io; |
797 | 797 | ||
798 | If exit_reason is KVM_EXIT_IO_IN or KVM_EXIT_IO_OUT, then the vcpu has | 798 | If exit_reason is KVM_EXIT_IO, then the vcpu has |
799 | executed a port I/O instruction which could not be satisfied by kvm. | 799 | executed a port I/O instruction which could not be satisfied by kvm. |
800 | data_offset describes where the data is located (KVM_EXIT_IO_OUT) or | 800 | data_offset describes where the data is located (KVM_EXIT_IO_OUT) or |
801 | where kvm expects application code to place the data for the next | 801 | where kvm expects application code to place the data for the next |
802 | KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a patcked array. | 802 | KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a packed array. |
803 | 803 | ||
804 | struct { | 804 | struct { |
805 | struct kvm_debug_exit_arch arch; | 805 | struct kvm_debug_exit_arch arch; |
@@ -815,7 +815,7 @@ Unused. | |||
815 | __u8 is_write; | 815 | __u8 is_write; |
816 | } mmio; | 816 | } mmio; |
817 | 817 | ||
818 | If exit_reason is KVM_EXIT_MMIO or KVM_EXIT_IO_OUT, then the vcpu has | 818 | If exit_reason is KVM_EXIT_MMIO, then the vcpu has |
819 | executed a memory-mapped I/O instruction which could not be satisfied | 819 | executed a memory-mapped I/O instruction which could not be satisfied |
820 | by kvm. The 'data' member contains the written data if 'is_write' is | 820 | by kvm. The 'data' member contains the written data if 'is_write' is |
821 | true, and should be filled by application code otherwise. | 821 | true, and should be filled by application code otherwise. |
diff --git a/Documentation/laptops/00-INDEX b/Documentation/laptops/00-INDEX index ee5692b26dd4..fa688538e757 100644 --- a/Documentation/laptops/00-INDEX +++ b/Documentation/laptops/00-INDEX | |||
@@ -2,6 +2,12 @@ | |||
2 | - This file | 2 | - This file |
3 | acer-wmi.txt | 3 | acer-wmi.txt |
4 | - information on the Acer Laptop WMI Extras driver. | 4 | - information on the Acer Laptop WMI Extras driver. |
5 | asus-laptop.txt | ||
6 | - information on the Asus Laptop Extras driver. | ||
7 | disk-shock-protection.txt | ||
8 | - information on hard disk shock protection. | ||
9 | dslm.c | ||
10 | - Simple Disk Sleep Monitor program | ||
5 | laptop-mode.txt | 11 | laptop-mode.txt |
6 | - how to conserve battery power using laptop-mode. | 12 | - how to conserve battery power using laptop-mode. |
7 | sony-laptop.txt | 13 | sony-laptop.txt |
diff --git a/Documentation/laptops/Makefile b/Documentation/laptops/Makefile new file mode 100644 index 000000000000..5cb144af3c09 --- /dev/null +++ b/Documentation/laptops/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := dslm | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/laptops/dslm.c b/Documentation/laptops/dslm.c new file mode 100644 index 000000000000..72ff290c5fc6 --- /dev/null +++ b/Documentation/laptops/dslm.c | |||
@@ -0,0 +1,166 @@ | |||
1 | /* | ||
2 | * dslm.c | ||
3 | * Simple Disk Sleep Monitor | ||
4 | * by Bartek Kania | ||
5 | * Licenced under the GPL | ||
6 | */ | ||
7 | #include <unistd.h> | ||
8 | #include <stdlib.h> | ||
9 | #include <stdio.h> | ||
10 | #include <fcntl.h> | ||
11 | #include <errno.h> | ||
12 | #include <time.h> | ||
13 | #include <string.h> | ||
14 | #include <signal.h> | ||
15 | #include <sys/ioctl.h> | ||
16 | #include <linux/hdreg.h> | ||
17 | |||
18 | #ifdef DEBUG | ||
19 | #define D(x) x | ||
20 | #else | ||
21 | #define D(x) | ||
22 | #endif | ||
23 | |||
24 | int endit = 0; | ||
25 | |||
26 | /* Check if the disk is in powersave-mode | ||
27 | * Most of the code is stolen from hdparm. | ||
28 | * 1 = active, 0 = standby/sleep, -1 = unknown */ | ||
29 | static int check_powermode(int fd) | ||
30 | { | ||
31 | unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0}; | ||
32 | int state; | ||
33 | |||
34 | if (ioctl(fd, HDIO_DRIVE_CMD, &args) | ||
35 | && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */ | ||
36 | && ioctl(fd, HDIO_DRIVE_CMD, &args)) { | ||
37 | if (errno != EIO || args[0] != 0 || args[1] != 0) { | ||
38 | state = -1; /* "unknown"; */ | ||
39 | } else | ||
40 | state = 0; /* "sleeping"; */ | ||
41 | } else { | ||
42 | state = (args[2] == 255) ? 1 : 0; | ||
43 | } | ||
44 | D(printf(" drive state is: %d\n", state)); | ||
45 | |||
46 | return state; | ||
47 | } | ||
48 | |||
49 | static char *state_name(int i) | ||
50 | { | ||
51 | if (i == -1) return "unknown"; | ||
52 | if (i == 0) return "sleeping"; | ||
53 | if (i == 1) return "active"; | ||
54 | |||
55 | return "internal error"; | ||
56 | } | ||
57 | |||
58 | static char *myctime(time_t time) | ||
59 | { | ||
60 | char *ts = ctime(&time); | ||
61 | ts[strlen(ts) - 1] = 0; | ||
62 | |||
63 | return ts; | ||
64 | } | ||
65 | |||
66 | static void measure(int fd) | ||
67 | { | ||
68 | time_t start_time; | ||
69 | int last_state; | ||
70 | time_t last_time; | ||
71 | int curr_state; | ||
72 | time_t curr_time = 0; | ||
73 | time_t time_diff; | ||
74 | time_t active_time = 0; | ||
75 | time_t sleep_time = 0; | ||
76 | time_t unknown_time = 0; | ||
77 | time_t total_time = 0; | ||
78 | int changes = 0; | ||
79 | float tmp; | ||
80 | |||
81 | printf("Starting measurements\n"); | ||
82 | |||
83 | last_state = check_powermode(fd); | ||
84 | start_time = last_time = time(0); | ||
85 | printf(" System is in state %s\n\n", state_name(last_state)); | ||
86 | |||
87 | while(!endit) { | ||
88 | sleep(1); | ||
89 | curr_state = check_powermode(fd); | ||
90 | |||
91 | if (curr_state != last_state || endit) { | ||
92 | changes++; | ||
93 | curr_time = time(0); | ||
94 | time_diff = curr_time - last_time; | ||
95 | |||
96 | if (last_state == 1) active_time += time_diff; | ||
97 | else if (last_state == 0) sleep_time += time_diff; | ||
98 | else unknown_time += time_diff; | ||
99 | |||
100 | last_state = curr_state; | ||
101 | last_time = curr_time; | ||
102 | |||
103 | printf("%s: State-change to %s\n", myctime(curr_time), | ||
104 | state_name(curr_state)); | ||
105 | } | ||
106 | } | ||
107 | changes--; /* Compensate for SIGINT */ | ||
108 | |||
109 | total_time = time(0) - start_time; | ||
110 | printf("\nTotal running time: %lus\n", curr_time - start_time); | ||
111 | printf(" State changed %d times\n", changes); | ||
112 | |||
113 | tmp = (float)sleep_time / (float)total_time * 100; | ||
114 | printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp); | ||
115 | tmp = (float)active_time / (float)total_time * 100; | ||
116 | printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp); | ||
117 | tmp = (float)unknown_time / (float)total_time * 100; | ||
118 | printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp); | ||
119 | } | ||
120 | |||
121 | static void ender(int s) | ||
122 | { | ||
123 | endit = 1; | ||
124 | } | ||
125 | |||
126 | static void usage(void) | ||
127 | { | ||
128 | puts("usage: dslm [-w <time>] <disk>"); | ||
129 | exit(0); | ||
130 | } | ||
131 | |||
132 | int main(int argc, char **argv) | ||
133 | { | ||
134 | int fd; | ||
135 | char *disk = 0; | ||
136 | int settle_time = 60; | ||
137 | |||
138 | /* Parse the simple command-line */ | ||
139 | if (argc == 2) | ||
140 | disk = argv[1]; | ||
141 | else if (argc == 4) { | ||
142 | settle_time = atoi(argv[2]); | ||
143 | disk = argv[3]; | ||
144 | } else | ||
145 | usage(); | ||
146 | |||
147 | if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) { | ||
148 | printf("Can't open %s, because: %s\n", disk, strerror(errno)); | ||
149 | exit(-1); | ||
150 | } | ||
151 | |||
152 | if (settle_time) { | ||
153 | printf("Waiting %d seconds for the system to settle down to " | ||
154 | "'normal'\n", settle_time); | ||
155 | sleep(settle_time); | ||
156 | } else | ||
157 | puts("Not waiting for system to settle down"); | ||
158 | |||
159 | signal(SIGINT, ender); | ||
160 | |||
161 | measure(fd); | ||
162 | |||
163 | close(fd); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt index eeedee11c8c2..2c3c35093023 100644 --- a/Documentation/laptops/laptop-mode.txt +++ b/Documentation/laptops/laptop-mode.txt | |||
@@ -779,172 +779,4 @@ Monitoring tool | |||
779 | --------------- | 779 | --------------- |
780 | 780 | ||
781 | Bartek Kania submitted this, it can be used to measure how much time your disk | 781 | Bartek Kania submitted this, it can be used to measure how much time your disk |
782 | spends spun up/down. | 782 | spends spun up/down. See Documentation/laptops/dslm.c |
783 | |||
784 | ---------------------------dslm.c BEGIN----------------------------------------- | ||
785 | /* | ||
786 | * Simple Disk Sleep Monitor | ||
787 | * by Bartek Kania | ||
788 | * Licenced under the GPL | ||
789 | */ | ||
790 | #include <unistd.h> | ||
791 | #include <stdlib.h> | ||
792 | #include <stdio.h> | ||
793 | #include <fcntl.h> | ||
794 | #include <errno.h> | ||
795 | #include <time.h> | ||
796 | #include <string.h> | ||
797 | #include <signal.h> | ||
798 | #include <sys/ioctl.h> | ||
799 | #include <linux/hdreg.h> | ||
800 | |||
801 | #ifdef DEBUG | ||
802 | #define D(x) x | ||
803 | #else | ||
804 | #define D(x) | ||
805 | #endif | ||
806 | |||
807 | int endit = 0; | ||
808 | |||
809 | /* Check if the disk is in powersave-mode | ||
810 | * Most of the code is stolen from hdparm. | ||
811 | * 1 = active, 0 = standby/sleep, -1 = unknown */ | ||
812 | int check_powermode(int fd) | ||
813 | { | ||
814 | unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0}; | ||
815 | int state; | ||
816 | |||
817 | if (ioctl(fd, HDIO_DRIVE_CMD, &args) | ||
818 | && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */ | ||
819 | && ioctl(fd, HDIO_DRIVE_CMD, &args)) { | ||
820 | if (errno != EIO || args[0] != 0 || args[1] != 0) { | ||
821 | state = -1; /* "unknown"; */ | ||
822 | } else | ||
823 | state = 0; /* "sleeping"; */ | ||
824 | } else { | ||
825 | state = (args[2] == 255) ? 1 : 0; | ||
826 | } | ||
827 | D(printf(" drive state is: %d\n", state)); | ||
828 | |||
829 | return state; | ||
830 | } | ||
831 | |||
832 | char *state_name(int i) | ||
833 | { | ||
834 | if (i == -1) return "unknown"; | ||
835 | if (i == 0) return "sleeping"; | ||
836 | if (i == 1) return "active"; | ||
837 | |||
838 | return "internal error"; | ||
839 | } | ||
840 | |||
841 | char *myctime(time_t time) | ||
842 | { | ||
843 | char *ts = ctime(&time); | ||
844 | ts[strlen(ts) - 1] = 0; | ||
845 | |||
846 | return ts; | ||
847 | } | ||
848 | |||
849 | void measure(int fd) | ||
850 | { | ||
851 | time_t start_time; | ||
852 | int last_state; | ||
853 | time_t last_time; | ||
854 | int curr_state; | ||
855 | time_t curr_time = 0; | ||
856 | time_t time_diff; | ||
857 | time_t active_time = 0; | ||
858 | time_t sleep_time = 0; | ||
859 | time_t unknown_time = 0; | ||
860 | time_t total_time = 0; | ||
861 | int changes = 0; | ||
862 | float tmp; | ||
863 | |||
864 | printf("Starting measurements\n"); | ||
865 | |||
866 | last_state = check_powermode(fd); | ||
867 | start_time = last_time = time(0); | ||
868 | printf(" System is in state %s\n\n", state_name(last_state)); | ||
869 | |||
870 | while(!endit) { | ||
871 | sleep(1); | ||
872 | curr_state = check_powermode(fd); | ||
873 | |||
874 | if (curr_state != last_state || endit) { | ||
875 | changes++; | ||
876 | curr_time = time(0); | ||
877 | time_diff = curr_time - last_time; | ||
878 | |||
879 | if (last_state == 1) active_time += time_diff; | ||
880 | else if (last_state == 0) sleep_time += time_diff; | ||
881 | else unknown_time += time_diff; | ||
882 | |||
883 | last_state = curr_state; | ||
884 | last_time = curr_time; | ||
885 | |||
886 | printf("%s: State-change to %s\n", myctime(curr_time), | ||
887 | state_name(curr_state)); | ||
888 | } | ||
889 | } | ||
890 | changes--; /* Compensate for SIGINT */ | ||
891 | |||
892 | total_time = time(0) - start_time; | ||
893 | printf("\nTotal running time: %lus\n", curr_time - start_time); | ||
894 | printf(" State changed %d times\n", changes); | ||
895 | |||
896 | tmp = (float)sleep_time / (float)total_time * 100; | ||
897 | printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp); | ||
898 | tmp = (float)active_time / (float)total_time * 100; | ||
899 | printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp); | ||
900 | tmp = (float)unknown_time / (float)total_time * 100; | ||
901 | printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp); | ||
902 | } | ||
903 | |||
904 | void ender(int s) | ||
905 | { | ||
906 | endit = 1; | ||
907 | } | ||
908 | |||
909 | void usage() | ||
910 | { | ||
911 | puts("usage: dslm [-w <time>] <disk>"); | ||
912 | exit(0); | ||
913 | } | ||
914 | |||
915 | int main(int argc, char **argv) | ||
916 | { | ||
917 | int fd; | ||
918 | char *disk = 0; | ||
919 | int settle_time = 60; | ||
920 | |||
921 | /* Parse the simple command-line */ | ||
922 | if (argc == 2) | ||
923 | disk = argv[1]; | ||
924 | else if (argc == 4) { | ||
925 | settle_time = atoi(argv[2]); | ||
926 | disk = argv[3]; | ||
927 | } else | ||
928 | usage(); | ||
929 | |||
930 | if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) { | ||
931 | printf("Can't open %s, because: %s\n", disk, strerror(errno)); | ||
932 | exit(-1); | ||
933 | } | ||
934 | |||
935 | if (settle_time) { | ||
936 | printf("Waiting %d seconds for the system to settle down to " | ||
937 | "'normal'\n", settle_time); | ||
938 | sleep(settle_time); | ||
939 | } else | ||
940 | puts("Not waiting for system to settle down"); | ||
941 | |||
942 | signal(SIGINT, ender); | ||
943 | |||
944 | measure(fd); | ||
945 | |||
946 | close(fd); | ||
947 | |||
948 | return 0; | ||
949 | } | ||
950 | ---------------------------dslm.c END------------------------------------------- | ||
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 7f5809eddee6..631ad2f1b229 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt | |||
@@ -3,6 +3,7 @@ | |||
3 | ============================ | 3 | ============================ |
4 | 4 | ||
5 | By: David Howells <dhowells@redhat.com> | 5 | By: David Howells <dhowells@redhat.com> |
6 | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
6 | 7 | ||
7 | Contents: | 8 | Contents: |
8 | 9 | ||
@@ -60,6 +61,10 @@ Contents: | |||
60 | 61 | ||
61 | - And then there's the Alpha. | 62 | - And then there's the Alpha. |
62 | 63 | ||
64 | (*) Example uses. | ||
65 | |||
66 | - Circular buffers. | ||
67 | |||
63 | (*) References. | 68 | (*) References. |
64 | 69 | ||
65 | 70 | ||
@@ -2226,6 +2231,21 @@ The Alpha defines the Linux kernel's memory barrier model. | |||
2226 | See the subsection on "Cache Coherency" above. | 2231 | See the subsection on "Cache Coherency" above. |
2227 | 2232 | ||
2228 | 2233 | ||
2234 | ============ | ||
2235 | EXAMPLE USES | ||
2236 | ============ | ||
2237 | |||
2238 | CIRCULAR BUFFERS | ||
2239 | ---------------- | ||
2240 | |||
2241 | Memory barriers can be used to implement circular buffering without the need | ||
2242 | of a lock to serialise the producer with the consumer. See: | ||
2243 | |||
2244 | Documentation/circular-buffers.txt | ||
2245 | |||
2246 | for details. | ||
2247 | |||
2248 | |||
2229 | ========== | 2249 | ========== |
2230 | REFERENCES | 2250 | REFERENCES |
2231 | ========== | 2251 | ========== |
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile index 6d8af1ac56c4..5aba7a33aeeb 100644 --- a/Documentation/networking/Makefile +++ b/Documentation/networking/Makefile | |||
@@ -6,3 +6,5 @@ hostprogs-y := ifenslave | |||
6 | 6 | ||
7 | # Tell kbuild to always build the programs | 7 | # Tell kbuild to always build the programs |
8 | always := $(hostprogs-y) | 8 | always := $(hostprogs-y) |
9 | |||
10 | obj-m := timestamping/ | ||
diff --git a/Documentation/networking/skfp.txt b/Documentation/networking/skfp.txt index abfddf81e34a..203ec66c9fb4 100644 --- a/Documentation/networking/skfp.txt +++ b/Documentation/networking/skfp.txt | |||
@@ -68,7 +68,7 @@ Compaq adapters (not tested): | |||
68 | ======================= | 68 | ======================= |
69 | 69 | ||
70 | From v2.01 on, the driver is integrated in the linux kernel sources. | 70 | From v2.01 on, the driver is integrated in the linux kernel sources. |
71 | Therefor, the installation is the same as for any other adapter | 71 | Therefore, the installation is the same as for any other adapter |
72 | supported by the kernel. | 72 | supported by the kernel. |
73 | Refer to the manual of your distribution about the installation | 73 | Refer to the manual of your distribution about the installation |
74 | of network adapters. | 74 | of network adapters. |
diff --git a/Documentation/networking/timestamping/Makefile b/Documentation/networking/timestamping/Makefile index 2a1489fdc036..e79973443e9f 100644 --- a/Documentation/networking/timestamping/Makefile +++ b/Documentation/networking/timestamping/Makefile | |||
@@ -1,6 +1,13 @@ | |||
1 | CPPFLAGS = -I../../../include | 1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. |
2 | obj- := dummy.o | ||
2 | 3 | ||
3 | timestamping: timestamping.c | 4 | # List of programs to build |
5 | hostprogs-y := timestamping | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_timestamping.o += -I$(objtree)/usr/include | ||
4 | 11 | ||
5 | clean: | 12 | clean: |
6 | rm -f timestamping | 13 | rm -f timestamping |
diff --git a/Documentation/networking/timestamping/timestamping.c b/Documentation/networking/timestamping/timestamping.c index a7936fe8444a..8ba82bfe6a33 100644 --- a/Documentation/networking/timestamping/timestamping.c +++ b/Documentation/networking/timestamping/timestamping.c | |||
@@ -41,9 +41,9 @@ | |||
41 | #include <arpa/inet.h> | 41 | #include <arpa/inet.h> |
42 | #include <net/if.h> | 42 | #include <net/if.h> |
43 | 43 | ||
44 | #include "asm/types.h" | 44 | #include <asm/types.h> |
45 | #include "linux/net_tstamp.h" | 45 | #include <linux/net_tstamp.h> |
46 | #include "linux/errqueue.h" | 46 | #include <linux/errqueue.h> |
47 | 47 | ||
48 | #ifndef SO_TIMESTAMPING | 48 | #ifndef SO_TIMESTAMPING |
49 | # define SO_TIMESTAMPING 37 | 49 | # define SO_TIMESTAMPING 37 |
@@ -164,7 +164,7 @@ static void printpacket(struct msghdr *msg, int res, | |||
164 | 164 | ||
165 | gettimeofday(&now, 0); | 165 | gettimeofday(&now, 0); |
166 | 166 | ||
167 | printf("%ld.%06ld: received %s data, %d bytes from %s, %d bytes control messages\n", | 167 | printf("%ld.%06ld: received %s data, %d bytes from %s, %zu bytes control messages\n", |
168 | (long)now.tv_sec, (long)now.tv_usec, | 168 | (long)now.tv_sec, (long)now.tv_usec, |
169 | (recvmsg_flags & MSG_ERRQUEUE) ? "error" : "regular", | 169 | (recvmsg_flags & MSG_ERRQUEUE) ? "error" : "regular", |
170 | res, | 170 | res, |
@@ -173,7 +173,7 @@ static void printpacket(struct msghdr *msg, int res, | |||
173 | for (cmsg = CMSG_FIRSTHDR(msg); | 173 | for (cmsg = CMSG_FIRSTHDR(msg); |
174 | cmsg; | 174 | cmsg; |
175 | cmsg = CMSG_NXTHDR(msg, cmsg)) { | 175 | cmsg = CMSG_NXTHDR(msg, cmsg)) { |
176 | printf(" cmsg len %d: ", cmsg->cmsg_len); | 176 | printf(" cmsg len %zu: ", cmsg->cmsg_len); |
177 | switch (cmsg->cmsg_level) { | 177 | switch (cmsg->cmsg_level) { |
178 | case SOL_SOCKET: | 178 | case SOL_SOCKET: |
179 | printf("SOL_SOCKET "); | 179 | printf("SOL_SOCKET "); |
@@ -370,7 +370,7 @@ int main(int argc, char **argv) | |||
370 | } | 370 | } |
371 | 371 | ||
372 | sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); | 372 | sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); |
373 | if (socket < 0) | 373 | if (sock < 0) |
374 | bail("socket"); | 374 | bail("socket"); |
375 | 375 | ||
376 | memset(&device, 0, sizeof(device)); | 376 | memset(&device, 0, sizeof(device)); |
diff --git a/Documentation/pnp.txt b/Documentation/pnp.txt index a327db67782a..763e4659bf18 100644 --- a/Documentation/pnp.txt +++ b/Documentation/pnp.txt | |||
@@ -57,7 +57,7 @@ PC standard floppy disk controller | |||
57 | # cat resources | 57 | # cat resources |
58 | DISABLED | 58 | DISABLED |
59 | 59 | ||
60 | - Notice the string "DISABLED". THis means the device is not active. | 60 | - Notice the string "DISABLED". This means the device is not active. |
61 | 61 | ||
62 | 3.) check the device's possible configurations (optional) | 62 | 3.) check the device's possible configurations (optional) |
63 | # cat options | 63 | # cat options |
@@ -139,7 +139,7 @@ Plug and Play but it is planned to be in the near future. | |||
139 | 139 | ||
140 | Requirements for a Linux PnP protocol: | 140 | Requirements for a Linux PnP protocol: |
141 | 1.) the protocol must use EISA IDs | 141 | 1.) the protocol must use EISA IDs |
142 | 2.) the protocol must inform the PnP Layer of a devices current configuration | 142 | 2.) the protocol must inform the PnP Layer of a device's current configuration |
143 | - the ability to set resources is optional but preferred. | 143 | - the ability to set resources is optional but preferred. |
144 | 144 | ||
145 | The following are PnP protocol related functions: | 145 | The following are PnP protocol related functions: |
@@ -158,7 +158,7 @@ pnp_remove_device | |||
158 | - automatically will free mem used by the device and related structures | 158 | - automatically will free mem used by the device and related structures |
159 | 159 | ||
160 | pnp_add_id | 160 | pnp_add_id |
161 | - adds a EISA ID to the list of supported IDs for the specified device | 161 | - adds an EISA ID to the list of supported IDs for the specified device |
162 | 162 | ||
163 | For more information consult the source of a protocol such as | 163 | For more information consult the source of a protocol such as |
164 | /drivers/pnp/pnpbios/core.c. | 164 | /drivers/pnp/pnpbios/core.c. |
@@ -167,7 +167,7 @@ For more information consult the source of a protocol such as | |||
167 | 167 | ||
168 | Linux Plug and Play Drivers | 168 | Linux Plug and Play Drivers |
169 | --------------------------- | 169 | --------------------------- |
170 | This section contains information for linux PnP driver developers. | 170 | This section contains information for Linux PnP driver developers. |
171 | 171 | ||
172 | The New Way | 172 | The New Way |
173 | ........... | 173 | ........... |
@@ -235,11 +235,10 @@ static int __init serial8250_pnp_init(void) | |||
235 | The Old Way | 235 | The Old Way |
236 | ........... | 236 | ........... |
237 | 237 | ||
238 | a series of compatibility functions have been created to make it easy to convert | 238 | A series of compatibility functions have been created to make it easy to convert |
239 | |||
240 | ISAPNP drivers. They should serve as a temporary solution only. | 239 | ISAPNP drivers. They should serve as a temporary solution only. |
241 | 240 | ||
242 | they are as follows: | 241 | They are as follows: |
243 | 242 | ||
244 | struct pnp_card *pnp_find_card(unsigned short vendor, | 243 | struct pnp_card *pnp_find_card(unsigned short vendor, |
245 | unsigned short device, | 244 | unsigned short device, |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 356fd86f4ea8..55b859b3bc72 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
@@ -224,6 +224,12 @@ defined in include/linux/pm.h: | |||
224 | RPM_SUSPENDED, which means that each device is initially regarded by the | 224 | RPM_SUSPENDED, which means that each device is initially regarded by the |
225 | PM core as 'suspended', regardless of its real hardware status | 225 | PM core as 'suspended', regardless of its real hardware status |
226 | 226 | ||
227 | unsigned int runtime_auto; | ||
228 | - if set, indicates that the user space has allowed the device driver to | ||
229 | power manage the device at run time via the /sys/devices/.../power/control | ||
230 | interface; it may only be modified with the help of the pm_runtime_allow() | ||
231 | and pm_runtime_forbid() helper functions | ||
232 | |||
227 | All of the above fields are members of the 'power' member of 'struct device'. | 233 | All of the above fields are members of the 'power' member of 'struct device'. |
228 | 234 | ||
229 | 4. Run-time PM Device Helper Functions | 235 | 4. Run-time PM Device Helper Functions |
@@ -250,7 +256,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
250 | to suspend the device again in future | 256 | to suspend the device again in future |
251 | 257 | ||
252 | int pm_runtime_resume(struct device *dev); | 258 | int pm_runtime_resume(struct device *dev); |
253 | - execute the subsystem-leve resume callback for the device; returns 0 on | 259 | - execute the subsystem-level resume callback for the device; returns 0 on |
254 | success, 1 if the device's run-time PM status was already 'active' or | 260 | success, 1 if the device's run-time PM status was already 'active' or |
255 | error code on failure, where -EAGAIN means it may be safe to attempt to | 261 | error code on failure, where -EAGAIN means it may be safe to attempt to |
256 | resume the device again in future, but 'power.runtime_error' should be | 262 | resume the device again in future, but 'power.runtime_error' should be |
@@ -329,6 +335,20 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
329 | 'power.runtime_error' is set or 'power.disable_depth' is greater than | 335 | 'power.runtime_error' is set or 'power.disable_depth' is greater than |
330 | zero) | 336 | zero) |
331 | 337 | ||
338 | bool pm_runtime_suspended(struct device *dev); | ||
339 | - return true if the device's runtime PM status is 'suspended', or false | ||
340 | otherwise | ||
341 | |||
342 | void pm_runtime_allow(struct device *dev); | ||
343 | - set the power.runtime_auto flag for the device and decrease its usage | ||
344 | counter (used by the /sys/devices/.../power/control interface to | ||
345 | effectively allow the device to be power managed at run time) | ||
346 | |||
347 | void pm_runtime_forbid(struct device *dev); | ||
348 | - unset the power.runtime_auto flag for the device and increase its usage | ||
349 | counter (used by the /sys/devices/.../power/control interface to | ||
350 | effectively prevent the device from being power managed at run time) | ||
351 | |||
332 | It is safe to execute the following helper functions from interrupt context: | 352 | It is safe to execute the following helper functions from interrupt context: |
333 | 353 | ||
334 | pm_request_idle() | 354 | pm_request_idle() |
@@ -382,6 +402,18 @@ may be desirable to suspend the device as soon as ->probe() or ->remove() has | |||
382 | finished, so the PM core uses pm_runtime_idle_sync() to invoke the | 402 | finished, so the PM core uses pm_runtime_idle_sync() to invoke the |
383 | subsystem-level idle callback for the device at that time. | 403 | subsystem-level idle callback for the device at that time. |
384 | 404 | ||
405 | The user space can effectively disallow the driver of the device to power manage | ||
406 | it at run time by changing the value of its /sys/devices/.../power/control | ||
407 | attribute to "on", which causes pm_runtime_forbid() to be called. In principle, | ||
408 | this mechanism may also be used by the driver to effectively turn off the | ||
409 | run-time power management of the device until the user space turns it on. | ||
410 | Namely, during the initialization the driver can make sure that the run-time PM | ||
411 | status of the device is 'active' and call pm_runtime_forbid(). It should be | ||
412 | noted, however, that if the user space has already intentionally changed the | ||
413 | value of /sys/devices/.../power/control to "auto" to allow the driver to power | ||
414 | manage the device at run time, the driver may confuse it by using | ||
415 | pm_runtime_forbid() this way. | ||
416 | |||
385 | 6. Run-time PM and System Sleep | 417 | 6. Run-time PM and System Sleep |
386 | 418 | ||
387 | Run-time PM and system sleep (i.e., system suspend and hibernation, also known | 419 | Run-time PM and system sleep (i.e., system suspend and hibernation, also known |
@@ -431,3 +463,64 @@ The PM core always increments the run-time usage counter before calling the | |||
431 | ->prepare() callback and decrements it after calling the ->complete() callback. | 463 | ->prepare() callback and decrements it after calling the ->complete() callback. |
432 | Hence disabling run-time PM temporarily like this will not cause any run-time | 464 | Hence disabling run-time PM temporarily like this will not cause any run-time |
433 | suspend callbacks to be lost. | 465 | suspend callbacks to be lost. |
466 | |||
467 | 7. Generic subsystem callbacks | ||
468 | |||
469 | Subsystems may wish to conserve code space by using the set of generic power | ||
470 | management callbacks provided by the PM core, defined in | ||
471 | driver/base/power/generic_ops.c: | ||
472 | |||
473 | int pm_generic_runtime_idle(struct device *dev); | ||
474 | - invoke the ->runtime_idle() callback provided by the driver of this | ||
475 | device, if defined, and call pm_runtime_suspend() for this device if the | ||
476 | return value is 0 or the callback is not defined | ||
477 | |||
478 | int pm_generic_runtime_suspend(struct device *dev); | ||
479 | - invoke the ->runtime_suspend() callback provided by the driver of this | ||
480 | device and return its result, or return -EINVAL if not defined | ||
481 | |||
482 | int pm_generic_runtime_resume(struct device *dev); | ||
483 | - invoke the ->runtime_resume() callback provided by the driver of this | ||
484 | device and return its result, or return -EINVAL if not defined | ||
485 | |||
486 | int pm_generic_suspend(struct device *dev); | ||
487 | - if the device has not been suspended at run time, invoke the ->suspend() | ||
488 | callback provided by its driver and return its result, or return 0 if not | ||
489 | defined | ||
490 | |||
491 | int pm_generic_resume(struct device *dev); | ||
492 | - invoke the ->resume() callback provided by the driver of this device and, | ||
493 | if successful, change the device's runtime PM status to 'active' | ||
494 | |||
495 | int pm_generic_freeze(struct device *dev); | ||
496 | - if the device has not been suspended at run time, invoke the ->freeze() | ||
497 | callback provided by its driver and return its result, or return 0 if not | ||
498 | defined | ||
499 | |||
500 | int pm_generic_thaw(struct device *dev); | ||
501 | - if the device has not been suspended at run time, invoke the ->thaw() | ||
502 | callback provided by its driver and return its result, or return 0 if not | ||
503 | defined | ||
504 | |||
505 | int pm_generic_poweroff(struct device *dev); | ||
506 | - if the device has not been suspended at run time, invoke the ->poweroff() | ||
507 | callback provided by its driver and return its result, or return 0 if not | ||
508 | defined | ||
509 | |||
510 | int pm_generic_restore(struct device *dev); | ||
511 | - invoke the ->restore() callback provided by the driver of this device and, | ||
512 | if successful, change the device's runtime PM status to 'active' | ||
513 | |||
514 | These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(), | ||
515 | ->runtime_resume(), ->suspend(), ->resume(), ->freeze(), ->thaw(), ->poweroff(), | ||
516 | or ->restore() callback pointers in the subsystem-level dev_pm_ops structures. | ||
517 | |||
518 | If a subsystem wishes to use all of them at the same time, it can simply assign | ||
519 | the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its | ||
520 | dev_pm_ops structure pointer. | ||
521 | |||
522 | Device drivers that wish to use the same function as a system suspend, freeze, | ||
523 | poweroff and run-time suspend callback, and similarly for system resume, thaw, | ||
524 | restore, and run-time resume, can achieve this with the help of the | ||
525 | UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its | ||
526 | last argument to NULL). | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/dma.txt b/Documentation/powerpc/dts-bindings/fsl/dma.txt index 0732cdd05ba1..2a4b4bce6110 100644 --- a/Documentation/powerpc/dts-bindings/fsl/dma.txt +++ b/Documentation/powerpc/dts-bindings/fsl/dma.txt | |||
@@ -44,21 +44,29 @@ Example: | |||
44 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | 44 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; |
45 | cell-index = <0>; | 45 | cell-index = <0>; |
46 | reg = <0 0x80>; | 46 | reg = <0 0x80>; |
47 | interrupt-parent = <&ipic>; | ||
48 | interrupts = <71 8>; | ||
47 | }; | 49 | }; |
48 | dma-channel@80 { | 50 | dma-channel@80 { |
49 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | 51 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; |
50 | cell-index = <1>; | 52 | cell-index = <1>; |
51 | reg = <0x80 0x80>; | 53 | reg = <0x80 0x80>; |
54 | interrupt-parent = <&ipic>; | ||
55 | interrupts = <71 8>; | ||
52 | }; | 56 | }; |
53 | dma-channel@100 { | 57 | dma-channel@100 { |
54 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | 58 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; |
55 | cell-index = <2>; | 59 | cell-index = <2>; |
56 | reg = <0x100 0x80>; | 60 | reg = <0x100 0x80>; |
61 | interrupt-parent = <&ipic>; | ||
62 | interrupts = <71 8>; | ||
57 | }; | 63 | }; |
58 | dma-channel@180 { | 64 | dma-channel@180 { |
59 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | 65 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; |
60 | cell-index = <3>; | 66 | cell-index = <3>; |
61 | reg = <0x180 0x80>; | 67 | reg = <0x180 0x80>; |
68 | interrupt-parent = <&ipic>; | ||
69 | interrupts = <71 8>; | ||
62 | }; | 70 | }; |
63 | }; | 71 | }; |
64 | 72 | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/i2c.txt index b6d2e21474f9..50da20310585 100644 --- a/Documentation/powerpc/dts-bindings/fsl/i2c.txt +++ b/Documentation/powerpc/dts-bindings/fsl/i2c.txt | |||
@@ -2,15 +2,14 @@ | |||
2 | 2 | ||
3 | Required properties : | 3 | Required properties : |
4 | 4 | ||
5 | - device_type : Should be "i2c" | ||
6 | - reg : Offset and length of the register set for the device | 5 | - reg : Offset and length of the register set for the device |
6 | - compatible : should be "fsl,CHIP-i2c" where CHIP is the name of a | ||
7 | compatible processor, e.g. mpc8313, mpc8543, mpc8544, mpc5121, | ||
8 | mpc5200 or mpc5200b. For the mpc5121, an additional node | ||
9 | "fsl,mpc5121-i2c-ctrl" is required as shown in the example below. | ||
7 | 10 | ||
8 | Recommended properties : | 11 | Recommended properties : |
9 | 12 | ||
10 | - compatible : compatibility list with 2 entries, the first should | ||
11 | be "fsl,CHIP-i2c" where CHIP is the name of a compatible processor, | ||
12 | e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one | ||
13 | should be "fsl-i2c". | ||
14 | - interrupts : <a b> where a is the interrupt number and b is a | 13 | - interrupts : <a b> where a is the interrupt number and b is a |
15 | field that represents an encoding of the sense and level | 14 | field that represents an encoding of the sense and level |
16 | information for the interrupt. This should be encoded based on | 15 | information for the interrupt. This should be encoded based on |
@@ -24,25 +23,40 @@ Recommended properties : | |||
24 | 23 | ||
25 | Examples : | 24 | Examples : |
26 | 25 | ||
26 | /* MPC5121 based board */ | ||
27 | i2c@1740 { | ||
28 | #address-cells = <1>; | ||
29 | #size-cells = <0>; | ||
30 | compatible = "fsl,mpc5121-i2c", "fsl-i2c"; | ||
31 | reg = <0x1740 0x20>; | ||
32 | interrupts = <11 0x8>; | ||
33 | interrupt-parent = <&ipic>; | ||
34 | clock-frequency = <100000>; | ||
35 | }; | ||
36 | |||
37 | i2ccontrol@1760 { | ||
38 | compatible = "fsl,mpc5121-i2c-ctrl"; | ||
39 | reg = <0x1760 0x8>; | ||
40 | }; | ||
41 | |||
42 | /* MPC5200B based board */ | ||
27 | i2c@3d00 { | 43 | i2c@3d00 { |
28 | #address-cells = <1>; | 44 | #address-cells = <1>; |
29 | #size-cells = <0>; | 45 | #size-cells = <0>; |
30 | compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; | 46 | compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; |
31 | cell-index = <0>; | ||
32 | reg = <0x3d00 0x40>; | 47 | reg = <0x3d00 0x40>; |
33 | interrupts = <2 15 0>; | 48 | interrupts = <2 15 0>; |
34 | interrupt-parent = <&mpc5200_pic>; | 49 | interrupt-parent = <&mpc5200_pic>; |
35 | fsl,preserve-clocking; | 50 | fsl,preserve-clocking; |
36 | }; | 51 | }; |
37 | 52 | ||
53 | /* MPC8544 base board */ | ||
38 | i2c@3100 { | 54 | i2c@3100 { |
39 | #address-cells = <1>; | 55 | #address-cells = <1>; |
40 | #size-cells = <0>; | 56 | #size-cells = <0>; |
41 | cell-index = <1>; | ||
42 | compatible = "fsl,mpc8544-i2c", "fsl-i2c"; | 57 | compatible = "fsl,mpc8544-i2c", "fsl-i2c"; |
43 | reg = <0x3100 0x100>; | 58 | reg = <0x3100 0x100>; |
44 | interrupts = <43 2>; | 59 | interrupts = <43 2>; |
45 | interrupt-parent = <&mpic>; | 60 | interrupt-parent = <&mpic>; |
46 | clock-frequency = <400000>; | 61 | clock-frequency = <400000>; |
47 | }; | 62 | }; |
48 | |||
diff --git a/Documentation/s390/kvm.txt b/Documentation/s390/kvm.txt index 6f5ceb0f09fc..85f3280d7ef6 100644 --- a/Documentation/s390/kvm.txt +++ b/Documentation/s390/kvm.txt | |||
@@ -102,7 +102,7 @@ args: unsigned long | |||
102 | see also: include/linux/kvm.h | 102 | see also: include/linux/kvm.h |
103 | This ioctl stores the state of the cpu at the guest real address given as | 103 | This ioctl stores the state of the cpu at the guest real address given as |
104 | argument, unless one of the following values defined in include/linux/kvm.h | 104 | argument, unless one of the following values defined in include/linux/kvm.h |
105 | is given as arguement: | 105 | is given as argument: |
106 | KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in | 106 | KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in |
107 | absolute lowcore as defined by the principles of operation | 107 | absolute lowcore as defined by the principles of operation |
108 | KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in | 108 | KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in |
diff --git a/Documentation/scsi/ChangeLog.lpfc b/Documentation/scsi/ChangeLog.lpfc index ff19a52fe004..2ffc1148eb95 100644 --- a/Documentation/scsi/ChangeLog.lpfc +++ b/Documentation/scsi/ChangeLog.lpfc | |||
@@ -989,8 +989,8 @@ Changes from 20040709 to 20040716 | |||
989 | * Remove redundant port_cmp != 2 check in if | 989 | * Remove redundant port_cmp != 2 check in if |
990 | (!port_cmp) { .... if (port_cmp != 2).... } | 990 | (!port_cmp) { .... if (port_cmp != 2).... } |
991 | * Clock changes: removed struct clk_data and timerList. | 991 | * Clock changes: removed struct clk_data and timerList. |
992 | * Clock changes: seperate nodev_tmo and els_retry_delay into 2 | 992 | * Clock changes: separate nodev_tmo and els_retry_delay into 2 |
993 | seperate timers and convert to 1 argument changed | 993 | separate timers and convert to 1 argument changed |
994 | LPFC_NODE_FARP_PEND_t to struct lpfc_node_farp_pend convert | 994 | LPFC_NODE_FARP_PEND_t to struct lpfc_node_farp_pend convert |
995 | ipfarp_tmo to 1 argument convert target struct tmofunc and | 995 | ipfarp_tmo to 1 argument convert target struct tmofunc and |
996 | rtplunfunc to 1 argument * cr_count, cr_delay and | 996 | rtplunfunc to 1 argument * cr_count, cr_delay and |
@@ -1514,7 +1514,7 @@ Changes from 20040402 to 20040409 | |||
1514 | * Remove unused elxclock declaration in elx_sli.h. | 1514 | * Remove unused elxclock declaration in elx_sli.h. |
1515 | * Since everywhere IOCB_ENTRY is used, the return value is cast, | 1515 | * Since everywhere IOCB_ENTRY is used, the return value is cast, |
1516 | move the cast into the macro. | 1516 | move the cast into the macro. |
1517 | * Split ioctls out into seperate files | 1517 | * Split ioctls out into separate files |
1518 | 1518 | ||
1519 | Changes from 20040326 to 20040402 | 1519 | Changes from 20040326 to 20040402 |
1520 | 1520 | ||
@@ -1534,7 +1534,7 @@ Changes from 20040326 to 20040402 | |||
1534 | * Unused variable cleanup | 1534 | * Unused variable cleanup |
1535 | * Use Linux list macros for DMABUF_t | 1535 | * Use Linux list macros for DMABUF_t |
1536 | * Break up ioctls into 3 sections, dfc, util, hbaapi | 1536 | * Break up ioctls into 3 sections, dfc, util, hbaapi |
1537 | rearranged code so this could be easily seperated into a | 1537 | rearranged code so this could be easily separated into a |
1538 | differnet module later All 3 are currently turned on by | 1538 | differnet module later All 3 are currently turned on by |
1539 | defines in lpfc_ioctl.c LPFC_DFC_IOCTL, LPFC_UTIL_IOCTL, | 1539 | defines in lpfc_ioctl.c LPFC_DFC_IOCTL, LPFC_UTIL_IOCTL, |
1540 | LPFC_HBAAPI_IOCTL | 1540 | LPFC_HBAAPI_IOCTL |
@@ -1551,7 +1551,7 @@ Changes from 20040326 to 20040402 | |||
1551 | started by lpfc_online(). lpfc_offline() only stopped | 1551 | started by lpfc_online(). lpfc_offline() only stopped |
1552 | els_timeout routine. It now stops all timeout routines | 1552 | els_timeout routine. It now stops all timeout routines |
1553 | associated with that hba. | 1553 | associated with that hba. |
1554 | * Replace seperate next and prev pointers in struct | 1554 | * Replace separate next and prev pointers in struct |
1555 | lpfc_bindlist with list_head type. In elxHBA_t, replace | 1555 | lpfc_bindlist with list_head type. In elxHBA_t, replace |
1556 | fc_nlpbind_start and _end with fc_nlpbind_list and use | 1556 | fc_nlpbind_start and _end with fc_nlpbind_list and use |
1557 | list_head macros to access it. | 1557 | list_head macros to access it. |
diff --git a/Documentation/serial/tty.txt b/Documentation/serial/tty.txt index 5e5349a4fcd2..7c900507279f 100644 --- a/Documentation/serial/tty.txt +++ b/Documentation/serial/tty.txt | |||
@@ -105,6 +105,10 @@ write_wakeup() - May be called at any point between open and close. | |||
105 | is permitted to call the driver write method from | 105 | is permitted to call the driver write method from |
106 | this function. In such a situation defer it. | 106 | this function. In such a situation defer it. |
107 | 107 | ||
108 | dcd_change() - Report to the tty line the current DCD pin status | ||
109 | changes and the relative timestamp. The timestamp | ||
110 | can be NULL. | ||
111 | |||
108 | 112 | ||
109 | Driver Access | 113 | Driver Access |
110 | 114 | ||
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 33df82e3a398..bfcbbf88c44d 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -1812,7 +1812,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1812 | Module snd-ua101 | 1812 | Module snd-ua101 |
1813 | ---------------- | 1813 | ---------------- |
1814 | 1814 | ||
1815 | Module for the Edirol UA-101 audio/MIDI interface. | 1815 | Module for the Edirol UA-101/UA-1000 audio/MIDI interfaces. |
1816 | 1816 | ||
1817 | This module supports multiple devices, autoprobe and hotplugging. | 1817 | This module supports multiple devices, autoprobe and hotplugging. |
1818 | 1818 | ||
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index fc5790d36cd9..6c7d18c53f84 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -573,11 +573,14 @@ Because other nodes' memory may be free. This means system total status | |||
573 | may be not fatal yet. | 573 | may be not fatal yet. |
574 | 574 | ||
575 | If this is set to 2, the kernel panics compulsorily even on the | 575 | If this is set to 2, the kernel panics compulsorily even on the |
576 | above-mentioned. | 576 | above-mentioned. Even oom happens under memory cgroup, the whole |
577 | system panics. | ||
577 | 578 | ||
578 | The default value is 0. | 579 | The default value is 0. |
579 | 1 and 2 are for failover of clustering. Please select either | 580 | 1 and 2 are for failover of clustering. Please select either |
580 | according to your policy of failover. | 581 | according to your policy of failover. |
582 | panic_on_oom=2+kdump gives you very strong tool to investigate | ||
583 | why oom happens. You can get snapshot. | ||
581 | 584 | ||
582 | ============================================================= | 585 | ============================================================= |
583 | 586 | ||
diff --git a/Documentation/timers/00-INDEX b/Documentation/timers/00-INDEX index 397dc35e1323..a9248da5cdbc 100644 --- a/Documentation/timers/00-INDEX +++ b/Documentation/timers/00-INDEX | |||
@@ -4,6 +4,8 @@ highres.txt | |||
4 | - High resolution timers and dynamic ticks design notes | 4 | - High resolution timers and dynamic ticks design notes |
5 | hpet.txt | 5 | hpet.txt |
6 | - High Precision Event Timer Driver for Linux | 6 | - High Precision Event Timer Driver for Linux |
7 | hpet_example.c | ||
8 | - sample hpet timer test program | ||
7 | hrtimers.txt | 9 | hrtimers.txt |
8 | - subsystem for high-resolution kernel timers | 10 | - subsystem for high-resolution kernel timers |
9 | timer_stats.txt | 11 | timer_stats.txt |
diff --git a/Documentation/timers/Makefile b/Documentation/timers/Makefile new file mode 100644 index 000000000000..c85625f4ab25 --- /dev/null +++ b/Documentation/timers/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := hpet_example | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/timers/hpet.txt b/Documentation/timers/hpet.txt index 16d25e6b5a00..767392ffd31e 100644 --- a/Documentation/timers/hpet.txt +++ b/Documentation/timers/hpet.txt | |||
@@ -26,274 +26,5 @@ initialization. An example of this initialization can be found in | |||
26 | arch/x86/kernel/hpet.c. | 26 | arch/x86/kernel/hpet.c. |
27 | 27 | ||
28 | The driver provides a userspace API which resembles the API found in the | 28 | The driver provides a userspace API which resembles the API found in the |
29 | RTC driver framework. An example user space program is provided below. | 29 | RTC driver framework. An example user space program is provided in |
30 | 30 | file:Documentation/timers/hpet_example.c | |
31 | #include <stdio.h> | ||
32 | #include <stdlib.h> | ||
33 | #include <unistd.h> | ||
34 | #include <fcntl.h> | ||
35 | #include <string.h> | ||
36 | #include <memory.h> | ||
37 | #include <malloc.h> | ||
38 | #include <time.h> | ||
39 | #include <ctype.h> | ||
40 | #include <sys/types.h> | ||
41 | #include <sys/wait.h> | ||
42 | #include <signal.h> | ||
43 | #include <fcntl.h> | ||
44 | #include <errno.h> | ||
45 | #include <sys/time.h> | ||
46 | #include <linux/hpet.h> | ||
47 | |||
48 | |||
49 | extern void hpet_open_close(int, const char **); | ||
50 | extern void hpet_info(int, const char **); | ||
51 | extern void hpet_poll(int, const char **); | ||
52 | extern void hpet_fasync(int, const char **); | ||
53 | extern void hpet_read(int, const char **); | ||
54 | |||
55 | #include <sys/poll.h> | ||
56 | #include <sys/ioctl.h> | ||
57 | #include <signal.h> | ||
58 | |||
59 | struct hpet_command { | ||
60 | char *command; | ||
61 | void (*func)(int argc, const char ** argv); | ||
62 | } hpet_command[] = { | ||
63 | { | ||
64 | "open-close", | ||
65 | hpet_open_close | ||
66 | }, | ||
67 | { | ||
68 | "info", | ||
69 | hpet_info | ||
70 | }, | ||
71 | { | ||
72 | "poll", | ||
73 | hpet_poll | ||
74 | }, | ||
75 | { | ||
76 | "fasync", | ||
77 | hpet_fasync | ||
78 | }, | ||
79 | }; | ||
80 | |||
81 | int | ||
82 | main(int argc, const char ** argv) | ||
83 | { | ||
84 | int i; | ||
85 | |||
86 | argc--; | ||
87 | argv++; | ||
88 | |||
89 | if (!argc) { | ||
90 | fprintf(stderr, "-hpet: requires command\n"); | ||
91 | return -1; | ||
92 | } | ||
93 | |||
94 | |||
95 | for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++) | ||
96 | if (!strcmp(argv[0], hpet_command[i].command)) { | ||
97 | argc--; | ||
98 | argv++; | ||
99 | fprintf(stderr, "-hpet: executing %s\n", | ||
100 | hpet_command[i].command); | ||
101 | hpet_command[i].func(argc, argv); | ||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]); | ||
106 | |||
107 | return -1; | ||
108 | } | ||
109 | |||
110 | void | ||
111 | hpet_open_close(int argc, const char **argv) | ||
112 | { | ||
113 | int fd; | ||
114 | |||
115 | if (argc != 1) { | ||
116 | fprintf(stderr, "hpet_open_close: device-name\n"); | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | fd = open(argv[0], O_RDONLY); | ||
121 | if (fd < 0) | ||
122 | fprintf(stderr, "hpet_open_close: open failed\n"); | ||
123 | else | ||
124 | close(fd); | ||
125 | |||
126 | return; | ||
127 | } | ||
128 | |||
129 | void | ||
130 | hpet_info(int argc, const char **argv) | ||
131 | { | ||
132 | } | ||
133 | |||
134 | void | ||
135 | hpet_poll(int argc, const char **argv) | ||
136 | { | ||
137 | unsigned long freq; | ||
138 | int iterations, i, fd; | ||
139 | struct pollfd pfd; | ||
140 | struct hpet_info info; | ||
141 | struct timeval stv, etv; | ||
142 | struct timezone tz; | ||
143 | long usec; | ||
144 | |||
145 | if (argc != 3) { | ||
146 | fprintf(stderr, "hpet_poll: device-name freq iterations\n"); | ||
147 | return; | ||
148 | } | ||
149 | |||
150 | freq = atoi(argv[1]); | ||
151 | iterations = atoi(argv[2]); | ||
152 | |||
153 | fd = open(argv[0], O_RDONLY); | ||
154 | |||
155 | if (fd < 0) { | ||
156 | fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]); | ||
157 | return; | ||
158 | } | ||
159 | |||
160 | if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { | ||
161 | fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n"); | ||
162 | goto out; | ||
163 | } | ||
164 | |||
165 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
166 | fprintf(stderr, "hpet_poll: failed to get info\n"); | ||
167 | goto out; | ||
168 | } | ||
169 | |||
170 | fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags); | ||
171 | |||
172 | if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { | ||
173 | fprintf(stderr, "hpet_poll: HPET_EPI failed\n"); | ||
174 | goto out; | ||
175 | } | ||
176 | |||
177 | if (ioctl(fd, HPET_IE_ON, 0) < 0) { | ||
178 | fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n"); | ||
179 | goto out; | ||
180 | } | ||
181 | |||
182 | pfd.fd = fd; | ||
183 | pfd.events = POLLIN; | ||
184 | |||
185 | for (i = 0; i < iterations; i++) { | ||
186 | pfd.revents = 0; | ||
187 | gettimeofday(&stv, &tz); | ||
188 | if (poll(&pfd, 1, -1) < 0) | ||
189 | fprintf(stderr, "hpet_poll: poll failed\n"); | ||
190 | else { | ||
191 | long data; | ||
192 | |||
193 | gettimeofday(&etv, &tz); | ||
194 | usec = stv.tv_sec * 1000000 + stv.tv_usec; | ||
195 | usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec; | ||
196 | |||
197 | fprintf(stderr, | ||
198 | "hpet_poll: expired time = 0x%lx\n", usec); | ||
199 | |||
200 | fprintf(stderr, "hpet_poll: revents = 0x%x\n", | ||
201 | pfd.revents); | ||
202 | |||
203 | if (read(fd, &data, sizeof(data)) != sizeof(data)) { | ||
204 | fprintf(stderr, "hpet_poll: read failed\n"); | ||
205 | } | ||
206 | else | ||
207 | fprintf(stderr, "hpet_poll: data 0x%lx\n", | ||
208 | data); | ||
209 | } | ||
210 | } | ||
211 | |||
212 | out: | ||
213 | close(fd); | ||
214 | return; | ||
215 | } | ||
216 | |||
217 | static int hpet_sigio_count; | ||
218 | |||
219 | static void | ||
220 | hpet_sigio(int val) | ||
221 | { | ||
222 | fprintf(stderr, "hpet_sigio: called\n"); | ||
223 | hpet_sigio_count++; | ||
224 | } | ||
225 | |||
226 | void | ||
227 | hpet_fasync(int argc, const char **argv) | ||
228 | { | ||
229 | unsigned long freq; | ||
230 | int iterations, i, fd, value; | ||
231 | sig_t oldsig; | ||
232 | struct hpet_info info; | ||
233 | |||
234 | hpet_sigio_count = 0; | ||
235 | fd = -1; | ||
236 | |||
237 | if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) { | ||
238 | fprintf(stderr, "hpet_fasync: failed to set signal handler\n"); | ||
239 | return; | ||
240 | } | ||
241 | |||
242 | if (argc != 3) { | ||
243 | fprintf(stderr, "hpet_fasync: device-name freq iterations\n"); | ||
244 | goto out; | ||
245 | } | ||
246 | |||
247 | fd = open(argv[0], O_RDONLY); | ||
248 | |||
249 | if (fd < 0) { | ||
250 | fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]); | ||
251 | return; | ||
252 | } | ||
253 | |||
254 | |||
255 | if ((fcntl(fd, F_SETOWN, getpid()) == 1) || | ||
256 | ((value = fcntl(fd, F_GETFL)) == 1) || | ||
257 | (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) { | ||
258 | fprintf(stderr, "hpet_fasync: fcntl failed\n"); | ||
259 | goto out; | ||
260 | } | ||
261 | |||
262 | freq = atoi(argv[1]); | ||
263 | iterations = atoi(argv[2]); | ||
264 | |||
265 | if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { | ||
266 | fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n"); | ||
267 | goto out; | ||
268 | } | ||
269 | |||
270 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
271 | fprintf(stderr, "hpet_fasync: failed to get info\n"); | ||
272 | goto out; | ||
273 | } | ||
274 | |||
275 | fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags); | ||
276 | |||
277 | if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { | ||
278 | fprintf(stderr, "hpet_fasync: HPET_EPI failed\n"); | ||
279 | goto out; | ||
280 | } | ||
281 | |||
282 | if (ioctl(fd, HPET_IE_ON, 0) < 0) { | ||
283 | fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n"); | ||
284 | goto out; | ||
285 | } | ||
286 | |||
287 | for (i = 0; i < iterations; i++) { | ||
288 | (void) pause(); | ||
289 | fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count); | ||
290 | } | ||
291 | |||
292 | out: | ||
293 | signal(SIGIO, oldsig); | ||
294 | |||
295 | if (fd >= 0) | ||
296 | close(fd); | ||
297 | |||
298 | return; | ||
299 | } | ||
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c new file mode 100644 index 000000000000..f9ce2d9fdfd5 --- /dev/null +++ b/Documentation/timers/hpet_example.c | |||
@@ -0,0 +1,269 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <unistd.h> | ||
4 | #include <fcntl.h> | ||
5 | #include <string.h> | ||
6 | #include <memory.h> | ||
7 | #include <malloc.h> | ||
8 | #include <time.h> | ||
9 | #include <ctype.h> | ||
10 | #include <sys/types.h> | ||
11 | #include <sys/wait.h> | ||
12 | #include <signal.h> | ||
13 | #include <fcntl.h> | ||
14 | #include <errno.h> | ||
15 | #include <sys/time.h> | ||
16 | #include <linux/hpet.h> | ||
17 | |||
18 | |||
19 | extern void hpet_open_close(int, const char **); | ||
20 | extern void hpet_info(int, const char **); | ||
21 | extern void hpet_poll(int, const char **); | ||
22 | extern void hpet_fasync(int, const char **); | ||
23 | extern void hpet_read(int, const char **); | ||
24 | |||
25 | #include <sys/poll.h> | ||
26 | #include <sys/ioctl.h> | ||
27 | #include <signal.h> | ||
28 | |||
29 | struct hpet_command { | ||
30 | char *command; | ||
31 | void (*func)(int argc, const char ** argv); | ||
32 | } hpet_command[] = { | ||
33 | { | ||
34 | "open-close", | ||
35 | hpet_open_close | ||
36 | }, | ||
37 | { | ||
38 | "info", | ||
39 | hpet_info | ||
40 | }, | ||
41 | { | ||
42 | "poll", | ||
43 | hpet_poll | ||
44 | }, | ||
45 | { | ||
46 | "fasync", | ||
47 | hpet_fasync | ||
48 | }, | ||
49 | }; | ||
50 | |||
51 | int | ||
52 | main(int argc, const char ** argv) | ||
53 | { | ||
54 | int i; | ||
55 | |||
56 | argc--; | ||
57 | argv++; | ||
58 | |||
59 | if (!argc) { | ||
60 | fprintf(stderr, "-hpet: requires command\n"); | ||
61 | return -1; | ||
62 | } | ||
63 | |||
64 | |||
65 | for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++) | ||
66 | if (!strcmp(argv[0], hpet_command[i].command)) { | ||
67 | argc--; | ||
68 | argv++; | ||
69 | fprintf(stderr, "-hpet: executing %s\n", | ||
70 | hpet_command[i].command); | ||
71 | hpet_command[i].func(argc, argv); | ||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]); | ||
76 | |||
77 | return -1; | ||
78 | } | ||
79 | |||
80 | void | ||
81 | hpet_open_close(int argc, const char **argv) | ||
82 | { | ||
83 | int fd; | ||
84 | |||
85 | if (argc != 1) { | ||
86 | fprintf(stderr, "hpet_open_close: device-name\n"); | ||
87 | return; | ||
88 | } | ||
89 | |||
90 | fd = open(argv[0], O_RDONLY); | ||
91 | if (fd < 0) | ||
92 | fprintf(stderr, "hpet_open_close: open failed\n"); | ||
93 | else | ||
94 | close(fd); | ||
95 | |||
96 | return; | ||
97 | } | ||
98 | |||
99 | void | ||
100 | hpet_info(int argc, const char **argv) | ||
101 | { | ||
102 | } | ||
103 | |||
104 | void | ||
105 | hpet_poll(int argc, const char **argv) | ||
106 | { | ||
107 | unsigned long freq; | ||
108 | int iterations, i, fd; | ||
109 | struct pollfd pfd; | ||
110 | struct hpet_info info; | ||
111 | struct timeval stv, etv; | ||
112 | struct timezone tz; | ||
113 | long usec; | ||
114 | |||
115 | if (argc != 3) { | ||
116 | fprintf(stderr, "hpet_poll: device-name freq iterations\n"); | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | freq = atoi(argv[1]); | ||
121 | iterations = atoi(argv[2]); | ||
122 | |||
123 | fd = open(argv[0], O_RDONLY); | ||
124 | |||
125 | if (fd < 0) { | ||
126 | fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]); | ||
127 | return; | ||
128 | } | ||
129 | |||
130 | if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { | ||
131 | fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n"); | ||
132 | goto out; | ||
133 | } | ||
134 | |||
135 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
136 | fprintf(stderr, "hpet_poll: failed to get info\n"); | ||
137 | goto out; | ||
138 | } | ||
139 | |||
140 | fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags); | ||
141 | |||
142 | if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { | ||
143 | fprintf(stderr, "hpet_poll: HPET_EPI failed\n"); | ||
144 | goto out; | ||
145 | } | ||
146 | |||
147 | if (ioctl(fd, HPET_IE_ON, 0) < 0) { | ||
148 | fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n"); | ||
149 | goto out; | ||
150 | } | ||
151 | |||
152 | pfd.fd = fd; | ||
153 | pfd.events = POLLIN; | ||
154 | |||
155 | for (i = 0; i < iterations; i++) { | ||
156 | pfd.revents = 0; | ||
157 | gettimeofday(&stv, &tz); | ||
158 | if (poll(&pfd, 1, -1) < 0) | ||
159 | fprintf(stderr, "hpet_poll: poll failed\n"); | ||
160 | else { | ||
161 | long data; | ||
162 | |||
163 | gettimeofday(&etv, &tz); | ||
164 | usec = stv.tv_sec * 1000000 + stv.tv_usec; | ||
165 | usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec; | ||
166 | |||
167 | fprintf(stderr, | ||
168 | "hpet_poll: expired time = 0x%lx\n", usec); | ||
169 | |||
170 | fprintf(stderr, "hpet_poll: revents = 0x%x\n", | ||
171 | pfd.revents); | ||
172 | |||
173 | if (read(fd, &data, sizeof(data)) != sizeof(data)) { | ||
174 | fprintf(stderr, "hpet_poll: read failed\n"); | ||
175 | } | ||
176 | else | ||
177 | fprintf(stderr, "hpet_poll: data 0x%lx\n", | ||
178 | data); | ||
179 | } | ||
180 | } | ||
181 | |||
182 | out: | ||
183 | close(fd); | ||
184 | return; | ||
185 | } | ||
186 | |||
187 | static int hpet_sigio_count; | ||
188 | |||
189 | static void | ||
190 | hpet_sigio(int val) | ||
191 | { | ||
192 | fprintf(stderr, "hpet_sigio: called\n"); | ||
193 | hpet_sigio_count++; | ||
194 | } | ||
195 | |||
196 | void | ||
197 | hpet_fasync(int argc, const char **argv) | ||
198 | { | ||
199 | unsigned long freq; | ||
200 | int iterations, i, fd, value; | ||
201 | sig_t oldsig; | ||
202 | struct hpet_info info; | ||
203 | |||
204 | hpet_sigio_count = 0; | ||
205 | fd = -1; | ||
206 | |||
207 | if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) { | ||
208 | fprintf(stderr, "hpet_fasync: failed to set signal handler\n"); | ||
209 | return; | ||
210 | } | ||
211 | |||
212 | if (argc != 3) { | ||
213 | fprintf(stderr, "hpet_fasync: device-name freq iterations\n"); | ||
214 | goto out; | ||
215 | } | ||
216 | |||
217 | fd = open(argv[0], O_RDONLY); | ||
218 | |||
219 | if (fd < 0) { | ||
220 | fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]); | ||
221 | return; | ||
222 | } | ||
223 | |||
224 | |||
225 | if ((fcntl(fd, F_SETOWN, getpid()) == 1) || | ||
226 | ((value = fcntl(fd, F_GETFL)) == 1) || | ||
227 | (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) { | ||
228 | fprintf(stderr, "hpet_fasync: fcntl failed\n"); | ||
229 | goto out; | ||
230 | } | ||
231 | |||
232 | freq = atoi(argv[1]); | ||
233 | iterations = atoi(argv[2]); | ||
234 | |||
235 | if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { | ||
236 | fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n"); | ||
237 | goto out; | ||
238 | } | ||
239 | |||
240 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
241 | fprintf(stderr, "hpet_fasync: failed to get info\n"); | ||
242 | goto out; | ||
243 | } | ||
244 | |||
245 | fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags); | ||
246 | |||
247 | if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { | ||
248 | fprintf(stderr, "hpet_fasync: HPET_EPI failed\n"); | ||
249 | goto out; | ||
250 | } | ||
251 | |||
252 | if (ioctl(fd, HPET_IE_ON, 0) < 0) { | ||
253 | fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n"); | ||
254 | goto out; | ||
255 | } | ||
256 | |||
257 | for (i = 0; i < iterations; i++) { | ||
258 | (void) pause(); | ||
259 | fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count); | ||
260 | } | ||
261 | |||
262 | out: | ||
263 | signal(SIGIO, oldsig); | ||
264 | |||
265 | if (fd >= 0) | ||
266 | close(fd); | ||
267 | |||
268 | return; | ||
269 | } | ||
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index bab3040da548..03485bfbd797 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt | |||
@@ -1588,7 +1588,7 @@ module author does not need to worry about it. | |||
1588 | 1588 | ||
1589 | When tracing is enabled, kstop_machine is called to prevent | 1589 | When tracing is enabled, kstop_machine is called to prevent |
1590 | races with the CPUS executing code being modified (which can | 1590 | races with the CPUS executing code being modified (which can |
1591 | cause the CPU to do undesireable things), and the nops are | 1591 | cause the CPU to do undesirable things), and the nops are |
1592 | patched back to calls. But this time, they do not call mcount | 1592 | patched back to calls. But this time, they do not call mcount |
1593 | (which is just a function stub). They now call into the ftrace | 1593 | (which is just a function stub). They now call into the ftrace |
1594 | infrastructure. | 1594 | infrastructure. |
diff --git a/Documentation/vm/00-INDEX b/Documentation/vm/00-INDEX index e57d6a9dd32b..dca82d7c83d8 100644 --- a/Documentation/vm/00-INDEX +++ b/Documentation/vm/00-INDEX | |||
@@ -4,23 +4,35 @@ active_mm.txt | |||
4 | - An explanation from Linus about tsk->active_mm vs tsk->mm. | 4 | - An explanation from Linus about tsk->active_mm vs tsk->mm. |
5 | balance | 5 | balance |
6 | - various information on memory balancing. | 6 | - various information on memory balancing. |
7 | hugepage-mmap.c | ||
8 | - Example app using huge page memory with the mmap system call. | ||
9 | hugepage-shm.c | ||
10 | - Example app using huge page memory with Sys V shared memory system calls. | ||
7 | hugetlbpage.txt | 11 | hugetlbpage.txt |
8 | - a brief summary of hugetlbpage support in the Linux kernel. | 12 | - a brief summary of hugetlbpage support in the Linux kernel. |
13 | hwpoison.txt | ||
14 | - explains what hwpoison is | ||
9 | ksm.txt | 15 | ksm.txt |
10 | - how to use the Kernel Samepage Merging feature. | 16 | - how to use the Kernel Samepage Merging feature. |
11 | locking | 17 | locking |
12 | - info on how locking and synchronization is done in the Linux vm code. | 18 | - info on how locking and synchronization is done in the Linux vm code. |
19 | map_hugetlb.c | ||
20 | - an example program that uses the MAP_HUGETLB mmap flag. | ||
13 | numa | 21 | numa |
14 | - information about NUMA specific code in the Linux vm. | 22 | - information about NUMA specific code in the Linux vm. |
15 | numa_memory_policy.txt | 23 | numa_memory_policy.txt |
16 | - documentation of concepts and APIs of the 2.6 memory policy support. | 24 | - documentation of concepts and APIs of the 2.6 memory policy support. |
17 | overcommit-accounting | 25 | overcommit-accounting |
18 | - description of the Linux kernels overcommit handling modes. | 26 | - description of the Linux kernels overcommit handling modes. |
27 | page-types.c | ||
28 | - Tool for querying page flags | ||
19 | page_migration | 29 | page_migration |
20 | - description of page migration in NUMA systems. | 30 | - description of page migration in NUMA systems. |
31 | pagemap.txt | ||
32 | - pagemap, from the userspace perspective | ||
21 | slabinfo.c | 33 | slabinfo.c |
22 | - source code for a tool to get reports about slabs. | 34 | - source code for a tool to get reports about slabs. |
23 | slub.txt | 35 | slub.txt |
24 | - a short users guide for SLUB. | 36 | - a short users guide for SLUB. |
25 | map_hugetlb.c | 37 | unevictable-lru.txt |
26 | - an example program that uses the MAP_HUGETLB mmap flag. | 38 | - Unevictable LRU infrastructure |
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile index 5bd269b3731a..9dcff328b964 100644 --- a/Documentation/vm/Makefile +++ b/Documentation/vm/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | obj- := dummy.o | 2 | obj- := dummy.o |
3 | 3 | ||
4 | # List of programs to build | 4 | # List of programs to build |
5 | hostprogs-y := slabinfo page-types | 5 | hostprogs-y := slabinfo page-types hugepage-mmap hugepage-shm map_hugetlb |
6 | 6 | ||
7 | # Tell kbuild to always build the programs | 7 | # Tell kbuild to always build the programs |
8 | always := $(hostprogs-y) | 8 | always := $(hostprogs-y) |
diff --git a/Documentation/vm/hugepage-mmap.c b/Documentation/vm/hugepage-mmap.c new file mode 100644 index 000000000000..db0dd9a33d54 --- /dev/null +++ b/Documentation/vm/hugepage-mmap.c | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | * hugepage-mmap: | ||
3 | * | ||
4 | * Example of using huge page memory in a user application using the mmap | ||
5 | * system call. Before running this application, make sure that the | ||
6 | * administrator has mounted the hugetlbfs filesystem (on some directory | ||
7 | * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this | ||
8 | * example, the app is requesting memory of size 256MB that is backed by | ||
9 | * huge pages. | ||
10 | * | ||
11 | * For the ia64 architecture, the Linux kernel reserves Region number 4 for | ||
12 | * huge pages. That means that if one requires a fixed address, a huge page | ||
13 | * aligned address starting with 0x800000... will be required. If a fixed | ||
14 | * address is not required, the kernel will select an address in the proper | ||
15 | * range. | ||
16 | * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. | ||
17 | */ | ||
18 | |||
19 | #include <stdlib.h> | ||
20 | #include <stdio.h> | ||
21 | #include <unistd.h> | ||
22 | #include <sys/mman.h> | ||
23 | #include <fcntl.h> | ||
24 | |||
25 | #define FILE_NAME "/mnt/hugepagefile" | ||
26 | #define LENGTH (256UL*1024*1024) | ||
27 | #define PROTECTION (PROT_READ | PROT_WRITE) | ||
28 | |||
29 | /* Only ia64 requires this */ | ||
30 | #ifdef __ia64__ | ||
31 | #define ADDR (void *)(0x8000000000000000UL) | ||
32 | #define FLAGS (MAP_SHARED | MAP_FIXED) | ||
33 | #else | ||
34 | #define ADDR (void *)(0x0UL) | ||
35 | #define FLAGS (MAP_SHARED) | ||
36 | #endif | ||
37 | |||
38 | static void check_bytes(char *addr) | ||
39 | { | ||
40 | printf("First hex is %x\n", *((unsigned int *)addr)); | ||
41 | } | ||
42 | |||
43 | static void write_bytes(char *addr) | ||
44 | { | ||
45 | unsigned long i; | ||
46 | |||
47 | for (i = 0; i < LENGTH; i++) | ||
48 | *(addr + i) = (char)i; | ||
49 | } | ||
50 | |||
51 | static void read_bytes(char *addr) | ||
52 | { | ||
53 | unsigned long i; | ||
54 | |||
55 | check_bytes(addr); | ||
56 | for (i = 0; i < LENGTH; i++) | ||
57 | if (*(addr + i) != (char)i) { | ||
58 | printf("Mismatch at %lu\n", i); | ||
59 | break; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | int main(void) | ||
64 | { | ||
65 | void *addr; | ||
66 | int fd; | ||
67 | |||
68 | fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755); | ||
69 | if (fd < 0) { | ||
70 | perror("Open failed"); | ||
71 | exit(1); | ||
72 | } | ||
73 | |||
74 | addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0); | ||
75 | if (addr == MAP_FAILED) { | ||
76 | perror("mmap"); | ||
77 | unlink(FILE_NAME); | ||
78 | exit(1); | ||
79 | } | ||
80 | |||
81 | printf("Returned address is %p\n", addr); | ||
82 | check_bytes(addr); | ||
83 | write_bytes(addr); | ||
84 | read_bytes(addr); | ||
85 | |||
86 | munmap(addr, LENGTH); | ||
87 | close(fd); | ||
88 | unlink(FILE_NAME); | ||
89 | |||
90 | return 0; | ||
91 | } | ||
diff --git a/Documentation/vm/hugepage-shm.c b/Documentation/vm/hugepage-shm.c new file mode 100644 index 000000000000..07956d8592c9 --- /dev/null +++ b/Documentation/vm/hugepage-shm.c | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * hugepage-shm: | ||
3 | * | ||
4 | * Example of using huge page memory in a user application using Sys V shared | ||
5 | * memory system calls. In this example the app is requesting 256MB of | ||
6 | * memory that is backed by huge pages. The application uses the flag | ||
7 | * SHM_HUGETLB in the shmget system call to inform the kernel that it is | ||
8 | * requesting huge pages. | ||
9 | * | ||
10 | * For the ia64 architecture, the Linux kernel reserves Region number 4 for | ||
11 | * huge pages. That means that if one requires a fixed address, a huge page | ||
12 | * aligned address starting with 0x800000... will be required. If a fixed | ||
13 | * address is not required, the kernel will select an address in the proper | ||
14 | * range. | ||
15 | * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. | ||
16 | * | ||
17 | * Note: The default shared memory limit is quite low on many kernels, | ||
18 | * you may need to increase it via: | ||
19 | * | ||
20 | * echo 268435456 > /proc/sys/kernel/shmmax | ||
21 | * | ||
22 | * This will increase the maximum size per shared memory segment to 256MB. | ||
23 | * The other limit that you will hit eventually is shmall which is the | ||
24 | * total amount of shared memory in pages. To set it to 16GB on a system | ||
25 | * with a 4kB pagesize do: | ||
26 | * | ||
27 | * echo 4194304 > /proc/sys/kernel/shmall | ||
28 | */ | ||
29 | |||
30 | #include <stdlib.h> | ||
31 | #include <stdio.h> | ||
32 | #include <sys/types.h> | ||
33 | #include <sys/ipc.h> | ||
34 | #include <sys/shm.h> | ||
35 | #include <sys/mman.h> | ||
36 | |||
37 | #ifndef SHM_HUGETLB | ||
38 | #define SHM_HUGETLB 04000 | ||
39 | #endif | ||
40 | |||
41 | #define LENGTH (256UL*1024*1024) | ||
42 | |||
43 | #define dprintf(x) printf(x) | ||
44 | |||
45 | /* Only ia64 requires this */ | ||
46 | #ifdef __ia64__ | ||
47 | #define ADDR (void *)(0x8000000000000000UL) | ||
48 | #define SHMAT_FLAGS (SHM_RND) | ||
49 | #else | ||
50 | #define ADDR (void *)(0x0UL) | ||
51 | #define SHMAT_FLAGS (0) | ||
52 | #endif | ||
53 | |||
54 | int main(void) | ||
55 | { | ||
56 | int shmid; | ||
57 | unsigned long i; | ||
58 | char *shmaddr; | ||
59 | |||
60 | if ((shmid = shmget(2, LENGTH, | ||
61 | SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) { | ||
62 | perror("shmget"); | ||
63 | exit(1); | ||
64 | } | ||
65 | printf("shmid: 0x%x\n", shmid); | ||
66 | |||
67 | shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS); | ||
68 | if (shmaddr == (char *)-1) { | ||
69 | perror("Shared memory attach failure"); | ||
70 | shmctl(shmid, IPC_RMID, NULL); | ||
71 | exit(2); | ||
72 | } | ||
73 | printf("shmaddr: %p\n", shmaddr); | ||
74 | |||
75 | dprintf("Starting the writes:\n"); | ||
76 | for (i = 0; i < LENGTH; i++) { | ||
77 | shmaddr[i] = (char)(i); | ||
78 | if (!(i % (1024 * 1024))) | ||
79 | dprintf("."); | ||
80 | } | ||
81 | dprintf("\n"); | ||
82 | |||
83 | dprintf("Starting the Check..."); | ||
84 | for (i = 0; i < LENGTH; i++) | ||
85 | if (shmaddr[i] != (char)i) | ||
86 | printf("\nIndex %lu mismatched\n", i); | ||
87 | dprintf("Done.\n"); | ||
88 | |||
89 | if (shmdt((const void *)shmaddr) != 0) { | ||
90 | perror("Detach failure"); | ||
91 | shmctl(shmid, IPC_RMID, NULL); | ||
92 | exit(3); | ||
93 | } | ||
94 | |||
95 | shmctl(shmid, IPC_RMID, NULL); | ||
96 | |||
97 | return 0; | ||
98 | } | ||
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt index bc31636973e3..457634c1e03e 100644 --- a/Documentation/vm/hugetlbpage.txt +++ b/Documentation/vm/hugetlbpage.txt | |||
@@ -299,176 +299,11 @@ map_hugetlb.c. | |||
299 | ******************************************************************* | 299 | ******************************************************************* |
300 | 300 | ||
301 | /* | 301 | /* |
302 | * Example of using huge page memory in a user application using Sys V shared | 302 | * hugepage-shm: see Documentation/vm/hugepage-shm.c |
303 | * memory system calls. In this example the app is requesting 256MB of | ||
304 | * memory that is backed by huge pages. The application uses the flag | ||
305 | * SHM_HUGETLB in the shmget system call to inform the kernel that it is | ||
306 | * requesting huge pages. | ||
307 | * | ||
308 | * For the ia64 architecture, the Linux kernel reserves Region number 4 for | ||
309 | * huge pages. That means that if one requires a fixed address, a huge page | ||
310 | * aligned address starting with 0x800000... will be required. If a fixed | ||
311 | * address is not required, the kernel will select an address in the proper | ||
312 | * range. | ||
313 | * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. | ||
314 | * | ||
315 | * Note: The default shared memory limit is quite low on many kernels, | ||
316 | * you may need to increase it via: | ||
317 | * | ||
318 | * echo 268435456 > /proc/sys/kernel/shmmax | ||
319 | * | ||
320 | * This will increase the maximum size per shared memory segment to 256MB. | ||
321 | * The other limit that you will hit eventually is shmall which is the | ||
322 | * total amount of shared memory in pages. To set it to 16GB on a system | ||
323 | * with a 4kB pagesize do: | ||
324 | * | ||
325 | * echo 4194304 > /proc/sys/kernel/shmall | ||
326 | */ | 303 | */ |
327 | #include <stdlib.h> | ||
328 | #include <stdio.h> | ||
329 | #include <sys/types.h> | ||
330 | #include <sys/ipc.h> | ||
331 | #include <sys/shm.h> | ||
332 | #include <sys/mman.h> | ||
333 | |||
334 | #ifndef SHM_HUGETLB | ||
335 | #define SHM_HUGETLB 04000 | ||
336 | #endif | ||
337 | |||
338 | #define LENGTH (256UL*1024*1024) | ||
339 | |||
340 | #define dprintf(x) printf(x) | ||
341 | |||
342 | #define ADDR (void *)(0x0UL) /* let kernel choose address */ | ||
343 | #define SHMAT_FLAGS (0) | ||
344 | |||
345 | int main(void) | ||
346 | { | ||
347 | int shmid; | ||
348 | unsigned long i; | ||
349 | char *shmaddr; | ||
350 | |||
351 | if ((shmid = shmget(2, LENGTH, | ||
352 | SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) { | ||
353 | perror("shmget"); | ||
354 | exit(1); | ||
355 | } | ||
356 | printf("shmid: 0x%x\n", shmid); | ||
357 | |||
358 | shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS); | ||
359 | if (shmaddr == (char *)-1) { | ||
360 | perror("Shared memory attach failure"); | ||
361 | shmctl(shmid, IPC_RMID, NULL); | ||
362 | exit(2); | ||
363 | } | ||
364 | printf("shmaddr: %p\n", shmaddr); | ||
365 | |||
366 | dprintf("Starting the writes:\n"); | ||
367 | for (i = 0; i < LENGTH; i++) { | ||
368 | shmaddr[i] = (char)(i); | ||
369 | if (!(i % (1024 * 1024))) | ||
370 | dprintf("."); | ||
371 | } | ||
372 | dprintf("\n"); | ||
373 | |||
374 | dprintf("Starting the Check..."); | ||
375 | for (i = 0; i < LENGTH; i++) | ||
376 | if (shmaddr[i] != (char)i) | ||
377 | printf("\nIndex %lu mismatched\n", i); | ||
378 | dprintf("Done.\n"); | ||
379 | |||
380 | if (shmdt((const void *)shmaddr) != 0) { | ||
381 | perror("Detach failure"); | ||
382 | shmctl(shmid, IPC_RMID, NULL); | ||
383 | exit(3); | ||
384 | } | ||
385 | |||
386 | shmctl(shmid, IPC_RMID, NULL); | ||
387 | |||
388 | return 0; | ||
389 | } | ||
390 | 304 | ||
391 | ******************************************************************* | 305 | ******************************************************************* |
392 | 306 | ||
393 | /* | 307 | /* |
394 | * Example of using huge page memory in a user application using the mmap | 308 | * hugepage-mmap: see Documentation/vm/hugepage-mmap.c |
395 | * system call. Before running this application, make sure that the | ||
396 | * administrator has mounted the hugetlbfs filesystem (on some directory | ||
397 | * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this | ||
398 | * example, the app is requesting memory of size 256MB that is backed by | ||
399 | * huge pages. | ||
400 | * | ||
401 | * For the ia64 architecture, the Linux kernel reserves Region number 4 for | ||
402 | * huge pages. That means that if one requires a fixed address, a huge page | ||
403 | * aligned address starting with 0x800000... will be required. If a fixed | ||
404 | * address is not required, the kernel will select an address in the proper | ||
405 | * range. | ||
406 | * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. | ||
407 | */ | 309 | */ |
408 | #include <stdlib.h> | ||
409 | #include <stdio.h> | ||
410 | #include <unistd.h> | ||
411 | #include <sys/mman.h> | ||
412 | #include <fcntl.h> | ||
413 | |||
414 | #define FILE_NAME "/mnt/hugepagefile" | ||
415 | #define LENGTH (256UL*1024*1024) | ||
416 | #define PROTECTION (PROT_READ | PROT_WRITE) | ||
417 | |||
418 | #define ADDR (void *)(0x0UL) /* let kernel choose address */ | ||
419 | #define FLAGS (MAP_SHARED) | ||
420 | |||
421 | void check_bytes(char *addr) | ||
422 | { | ||
423 | printf("First hex is %x\n", *((unsigned int *)addr)); | ||
424 | } | ||
425 | |||
426 | void write_bytes(char *addr) | ||
427 | { | ||
428 | unsigned long i; | ||
429 | |||
430 | for (i = 0; i < LENGTH; i++) | ||
431 | *(addr + i) = (char)i; | ||
432 | } | ||
433 | |||
434 | void read_bytes(char *addr) | ||
435 | { | ||
436 | unsigned long i; | ||
437 | |||
438 | check_bytes(addr); | ||
439 | for (i = 0; i < LENGTH; i++) | ||
440 | if (*(addr + i) != (char)i) { | ||
441 | printf("Mismatch at %lu\n", i); | ||
442 | break; | ||
443 | } | ||
444 | } | ||
445 | |||
446 | int main(void) | ||
447 | { | ||
448 | void *addr; | ||
449 | int fd; | ||
450 | |||
451 | fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755); | ||
452 | if (fd < 0) { | ||
453 | perror("Open failed"); | ||
454 | exit(1); | ||
455 | } | ||
456 | |||
457 | addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0); | ||
458 | if (addr == MAP_FAILED) { | ||
459 | perror("mmap"); | ||
460 | unlink(FILE_NAME); | ||
461 | exit(1); | ||
462 | } | ||
463 | |||
464 | printf("Returned address is %p\n", addr); | ||
465 | check_bytes(addr); | ||
466 | write_bytes(addr); | ||
467 | read_bytes(addr); | ||
468 | |||
469 | munmap(addr, LENGTH); | ||
470 | close(fd); | ||
471 | unlink(FILE_NAME); | ||
472 | |||
473 | return 0; | ||
474 | } | ||
diff --git a/Documentation/vm/map_hugetlb.c b/Documentation/vm/map_hugetlb.c index e2bdae37f499..9969c7d9f985 100644 --- a/Documentation/vm/map_hugetlb.c +++ b/Documentation/vm/map_hugetlb.c | |||
@@ -31,12 +31,12 @@ | |||
31 | #define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB) | 31 | #define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB) |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | void check_bytes(char *addr) | 34 | static void check_bytes(char *addr) |
35 | { | 35 | { |
36 | printf("First hex is %x\n", *((unsigned int *)addr)); | 36 | printf("First hex is %x\n", *((unsigned int *)addr)); |
37 | } | 37 | } |
38 | 38 | ||
39 | void write_bytes(char *addr) | 39 | static void write_bytes(char *addr) |
40 | { | 40 | { |
41 | unsigned long i; | 41 | unsigned long i; |
42 | 42 | ||
@@ -44,7 +44,7 @@ void write_bytes(char *addr) | |||
44 | *(addr + i) = (char)i; | 44 | *(addr + i) = (char)i; |
45 | } | 45 | } |
46 | 46 | ||
47 | void read_bytes(char *addr) | 47 | static void read_bytes(char *addr) |
48 | { | 48 | { |
49 | unsigned long i; | 49 | unsigned long i; |
50 | 50 | ||
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt index b37300edf27c..07375e73981a 100644 --- a/Documentation/vm/slub.txt +++ b/Documentation/vm/slub.txt | |||
@@ -41,6 +41,7 @@ Possible debug options are | |||
41 | P Poisoning (object and padding) | 41 | P Poisoning (object and padding) |
42 | U User tracking (free and alloc) | 42 | U User tracking (free and alloc) |
43 | T Trace (please only use on single slabs) | 43 | T Trace (please only use on single slabs) |
44 | A Toggle failslab filter mark for the cache | ||
44 | O Switch debugging off for caches that would have | 45 | O Switch debugging off for caches that would have |
45 | caused higher minimum slab orders | 46 | caused higher minimum slab orders |
46 | - Switch all debugging off (useful if the kernel is | 47 | - Switch all debugging off (useful if the kernel is |
diff --git a/Documentation/volatile-considered-harmful.txt b/Documentation/volatile-considered-harmful.txt index 991c26a6ef64..db0cb228d64a 100644 --- a/Documentation/volatile-considered-harmful.txt +++ b/Documentation/volatile-considered-harmful.txt | |||
@@ -63,9 +63,9 @@ way to perform a busy wait is: | |||
63 | cpu_relax(); | 63 | cpu_relax(); |
64 | 64 | ||
65 | The cpu_relax() call can lower CPU power consumption or yield to a | 65 | The cpu_relax() call can lower CPU power consumption or yield to a |
66 | hyperthreaded twin processor; it also happens to serve as a memory barrier, | 66 | hyperthreaded twin processor; it also happens to serve as a compiler |
67 | so, once again, volatile is unnecessary. Of course, busy-waiting is | 67 | barrier, so, once again, volatile is unnecessary. Of course, busy- |
68 | generally an anti-social act to begin with. | 68 | waiting is generally an anti-social act to begin with. |
69 | 69 | ||
70 | There are still a few rare situations where volatile makes sense in the | 70 | There are still a few rare situations where volatile makes sense in the |
71 | kernel: | 71 | kernel: |
diff --git a/Documentation/voyager.txt b/Documentation/voyager.txt deleted file mode 100644 index 2749af552cdf..000000000000 --- a/Documentation/voyager.txt +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | Running Linux on the Voyager Architecture | ||
2 | ========================================= | ||
3 | |||
4 | For full details and current project status, see | ||
5 | |||
6 | http://www.hansenpartnership.com/voyager | ||
7 | |||
8 | The voyager architecture was designed by NCR in the mid 80s to be a | ||
9 | fully SMP capable RAS computing architecture built around intel's 486 | ||
10 | chip set. The voyager came in three levels of architectural | ||
11 | sophistication: 3,4 and 5 --- 1 and 2 never made it out of prototype. | ||
12 | The linux patches support only the Level 5 voyager architecture (any | ||
13 | machine class 3435 and above). | ||
14 | |||
15 | The Voyager Architecture | ||
16 | ------------------------ | ||
17 | |||
18 | Voyager machines consist of a Baseboard with a 386 diagnostic | ||
19 | processor, a Power Supply Interface (PSI) a Primary and possibly | ||
20 | Secondary Microchannel bus and between 2 and 20 voyager slots. The | ||
21 | voyager slots can be populated with memory and cpu cards (up to 4GB | ||
22 | memory and from 1 486 to 32 Pentium Pro processors). Internally, the | ||
23 | voyager has a dual arbitrated system bus and a configuration and test | ||
24 | bus (CAT). The voyager bus speed is 40MHz. Therefore (since all | ||
25 | voyager cards are dual ported for each system bus) the maximum | ||
26 | transfer rate is 320Mb/s but only if you have your slot configuration | ||
27 | tuned (only memory cards can communicate with both busses at once, CPU | ||
28 | cards utilise them one at a time). | ||
29 | |||
30 | Voyager SMP | ||
31 | ----------- | ||
32 | |||
33 | Since voyager was the first intel based SMP system, it is slightly | ||
34 | more primitive than the Intel IO-APIC approach to SMP. Voyager allows | ||
35 | arbitrary interrupt routing (including processor affinity routing) of | ||
36 | all 16 PC type interrupts. However it does this by using a modified | ||
37 | 5259 master/slave chip set instead of an APIC bus. Additionally, | ||
38 | voyager supports Cross Processor Interrupts (CPI) equivalent to the | ||
39 | APIC IPIs. There are two routed voyager interrupt lines provided to | ||
40 | each slot. | ||
41 | |||
42 | Processor Cards | ||
43 | --------------- | ||
44 | |||
45 | These come in single, dyadic and quad configurations (the quads are | ||
46 | problematic--see later). The maximum configuration is 8 quad cards | ||
47 | for 32 way SMP. | ||
48 | |||
49 | Quad Processors | ||
50 | --------------- | ||
51 | |||
52 | Because voyager only supplies two interrupt lines to each Processor | ||
53 | card, the Quad processors have to be configured (and Bootstrapped) in | ||
54 | as a pair of Master/Slave processors. | ||
55 | |||
56 | In fact, most Quad cards only accept one VIC interrupt line, so they | ||
57 | have one interrupt handling processor (called the VIC extended | ||
58 | processor) and three non-interrupt handling processors. | ||
59 | |||
60 | Current Status | ||
61 | -------------- | ||
62 | |||
63 | The System will boot on Mono, Dyad and Quad cards. There was | ||
64 | originally a Quad boot problem which has been fixed by proper gdt | ||
65 | alignment in the initial boot loader. If you still cannot get your | ||
66 | voyager system to boot, email me at: | ||
67 | |||
68 | <J.E.J.Bottomley@HansenPartnership.com> | ||
69 | |||
70 | |||
71 | The Quad cards now support using the separate Quad CPI vectors instead | ||
72 | of going through the VIC mailbox system. | ||
73 | |||
74 | The Level 4 architecture (3430 and 3360 Machines) should also work | ||
75 | fine. | ||
76 | |||
77 | Dump Switch | ||
78 | ----------- | ||
79 | |||
80 | The voyager dump switch sends out a broadcast NMI which the voyager | ||
81 | code intercepts and does a task dump. | ||
82 | |||
83 | Power Switch | ||
84 | ------------ | ||
85 | |||
86 | The front panel power switch is intercepted by the kernel and should | ||
87 | cause a system shutdown and power off. | ||
88 | |||
89 | A Note About Mixed CPU Systems | ||
90 | ------------------------------ | ||
91 | |||
92 | Linux isn't designed to handle mixed CPU systems very well. In order | ||
93 | to get everything going you *must* make sure that your lowest | ||
94 | capability CPU is used for booting. Also, mixing CPU classes | ||
95 | (e.g. 486 and 586) is really not going to work very well at all. | ||