2021-02-09 14:30:03

by Georgi Djakov

[permalink] [raw]
Subject: [PATCH v2] mm: cma: Print region name on failure

From: Patrick Daly <[email protected]>

Print the name of the CMA region for convenience. This is useful
information to have when cma_alloc() fails.

Signed-off-by: Patrick Daly <[email protected]>
Signed-off-by: Georgi Djakov <[email protected]>
---
v2:
* Print the "count" variable, as it was originally in the code. (Randy)
* Fix spelling s/convienience/convenience/ in the commit text (Randy)

v1: https://lore.kernel.org/r/[email protected]/

mm/cma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/cma.c b/mm/cma.c
index 23d4a97c834a..54eee2119822 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -500,8 +500,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
}

if (ret && !no_warn) {
- pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n",
- __func__, count, ret);
+ pr_err("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n",
+ __func__, cma->name, count, ret);
cma_debug_show_areas(cma);
}


2021-02-09 16:08:05

by Minchan Kim

[permalink] [raw]
Subject: Re: [PATCH v2] mm: cma: Print region name on failure

On Tue, Feb 09, 2021 at 04:24:14PM +0200, Georgi Djakov wrote:
> From: Patrick Daly <[email protected]>
>
> Print the name of the CMA region for convenience. This is useful
> information to have when cma_alloc() fails.
>
> Signed-off-by: Patrick Daly <[email protected]>
> Signed-off-by: Georgi Djakov <[email protected]>
Acked-by: Minchan Kim <[email protected]>

2021-02-09 17:45:13

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH v2] mm: cma: Print region name on failure

On 2/9/21 6:24 AM, Georgi Djakov wrote:
> From: Patrick Daly <[email protected]>
>
> Print the name of the CMA region for convenience. This is useful
> information to have when cma_alloc() fails.
>
> Signed-off-by: Patrick Daly <[email protected]>
> Signed-off-by: Georgi Djakov <[email protected]>

Reviewed-by: Randy Dunlap <[email protected]>

Thanks.

> ---
> v2:
> * Print the "count" variable, as it was originally in the code. (Randy)
> * Fix spelling s/convienience/convenience/ in the commit text (Randy)
>
> v1: https://lore.kernel.org/r/[email protected]/
>
> mm/cma.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index 23d4a97c834a..54eee2119822 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -500,8 +500,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
> }
>
> if (ret && !no_warn) {
> - pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n",
> - __func__, count, ret);
> + pr_err("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n",
> + __func__, cma->name, count, ret);
> cma_debug_show_areas(cma);
> }
>
>


--
~Randy

2021-02-10 07:26:20

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH v2] mm: cma: Print region name on failure

On 09.02.21 15:24, Georgi Djakov wrote:
> From: Patrick Daly <[email protected]>
>
> Print the name of the CMA region for convenience. This is useful
> information to have when cma_alloc() fails.
>
> Signed-off-by: Patrick Daly <[email protected]>
> Signed-off-by: Georgi Djakov <[email protected]>
> ---
> v2:
> * Print the "count" variable, as it was originally in the code. (Randy)
> * Fix spelling s/convienience/convenience/ in the commit text (Randy)
>
> v1: https://lore.kernel.org/r/[email protected]/
>
> mm/cma.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index 23d4a97c834a..54eee2119822 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -500,8 +500,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
> }
>
> if (ret && !no_warn) {
> - pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n",
> - __func__, count, ret);
> + pr_err("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n",
> + __func__, cma->name, count, ret);
> cma_debug_show_areas(cma);
> }
>
>

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb