a590359259
Since CMA is getting used more widely, it's more important to keep monitoring CMA statistics for system health since it's directly related to user experience. This patch introduces sysfs statistics for CMA, in order to provide some basic monitoring of the CMA allocator. * the number of CMA page successful allocations * the number of CMA page allocation failures These two values allow the user to calcuate the allocation failure rate for each CMA area. e.g.) /sys/kernel/mm/cma/WIFI/alloc_pages_[success|fail] /sys/kernel/mm/cma/SENSOR/alloc_pages_[success|fail] /sys/kernel/mm/cma/BLUETOOTH/alloc_pages_[success|fail] The cma_stat was intentionally allocated by dynamic allocation to harmonize with kobject lifetime management. https://lore.kernel.org/linux-mm/YCOAmXqt6dZkCQYs@kroah.com/ Link: https://lore.kernel.org/linux-mm/20210324230759.2213957-1-minchan@kernel.org/ Bug: 179256052 Tested-by: Dmitry Osipenko <digetx@gmail.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Link: https://lore.kernel.org/linux-mm/20210316100433.17665-1-colin.king@canonical.com/ Addresses-Coverity: ("Dereference after null check") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: I86239db91c7853a62a22b2161d1bf8c9099152b7
26 lines
739 B
Plaintext
26 lines
739 B
Plaintext
What: /sys/kernel/mm/cma/
|
|
Date: Feb 2021
|
|
Contact: Minchan Kim <minchan@kernel.org>
|
|
Description:
|
|
/sys/kernel/mm/cma/ contains a subdirectory for each CMA
|
|
heap name (also sometimes called CMA areas).
|
|
|
|
Each CMA heap subdirectory (that is, each
|
|
/sys/kernel/mm/cma/<cma-heap-name> directory) contains the
|
|
following items:
|
|
|
|
alloc_pages_success
|
|
alloc_pages_fail
|
|
|
|
What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_success
|
|
Date: Feb 2021
|
|
Contact: Minchan Kim <minchan@kernel.org>
|
|
Description:
|
|
the number of pages CMA API succeeded to allocate
|
|
|
|
What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_fail
|
|
Date: Feb 2021
|
|
Contact: Minchan Kim <minchan@kernel.org>
|
|
Description:
|
|
the number of pages CMA API failed to allocate
|