* [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call
@ 2022-10-26 4:45 Gautam Menghani
2022-10-26 18:10 ` Yang Shi
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Gautam Menghani @ 2022-10-26 4:45 UTC (permalink / raw)
To: akpm, rostedt, mhiramat, shy828301, zokeefe, david
Cc: Gautam Menghani, linux-mm, linux-kernel
Refactor the mm_khugepaged_scan_file tracepoint to move filename
dereference to the tracepoint definition, for maintaing consistency with
other tracepoints[1].
[1]:lore.kernel.org/lkml/20221024111621.3ba17e2c@gandalf.local.home/
Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
---
include/trace/events/huge_memory.h | 8 ++++----
mm/khugepaged.c | 3 +--
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h
index 935af4947917..760455dfa860 100644
--- a/include/trace/events/huge_memory.h
+++ b/include/trace/events/huge_memory.h
@@ -171,15 +171,15 @@ TRACE_EVENT(mm_collapse_huge_page_swapin,
TRACE_EVENT(mm_khugepaged_scan_file,
- TP_PROTO(struct mm_struct *mm, struct page *page, const char *filename,
+ TP_PROTO(struct mm_struct *mm, struct page *page, struct file *file,
int present, int swap, int result),
- TP_ARGS(mm, page, filename, present, swap, result),
+ TP_ARGS(mm, page, file, present, swap, result),
TP_STRUCT__entry(
__field(struct mm_struct *, mm)
__field(unsigned long, pfn)
- __string(filename, filename)
+ __string(filename, file->f_path.dentry->d_iname)
__field(int, present)
__field(int, swap)
__field(int, result)
@@ -188,7 +188,7 @@ TRACE_EVENT(mm_khugepaged_scan_file,
TP_fast_assign(
__entry->mm = mm;
__entry->pfn = page ? page_to_pfn(page) : -1;
- __assign_str(filename, filename);
+ __assign_str(filename, file->f_path.dentry->d_iname);
__entry->present = present;
__entry->swap = swap;
__entry->result = result;
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 4734315f7940..9808a899f9f7 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -2157,8 +2157,7 @@ static int hpage_collapse_scan_file(struct mm_struct *mm, unsigned long addr,
}
}
- trace_mm_khugepaged_scan_file(mm, page, file->f_path.dentry->d_iname,
- present, swap, result);
+ trace_mm_khugepaged_scan_file(mm, page, file, present, swap, result);
return result;
}
#else
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call
2022-10-26 4:45 [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call Gautam Menghani
@ 2022-10-26 18:10 ` Yang Shi
2022-10-27 17:43 ` Zach O'Keefe
2022-11-14 15:24 ` Steven Rostedt
2022-11-16 22:35 ` Andrew Morton
2 siblings, 1 reply; 5+ messages in thread
From: Yang Shi @ 2022-10-26 18:10 UTC (permalink / raw)
To: Gautam Menghani
Cc: akpm, rostedt, mhiramat, zokeefe, david, linux-mm, linux-kernel
On Tue, Oct 25, 2022 at 9:45 PM Gautam Menghani
<gautammenghani201@gmail.com> wrote:
>
> Refactor the mm_khugepaged_scan_file tracepoint to move filename
> dereference to the tracepoint definition, for maintaing consistency with
> other tracepoints[1].
>
> [1]:lore.kernel.org/lkml/20221024111621.3ba17e2c@gandalf.local.home/
>
> Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
Reviewed-by: Yang Shi <shy828301@gmail.com>
> ---
> include/trace/events/huge_memory.h | 8 ++++----
> mm/khugepaged.c | 3 +--
> 2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h
> index 935af4947917..760455dfa860 100644
> --- a/include/trace/events/huge_memory.h
> +++ b/include/trace/events/huge_memory.h
> @@ -171,15 +171,15 @@ TRACE_EVENT(mm_collapse_huge_page_swapin,
>
> TRACE_EVENT(mm_khugepaged_scan_file,
>
> - TP_PROTO(struct mm_struct *mm, struct page *page, const char *filename,
> + TP_PROTO(struct mm_struct *mm, struct page *page, struct file *file,
> int present, int swap, int result),
>
> - TP_ARGS(mm, page, filename, present, swap, result),
> + TP_ARGS(mm, page, file, present, swap, result),
>
> TP_STRUCT__entry(
> __field(struct mm_struct *, mm)
> __field(unsigned long, pfn)
> - __string(filename, filename)
> + __string(filename, file->f_path.dentry->d_iname)
> __field(int, present)
> __field(int, swap)
> __field(int, result)
> @@ -188,7 +188,7 @@ TRACE_EVENT(mm_khugepaged_scan_file,
> TP_fast_assign(
> __entry->mm = mm;
> __entry->pfn = page ? page_to_pfn(page) : -1;
> - __assign_str(filename, filename);
> + __assign_str(filename, file->f_path.dentry->d_iname);
> __entry->present = present;
> __entry->swap = swap;
> __entry->result = result;
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index 4734315f7940..9808a899f9f7 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -2157,8 +2157,7 @@ static int hpage_collapse_scan_file(struct mm_struct *mm, unsigned long addr,
> }
> }
>
> - trace_mm_khugepaged_scan_file(mm, page, file->f_path.dentry->d_iname,
> - present, swap, result);
> + trace_mm_khugepaged_scan_file(mm, page, file, present, swap, result);
> return result;
> }
> #else
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call
2022-10-26 18:10 ` Yang Shi
@ 2022-10-27 17:43 ` Zach O'Keefe
0 siblings, 0 replies; 5+ messages in thread
From: Zach O'Keefe @ 2022-10-27 17:43 UTC (permalink / raw)
To: Yang Shi
Cc: Gautam Menghani, akpm, rostedt, mhiramat, david, linux-mm, linux-kernel
On Oct 26 11:10, Yang Shi wrote:
> On Tue, Oct 25, 2022 at 9:45 PM Gautam Menghani
> <gautammenghani201@gmail.com> wrote:
> >
> > Refactor the mm_khugepaged_scan_file tracepoint to move filename
> > dereference to the tracepoint definition, for maintaing consistency with
> > other tracepoints[1].
> >
> > [1]:lore.kernel.org/lkml/20221024111621.3ba17e2c@gandalf.local.home/
> >
> > Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
>
> Reviewed-by: Yang Shi <shy828301@gmail.com>
>
Reviewed-by: Zach O'Keefe <zokeefe@google.com>
> > ---
> > include/trace/events/huge_memory.h | 8 ++++----
> > mm/khugepaged.c | 3 +--
> > 2 files changed, 5 insertions(+), 6 deletions(-)
> >
> > diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h
> > index 935af4947917..760455dfa860 100644
> > --- a/include/trace/events/huge_memory.h
> > +++ b/include/trace/events/huge_memory.h
> > @@ -171,15 +171,15 @@ TRACE_EVENT(mm_collapse_huge_page_swapin,
> >
> > TRACE_EVENT(mm_khugepaged_scan_file,
> >
> > - TP_PROTO(struct mm_struct *mm, struct page *page, const char *filename,
> > + TP_PROTO(struct mm_struct *mm, struct page *page, struct file *file,
> > int present, int swap, int result),
> >
> > - TP_ARGS(mm, page, filename, present, swap, result),
> > + TP_ARGS(mm, page, file, present, swap, result),
> >
> > TP_STRUCT__entry(
> > __field(struct mm_struct *, mm)
> > __field(unsigned long, pfn)
> > - __string(filename, filename)
> > + __string(filename, file->f_path.dentry->d_iname)
> > __field(int, present)
> > __field(int, swap)
> > __field(int, result)
> > @@ -188,7 +188,7 @@ TRACE_EVENT(mm_khugepaged_scan_file,
> > TP_fast_assign(
> > __entry->mm = mm;
> > __entry->pfn = page ? page_to_pfn(page) : -1;
> > - __assign_str(filename, filename);
> > + __assign_str(filename, file->f_path.dentry->d_iname);
> > __entry->present = present;
> > __entry->swap = swap;
> > __entry->result = result;
> > diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> > index 4734315f7940..9808a899f9f7 100644
> > --- a/mm/khugepaged.c
> > +++ b/mm/khugepaged.c
> > @@ -2157,8 +2157,7 @@ static int hpage_collapse_scan_file(struct mm_struct *mm, unsigned long addr,
> > }
> > }
> >
> > - trace_mm_khugepaged_scan_file(mm, page, file->f_path.dentry->d_iname,
> > - present, swap, result);
> > + trace_mm_khugepaged_scan_file(mm, page, file, present, swap, result);
> > return result;
> > }
> > #else
> > --
> > 2.34.1
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call
2022-10-26 4:45 [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call Gautam Menghani
2022-10-26 18:10 ` Yang Shi
@ 2022-11-14 15:24 ` Steven Rostedt
2022-11-16 22:35 ` Andrew Morton
2 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2022-11-14 15:24 UTC (permalink / raw)
To: Gautam Menghani
Cc: akpm, mhiramat, shy828301, zokeefe, david, linux-mm, linux-kernel
On Wed, 26 Oct 2022 10:15:24 +0530
Gautam Menghani <gautammenghani201@gmail.com> wrote:
> Refactor the mm_khugepaged_scan_file tracepoint to move filename
> dereference to the tracepoint definition, for maintaing consistency with
> other tracepoints[1].
>
> [1]:lore.kernel.org/lkml/20221024111621.3ba17e2c@gandalf.local.home/
>
> Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
> ---
> include/trace/events/huge_memory.h | 8 ++++----
> mm/khugepaged.c | 3 +--
> 2 files changed, 5 insertions(+), 6 deletions(-)
From the tracing point of view:
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-- Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call
2022-10-26 4:45 [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call Gautam Menghani
2022-10-26 18:10 ` Yang Shi
2022-11-14 15:24 ` Steven Rostedt
@ 2022-11-16 22:35 ` Andrew Morton
2 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2022-11-16 22:35 UTC (permalink / raw)
To: Gautam Menghani
Cc: rostedt, mhiramat, shy828301, zokeefe, david, linux-mm, linux-kernel
On Wed, 26 Oct 2022 10:15:24 +0530 Gautam Menghani <gautammenghani201@gmail.com> wrote:
> Refactor the mm_khugepaged_scan_file tracepoint to move filename
> dereference to the tracepoint definition, for maintaing consistency with
> other tracepoints[1].
>
> [1]:lore.kernel.org/lkml/20221024111621.3ba17e2c@gandalf.local.home/
>
I just discovered by accident that this fixed an issue in a patch which
we merged during this -rc cycle. I'll move it from mm-unstable into
mm-hotfixes-unstable so this fix is also merged during this cycle.
Please do remember to flag such thnigs when perparing the changelogs.
Preferably with a Fixes: tag.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-16 22:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 4:45 [PATCH] mm/khugepaged: Refactor mm_khugepaged_scan_file tracepoint to remove filename from function call Gautam Menghani
2022-10-26 18:10 ` Yang Shi
2022-10-27 17:43 ` Zach O'Keefe
2022-11-14 15:24 ` Steven Rostedt
2022-11-16 22:35 ` Andrew Morton
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).