On Thu, 25 Mar 2021 at 00:09, Minchan Kim <minc...@kernel.org> wrote: > > 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/ycoamxqt6dzkc...@kroah.com/ > > Tested-by: Dmitry Osipenko <dig...@gmail.com> > Reviewed-by: Dmitry Osipenko <dig...@gmail.com> > Reviewed-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> > Reviewed-by: John Hubbard <jhubb...@nvidia.com> > Link: > https://lore.kernel.org/linux-mm/20210316100433.17665-1-colin.k...@canonical.com/ > Addresses-Coverity: ("Dereference after null check") > Signed-off-by: Colin Ian King <colin.k...@canonical.com> > Signed-off-by: Minchan Kim <minc...@kernel.org>
Tested-by: Anders Roxell <anders.rox...@linaro.org>