ACK: [PATCH][SRU Disco] UBUNTU: SAUCE: cma: ratelimit cma_alloc error messages

Kleber Souza kleber.souza at canonical.com
Wed May 8 09:06:35 UTC 2019


On 5/7/19 7:01 PM, dann frazier wrote:
> BugLink: https://bugs.launchpad.net/bugs/1828092
> 
> We're seeing on the order of 10K cma_alloc() failure messages on
> certain systems (HiSilicon D06 w/ SMMU BIOS-disabled, HP m400s).
> While we continue to try and identify a solution that avoids
> these messages altogether, in the meantime let's lessen the impact
> (slow boot time, etc) by ratelimiting these messages. On a D06
> w/ SMMU disabled, this drops the error messages count from 10758 to
> 21.
> 
> Signed-off-by: dann frazier <dann.frazier at canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza at canonical.com>

> ---
>  mm/cma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/cma.c b/mm/cma.c
> index c7b39dd3b4f65..56d2a046f689e 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -477,7 +477,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
>  			page_kasan_tag_reset(page + i);
>  	}
>  
> -	if (ret && !no_warn) {
> +	if (ret && !no_warn && printk_ratelimit()) {
>  		pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n",
>  			__func__, count, ret);
>  		cma_debug_show_areas(cma);
> 




More information about the kernel-team mailing list