linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: nifan.cxl@gmail.com, rostedt@goodmis.org, mhiramat@kernel.org,
	willy@infradead.org
Cc: akpm@linux-foundation.org, david@redhat.com, fan.ni@samsung.com,
	yang@os.amperecomputing.com, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org,
	npache@redhat.com, mcgrof@kernel.org, a.manzanares@samsung.com,
	dave@stgolabs.net
Subject: Re: [PATCH v2 2/2] khugepaged: Refactor trace_mm_khugepaged_scan_pmd() to take folio instead of page
Date: Mon, 21 Apr 2025 10:54:37 +0800	[thread overview]
Message-ID: <65a0ffcd-d650-4dcd-8366-833f4a0ee7b6@linux.alibaba.com> (raw)
In-Reply-To: <20250418183920.273154-2-nifan.cxl@gmail.com>



On 2025/4/19 02:34, nifan.cxl@gmail.com wrote:
> From: Fan Ni <fan.ni@samsung.com>
> 
> trace_mm_khugepaged_scan_pmd() is only called in
> hpage_collapse_scan_pmd(), where the head page of a folio is passed in,
> so refactor it to take folio directly.
> 
> Signed-off-by: Fan Ni <fan.ni@samsung.com>

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
> This is a new patch added to the series.
> ---
>   include/trace/events/huge_memory.h | 6 +++---
>   mm/khugepaged.c                    | 2 +-
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h
> index a73699f000de..2305df6cb485 100644
> --- a/include/trace/events/huge_memory.h
> +++ b/include/trace/events/huge_memory.h
> @@ -55,10 +55,10 @@ SCAN_STATUS
>   
>   TRACE_EVENT(mm_khugepaged_scan_pmd,
>   
> -	TP_PROTO(struct mm_struct *mm, struct page *page, bool writable,
> +	TP_PROTO(struct mm_struct *mm, struct folio *folio, bool writable,
>   		 int referenced, int none_or_zero, int status, int unmapped),
>   
> -	TP_ARGS(mm, page, writable, referenced, none_or_zero, status, unmapped),
> +	TP_ARGS(mm, folio, writable, referenced, none_or_zero, status, unmapped),
>   
>   	TP_STRUCT__entry(
>   		__field(struct mm_struct *, mm)
> @@ -72,7 +72,7 @@ TRACE_EVENT(mm_khugepaged_scan_pmd,
>   
>   	TP_fast_assign(
>   		__entry->mm = mm;
> -		__entry->pfn = page ? page_to_pfn(page) : -1;
> +		__entry->pfn = folio ? folio_pfn(folio) : -1;
>   		__entry->writable = writable;
>   		__entry->referenced = referenced;
>   		__entry->none_or_zero = none_or_zero;
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index 950d147cd95e..bf5583dca1cb 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -1435,7 +1435,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
>   		*mmap_locked = false;
>   	}
>   out:
> -	trace_mm_khugepaged_scan_pmd(mm, &folio->page, writable, referenced,
> +	trace_mm_khugepaged_scan_pmd(mm, folio, writable, referenced,
>   				     none_or_zero, result, unmapped);
>   	return result;
>   }


  reply	other threads:[~2025-04-21  2:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18 18:34 [PATCH v2 1/2] khugepaged: Refactor trace_mm_collapse_huge_page_isolate() " nifan.cxl
2025-04-18 18:34 ` [PATCH v2 2/2] khugepaged: Refactor trace_mm_khugepaged_scan_pmd() " nifan.cxl
2025-04-21  2:54   ` Baolin Wang [this message]
2025-04-21 22:40   ` Yang Shi
2025-04-22  8:50     ` David Hildenbrand
2025-04-21 22:38 ` [PATCH v2 1/2] khugepaged: Refactor trace_mm_collapse_huge_page_isolate() " Yang Shi
2025-04-22  8:48 ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65a0ffcd-d650-4dcd-8366-833f4a0ee7b6@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=a.manzanares@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=david@redhat.com \
    --cc=fan.ni@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=nifan.cxl@gmail.com \
    --cc=npache@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=willy@infradead.org \
    --cc=yang@os.amperecomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox