Loading Documentation/ABI/stable/sysfs-devices-node +95 −1 Original line number Diff line number Diff line What: /sys/devices/system/node/possible Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that could be possibly become online at some point. What: /sys/devices/system/node/online Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that are online. What: /sys/devices/system/node/has_normal_memory Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that have regular memory. What: /sys/devices/system/node/has_cpu Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that have one or more CPUs. What: /sys/devices/system/node/has_high_memory Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that have regular or high memory. Depends on CONFIG_HIGHMEM. What: /sys/devices/system/node/nodeX Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: When CONFIG_NUMA is enabled, this is a directory containing information on node X such as what CPUs are local to the node. node. Each file is detailed next. What: /sys/devices/system/node/nodeX/cpumap Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: The node's cpumap. What: /sys/devices/system/node/nodeX/cpulist Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: The CPUs associated to the node. What: /sys/devices/system/node/nodeX/meminfo Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Provides information about the node's distribution and memory utilization. Similar to /proc/meminfo, see Documentation/filesystems/proc.txt What: /sys/devices/system/node/nodeX/numastat Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: The node's hit/miss statistics, in units of pages. See Documentation/numastat.txt What: /sys/devices/system/node/nodeX/distance Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Distance between the node and all the other nodes in the system. What: /sys/devices/system/node/nodeX/vmstat Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: The node's zoned virtual memory statistics. This is a superset of numastat. What: /sys/devices/system/node/nodeX/compact Date: February 2010 Contact: Mel Gorman <mel@csn.ul.ie> Description: When this file is written to, all memory within that node will be compacted. When it completes, memory will be freed into blocks which have as many contiguous pages as possible What: /sys/devices/system/node/nodeX/scan_unevictable_pages Date: October 2008 Contact: Lee Schermerhorn <lee.schermerhorn@hp.com> Description: When set, it triggers scanning the node's unevictable lists and move any pages that have become evictable onto the respective zone's inactive list. See mm/vmscan.c What: /sys/devices/system/node/nodeX/hugepages/hugepages-<size>/ Date: December 2009 Contact: Lee Schermerhorn <lee.schermerhorn@hp.com> Description: The node's huge page size control/query attributes. See Documentation/vm/hugetlbpage.txt No newline at end of file Documentation/ABI/testing/ima_policy +2 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ Description: lsm: [[subj_user=] [subj_role=] [subj_type=] [obj_user=] [obj_role=] [obj_type=]] base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK] base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK][MODULE_CHECK] mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC] fsmagic:= hex value uid:= decimal value Loading Loading @@ -53,6 +53,7 @@ Description: measure func=BPRM_CHECK measure func=FILE_MMAP mask=MAY_EXEC measure func=FILE_CHECK mask=MAY_READ uid=0 measure func=MODULE_CHECK uid=0 appraise fowner=0 The default policy measures all executables in bprm_check, Loading Documentation/ABI/testing/sysfs-bus-rbd +4 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,10 @@ snap_* A directory per each snapshot parent Information identifying the pool, image, and snapshot id for the parent image in a layered rbd image (format 2 only). Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name> ------------------------------------------------------------- Loading Documentation/ABI/testing/sysfs-devices-nodedeleted 100644 → 0 +0 −7 Original line number Diff line number Diff line What: /sys/devices/system/node/nodeX/compact Date: February 2010 Contact: Mel Gorman <mel@csn.ul.ie> Description: When this file is written to, all memory within that node will be compacted. When it completes, memory will be freed into blocks which have as many contiguous pages as possible Documentation/DMA-API-HOWTO.txt +126 −0 Original line number Diff line number Diff line Loading @@ -468,11 +468,46 @@ To map a single region, you do: size_t size = buffer->len; dma_handle = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling; } and to unmap it: dma_unmap_single(dev, dma_handle, size, direction); You should call dma_mapping_error() as dma_map_single() could fail and return error. Not all dma implementations support dma_mapping_error() interface. However, it is a good practice to call dma_mapping_error() interface, which will invoke the generic mapping error check interface. Doing so will ensure that the mapping code will work correctly on all dma implementations without any dependency on the specifics of the underlying implementation. Using the returned address without checking for errors could result in failures ranging from panics to silent data corruption. Couple of example of incorrect ways to check for errors that make assumptions about the underlying dma implementation are as follows and these are applicable to dma_map_page() as well. Incorrect example 1: dma_addr_t dma_handle; dma_handle = dma_map_single(dev, addr, size, direction); if ((dma_handle & 0xffff != 0) || (dma_handle >= 0x1000000)) { goto map_error; } Incorrect example 2: dma_addr_t dma_handle; dma_handle = dma_map_single(dev, addr, size, direction); if (dma_handle == DMA_ERROR_CODE) { goto map_error; } You should call dma_unmap_single when the DMA activity is finished, e.g. from the interrupt which told you that the DMA transfer is done. Loading @@ -489,6 +524,14 @@ Specifically: size_t size = buffer->len; dma_handle = dma_map_page(dev, page, offset, size, direction); if (dma_mapping_error(dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling; } ... Loading @@ -496,6 +539,12 @@ Specifically: Here, "offset" means byte offset within the given page. You should call dma_mapping_error() as dma_map_page() could fail and return error as outlined under the dma_map_single() discussion. You should call dma_unmap_page when the DMA activity is finished, e.g. from the interrupt which told you that the DMA transfer is done. With scatterlists, you map a region gathered from several regions by: int i, count = dma_map_sg(dev, sglist, nents, direction); Loading Loading @@ -578,6 +627,14 @@ to use the dma_sync_*() interfaces. dma_addr_t mapping; mapping = dma_map_single(cp->dev, buffer, len, DMA_FROM_DEVICE); if (dma_mapping_error(dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling; } cp->rx_buf = buffer; cp->rx_len = len; Loading Loading @@ -658,6 +715,75 @@ failure can be determined by: * delay and try again later or * reset driver. */ goto map_error_handling; } - unmap pages that are already mapped, when mapping error occurs in the middle of a multiple page mapping attempt. These example are applicable to dma_map_page() as well. Example 1: dma_addr_t dma_handle1; dma_addr_t dma_handle2; dma_handle1 = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_handle1)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling1; } dma_handle2 = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_handle2)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling2; } ... map_error_handling2: dma_unmap_single(dma_handle1); map_error_handling1: Example 2: (if buffers are allocated a loop, unmap all mapped buffers when mapping error is detected in the middle) dma_addr_t dma_addr; dma_addr_t array[DMA_BUFFERS]; int save_index = 0; for (i = 0; i < DMA_BUFFERS; i++) { ... dma_addr = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_addr)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling; } array[i].dma_addr = dma_addr; save_index++; } ... map_error_handling: for (i = 0; i < save_index; i++) { ... dma_unmap_single(array[i].dma_addr); } Networking drivers must call dev_kfree_skb to free the socket buffer Loading Loading
Documentation/ABI/stable/sysfs-devices-node +95 −1 Original line number Diff line number Diff line What: /sys/devices/system/node/possible Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that could be possibly become online at some point. What: /sys/devices/system/node/online Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that are online. What: /sys/devices/system/node/has_normal_memory Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that have regular memory. What: /sys/devices/system/node/has_cpu Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that have one or more CPUs. What: /sys/devices/system/node/has_high_memory Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Nodes that have regular or high memory. Depends on CONFIG_HIGHMEM. What: /sys/devices/system/node/nodeX Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: When CONFIG_NUMA is enabled, this is a directory containing information on node X such as what CPUs are local to the node. node. Each file is detailed next. What: /sys/devices/system/node/nodeX/cpumap Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: The node's cpumap. What: /sys/devices/system/node/nodeX/cpulist Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: The CPUs associated to the node. What: /sys/devices/system/node/nodeX/meminfo Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Provides information about the node's distribution and memory utilization. Similar to /proc/meminfo, see Documentation/filesystems/proc.txt What: /sys/devices/system/node/nodeX/numastat Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: The node's hit/miss statistics, in units of pages. See Documentation/numastat.txt What: /sys/devices/system/node/nodeX/distance Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: Distance between the node and all the other nodes in the system. What: /sys/devices/system/node/nodeX/vmstat Date: October 2002 Contact: Linux Memory Management list <linux-mm@kvack.org> Description: The node's zoned virtual memory statistics. This is a superset of numastat. What: /sys/devices/system/node/nodeX/compact Date: February 2010 Contact: Mel Gorman <mel@csn.ul.ie> Description: When this file is written to, all memory within that node will be compacted. When it completes, memory will be freed into blocks which have as many contiguous pages as possible What: /sys/devices/system/node/nodeX/scan_unevictable_pages Date: October 2008 Contact: Lee Schermerhorn <lee.schermerhorn@hp.com> Description: When set, it triggers scanning the node's unevictable lists and move any pages that have become evictable onto the respective zone's inactive list. See mm/vmscan.c What: /sys/devices/system/node/nodeX/hugepages/hugepages-<size>/ Date: December 2009 Contact: Lee Schermerhorn <lee.schermerhorn@hp.com> Description: The node's huge page size control/query attributes. See Documentation/vm/hugetlbpage.txt No newline at end of file
Documentation/ABI/testing/ima_policy +2 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ Description: lsm: [[subj_user=] [subj_role=] [subj_type=] [obj_user=] [obj_role=] [obj_type=]] base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK] base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK][MODULE_CHECK] mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC] fsmagic:= hex value uid:= decimal value Loading Loading @@ -53,6 +53,7 @@ Description: measure func=BPRM_CHECK measure func=FILE_MMAP mask=MAY_EXEC measure func=FILE_CHECK mask=MAY_READ uid=0 measure func=MODULE_CHECK uid=0 appraise fowner=0 The default policy measures all executables in bprm_check, Loading
Documentation/ABI/testing/sysfs-bus-rbd +4 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,10 @@ snap_* A directory per each snapshot parent Information identifying the pool, image, and snapshot id for the parent image in a layered rbd image (format 2 only). Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name> ------------------------------------------------------------- Loading
Documentation/ABI/testing/sysfs-devices-nodedeleted 100644 → 0 +0 −7 Original line number Diff line number Diff line What: /sys/devices/system/node/nodeX/compact Date: February 2010 Contact: Mel Gorman <mel@csn.ul.ie> Description: When this file is written to, all memory within that node will be compacted. When it completes, memory will be freed into blocks which have as many contiguous pages as possible
Documentation/DMA-API-HOWTO.txt +126 −0 Original line number Diff line number Diff line Loading @@ -468,11 +468,46 @@ To map a single region, you do: size_t size = buffer->len; dma_handle = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling; } and to unmap it: dma_unmap_single(dev, dma_handle, size, direction); You should call dma_mapping_error() as dma_map_single() could fail and return error. Not all dma implementations support dma_mapping_error() interface. However, it is a good practice to call dma_mapping_error() interface, which will invoke the generic mapping error check interface. Doing so will ensure that the mapping code will work correctly on all dma implementations without any dependency on the specifics of the underlying implementation. Using the returned address without checking for errors could result in failures ranging from panics to silent data corruption. Couple of example of incorrect ways to check for errors that make assumptions about the underlying dma implementation are as follows and these are applicable to dma_map_page() as well. Incorrect example 1: dma_addr_t dma_handle; dma_handle = dma_map_single(dev, addr, size, direction); if ((dma_handle & 0xffff != 0) || (dma_handle >= 0x1000000)) { goto map_error; } Incorrect example 2: dma_addr_t dma_handle; dma_handle = dma_map_single(dev, addr, size, direction); if (dma_handle == DMA_ERROR_CODE) { goto map_error; } You should call dma_unmap_single when the DMA activity is finished, e.g. from the interrupt which told you that the DMA transfer is done. Loading @@ -489,6 +524,14 @@ Specifically: size_t size = buffer->len; dma_handle = dma_map_page(dev, page, offset, size, direction); if (dma_mapping_error(dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling; } ... Loading @@ -496,6 +539,12 @@ Specifically: Here, "offset" means byte offset within the given page. You should call dma_mapping_error() as dma_map_page() could fail and return error as outlined under the dma_map_single() discussion. You should call dma_unmap_page when the DMA activity is finished, e.g. from the interrupt which told you that the DMA transfer is done. With scatterlists, you map a region gathered from several regions by: int i, count = dma_map_sg(dev, sglist, nents, direction); Loading Loading @@ -578,6 +627,14 @@ to use the dma_sync_*() interfaces. dma_addr_t mapping; mapping = dma_map_single(cp->dev, buffer, len, DMA_FROM_DEVICE); if (dma_mapping_error(dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling; } cp->rx_buf = buffer; cp->rx_len = len; Loading Loading @@ -658,6 +715,75 @@ failure can be determined by: * delay and try again later or * reset driver. */ goto map_error_handling; } - unmap pages that are already mapped, when mapping error occurs in the middle of a multiple page mapping attempt. These example are applicable to dma_map_page() as well. Example 1: dma_addr_t dma_handle1; dma_addr_t dma_handle2; dma_handle1 = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_handle1)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling1; } dma_handle2 = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_handle2)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling2; } ... map_error_handling2: dma_unmap_single(dma_handle1); map_error_handling1: Example 2: (if buffers are allocated a loop, unmap all mapped buffers when mapping error is detected in the middle) dma_addr_t dma_addr; dma_addr_t array[DMA_BUFFERS]; int save_index = 0; for (i = 0; i < DMA_BUFFERS; i++) { ... dma_addr = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_addr)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ goto map_error_handling; } array[i].dma_addr = dma_addr; save_index++; } ... map_error_handling: for (i = 0; i < save_index; i++) { ... dma_unmap_single(array[i].dma_addr); } Networking drivers must call dev_kfree_skb to free the socket buffer Loading