* [PATCH] mm/cma: pairing the trace_cma_alloc_start/finish
@ 2025-06-05 7:25 Richard Chang
2025-06-05 8:15 ` David Hildenbrand
0 siblings, 1 reply; 2+ messages in thread
From: Richard Chang @ 2025-06-05 7:25 UTC (permalink / raw)
To: Andrew Morton
Cc: Martin Liu, Minchan Kim, Kalesh Singh, linux-mm, linux-kernel,
Richard Chang
In the bad input validation cases, there is no
trace_cma_alloc_finish to match the trace_cma_alloc_start.
Move the trace_cma_alloc_start event after the validations.
Signed-off-by: Richard Chang <richardycc@google.com>
---
mm/cma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/cma.c b/mm/cma.c
index 397567883a10..bd3772773736 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -854,8 +854,6 @@ static struct page *__cma_alloc(struct cma *cma, unsigned long count,
unsigned long i;
const char *name = cma ? cma->name : NULL;
- trace_cma_alloc_start(name, count, align);
-
if (!cma || !cma->count)
return page;
@@ -865,6 +863,8 @@ static struct page *__cma_alloc(struct cma *cma, unsigned long count,
if (!count)
return page;
+ trace_cma_alloc_start(name, count, align);
+
for (r = 0; r < cma->nranges; r++) {
page = NULL;
--
2.50.0.rc0.604.gd4ff7b7c86-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm/cma: pairing the trace_cma_alloc_start/finish
2025-06-05 7:25 [PATCH] mm/cma: pairing the trace_cma_alloc_start/finish Richard Chang
@ 2025-06-05 8:15 ` David Hildenbrand
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2025-06-05 8:15 UTC (permalink / raw)
To: Richard Chang, Andrew Morton
Cc: Martin Liu, Minchan Kim, Kalesh Singh, linux-mm, linux-kernel
On 05.06.25 09:25, Richard Chang wrote:
> In the bad input validation cases, there is no
> trace_cma_alloc_finish to match the trace_cma_alloc_start.
> Move the trace_cma_alloc_start event after the validations.
>
> Signed-off-by: Richard Chang <richardycc@google.com>
> ---
> mm/cma.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index 397567883a10..bd3772773736 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -854,8 +854,6 @@ static struct page *__cma_alloc(struct cma *cma, unsigned long count,
> unsigned long i;
> const char *name = cma ? cma->name : NULL;
>
> - trace_cma_alloc_start(name, count, align);
> -
> if (!cma || !cma->count)
> return page;
>
> @@ -865,6 +863,8 @@ static struct page *__cma_alloc(struct cma *cma, unsigned long count,
> if (!count)
> return page;
>
> + trace_cma_alloc_start(name, count, align);
> +
> for (r = 0; r < cma->nranges; r++) {
> page = NULL;
>
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-05 8:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 7:25 [PATCH] mm/cma: pairing the trace_cma_alloc_start/finish Richard Chang
2025-06-05 8:15 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).