Re: [PATCH v3 1/2] mm/memblock: Add reserved memory release function

2025-02-17 Thread Mike Rapoport
Hi Masami, On Tue, Feb 11, 2025 at 11:47:03PM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Add reserve_mem_release_by_name() to release a reserved memory region > with a given name. This allows us to release reserved memory which is > defined by kernel cmdline, a

Re: [PATCH v2 03/11] sched: Add sched tracepoints for RV task model

2025-02-17 Thread Gabriele Monaco
On Mon, 2025-02-17 at 12:16 -0500, Steven Rostedt wrote: > On Mon, 17 Feb 2025 17:49:17 +0100 > Peter Zijlstra wrote: > > > On Mon, Feb 17, 2025 at 11:38:44AM -0500, Steven Rostedt wrote: > > > > > > +void __do_trace_set_current_state(int state_value) > > > > +{ > > > > + __do_trace_sch

Re: [RFC v2 7/9] khugepaged: add mTHP support

2025-02-17 Thread Dev Jain
On 11/02/25 6:00 am, Nico Pache wrote: Introduce the ability for khugepaged to collapse to different mTHP sizes. While scanning a PMD range for potential collapse candidates, keep track of pages in MIN_MTHP_ORDER chunks via a bitmap. Each bit represents a utilized region of order MIN_MTHP_ORDE

Re: [PATCH -next] uprobes: fix two zero old_folio bugs in __replace_page()

2025-02-17 Thread Tong Tiangen
在 2025/2/18 0:12, Oleg Nesterov 写道: Can't comment, my understanding of mm/ is not enough these days. Just one question... On 02/17, Tong Tiangen wrote: Fixes: 7396fa818d62 ("uprobes/core: Make background page replacement logic account for rss_stat counters") Fixes: 2b1444983508 ("uprobes,

Add Morton,Peter and David for discussion//Re: [PATCH -next] uprobes: fix two zero old_folio bugs in __replace_page()

2025-02-17 Thread Tong Tiangen
在 2025/2/17 20:38, Tong Tiangen 写道: We triggered the following error logs in syzkaller test: BUG: Bad page state in process syz.7.38 pfn:1eff3 page: refcount:0 mapcount:0 mapping: index:0x0 pfn:0x1eff3 flags: 0x3f4004(referenced|reserved|node=0|zone=1|lastcp

Re: [PATCH 0/2] kbuild: rpm-pkg: improve debuggability

2025-02-17 Thread Uday Shankar
ping

Re: [RFC v2 7/9] khugepaged: add mTHP support

2025-02-17 Thread Nico Pache
On Mon, Feb 17, 2025 at 1:55 PM Usama Arif wrote: > > > > On 11/02/2025 00:30, Nico Pache wrote: > > Introduce the ability for khugepaged to collapse to different mTHP sizes. > > While scanning a PMD range for potential collapse candidates, keep track > > of pages in MIN_MTHP_ORDER chunks via a bi

Re: [RFC v2 7/9] khugepaged: add mTHP support

2025-02-17 Thread Usama Arif
On 11/02/2025 00:30, Nico Pache wrote: > Introduce the ability for khugepaged to collapse to different mTHP sizes. > While scanning a PMD range for potential collapse candidates, keep track > of pages in MIN_MTHP_ORDER chunks via a bitmap. Each bit represents a > utilized region of order MIN_MTH

Re: [RFC v2 1/9] introduce khugepaged_collapse_single_pmd to unify khugepaged and madvise_collapse

2025-02-17 Thread Nico Pache
On Mon, Feb 17, 2025 at 10:11 AM Usama Arif wrote: > > > > On 11/02/2025 00:30, Nico Pache wrote: > > The khugepaged daemon and madvise_collapse have two different > > implementations that do almost the same thing. > > > > Create khugepaged_collapse_single_pmd to increase code > > reuse and create

Re: [RFC v2 0/9] khugepaged: mTHP support

2025-02-17 Thread Nico Pache
On Mon, Feb 17, 2025 at 1:06 AM Dev Jain wrote: > > > > On 15/02/25 12:08 pm, Dev Jain wrote: > > > > > > On 15/02/25 6:22 am, Nico Pache wrote: > >> On Thu, Feb 13, 2025 at 7:02 PM Dev Jain wrote: > >>> > >>> > >>> > >>> On 14/02/25 1:09 am, Nico Pache wrote: > On Thu, Feb 13, 2025 at 1:26 

Re: [RFC v2 0/9] khugepaged: mTHP support

2025-02-17 Thread Nico Pache
On Sun, Feb 16, 2025 at 11:39 PM Dev Jain wrote: > > > > On 11/02/25 6:00 am, Nico Pache wrote: > > The following series provides khugepaged and madvise collapse with the > > capability to collapse regions to mTHPs. > > > > To achieve this we generalize the khugepaged functions to no longer depend

Re: [RFC v2 6/9] khugepaged: introduce khugepaged_scan_bitmap for mTHP support

2025-02-17 Thread Usama Arif
On 11/02/2025 00:30, Nico Pache wrote: > khugepaged scans PMD ranges for potential collapse to a hugepage. To add > mTHP support we use this scan to instead record chunks of fully utilized > sections of the PMD. > > create a bitmap to represent a PMD in order MTHP_MIN_ORDER chunks. nit: s/MTH

Re: [PATCH 2/2] selftests/ftrace: Make uprobe test more robust against binary name

2025-02-17 Thread Steven Rostedt
On Mon, 17 Feb 2025 14:42:44 +0100 Heiko Carstens wrote: > > +REALBIN=`readlink -f /bin/sh` > > + > > echo 'cat /proc/$$/maps' | /bin/sh | \ > > - grep "r-xp .*/bin/.*sh$" | \ > > + grep "r-xp .*${REALBIN}$" | \ > > awk '{printf "p:myevent %s:0x%s\n", $6,$3 }' >> uprobe_events > > Thi

Re: [PATCH v2 03/11] sched: Add sched tracepoints for RV task model

2025-02-17 Thread Steven Rostedt
On Mon, 17 Feb 2025 17:49:17 +0100 Peter Zijlstra wrote: > On Mon, Feb 17, 2025 at 11:38:44AM -0500, Steven Rostedt wrote: > > > > +void __do_trace_set_current_state(int state_value) > > > +{ > > > + __do_trace_sched_set_state_tp(current, current->__state, state_value); > > > > And this shoul

Re: [RFC v2 1/9] introduce khugepaged_collapse_single_pmd to unify khugepaged and madvise_collapse

2025-02-17 Thread Usama Arif
On 11/02/2025 00:30, Nico Pache wrote: > The khugepaged daemon and madvise_collapse have two different > implementations that do almost the same thing. > > Create khugepaged_collapse_single_pmd to increase code > reuse and create an entry point for future khugepaged changes. > > Refactor madvi

Re: [PATCH v2 03/11] sched: Add sched tracepoints for RV task model

2025-02-17 Thread Peter Zijlstra
On Mon, Feb 17, 2025 at 11:38:44AM -0500, Steven Rostedt wrote: > > +void __do_trace_set_current_state(int state_value) > > +{ > > + __do_trace_sched_set_state_tp(current, current->__state, state_value); > > And this should not be using the internal macros of a trace point. It should > be: >

[PATCH v4 4/6] scripts/sorttable: Zero out weak functions in mcount_loc table

2025-02-17 Thread Steven Rostedt
From: Steven Rostedt When a function is annotated as "weak" and is overridden, the code is not removed. If it is traced, the fentry/mcount location in the weak function will be referenced by the "__mcount_loc" section. This will then be added to the available_filter_functions list. Since only the

Re: [PATCH v2 03/11] sched: Add sched tracepoints for RV task model

2025-02-17 Thread Steven Rostedt
On Fri, 14 Feb 2025 12:15:31 +0100 Gabriele Monaco wrote: > > >  > 503 __do_trace_sched_set_state_tp(current, current->__state, > > > state_value); > > >    504 } > > >    505 EXPORT_SYMBOL(__do_trace_set_current_state); > > >    506 > >   > > I honestly don't get why this build fail

Re: [PATCH v2 03/11] sched: Add sched tracepoints for RV task model

2025-02-17 Thread Steven Rostedt
On Thu, 13 Feb 2025 10:08:01 +0100 Gabriele Monaco wrote: > diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h > index 9ea4c404bd4ef..cc3be04fe9986 100644 > --- a/include/trace/events/sched.h > +++ b/include/trace/events/sched.h > @@ -824,6 +824,19 @@ DECLARE_TRACE(sched_com

Re: [PATCH -next] uprobes: fix two zero old_folio bugs in __replace_page()

2025-02-17 Thread Oleg Nesterov
Can't comment, my understanding of mm/ is not enough these days. Just one question... On 02/17, Tong Tiangen wrote: > > Fixes: 7396fa818d62 ("uprobes/core: Make background page replacement logic > account for rss_stat counters") > Fixes: 2b1444983508 ("uprobes, mm, x86: Add the ability to instal

[PATCH v4 1/6] arm64: scripts/sorttable: Implement sorting mcount_loc at boot for arm64

2025-02-17 Thread Steven Rostedt
From: Steven Rostedt The mcount_loc section holds the addresses of the functions that get patched by ftrace when enabling function callbacks. It can contain tens of thousands of entries. These addresses must be sorted. If they are not sorted at compile time, they are sorted at boot. Sorting at bo

[PATCH v4 2/6] scripts/sorttable: Have mcount rela sort use direct values

2025-02-17 Thread Steven Rostedt
From: Steven Rostedt The mcount_loc sorting for when the values are stored in the Elf_Rela entries uses the compare_extable() function to do the compares in the qsort(). That function does handle byte swapping if the machine being compiled for is a different endian than the host machine. But the

[PATCH v4 5/6] ftrace: Update the mcount_loc check of skipped entries

2025-02-17 Thread Steven Rostedt
From: Steven Rostedt Now that weak functions turn into skipped entries, update the check to make sure the amount that was allocated would fit both the entries that were allocated as well as those that were skipped. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 24 +

[PATCH v4 6/6] ftrace: Have ftrace pages output reflect freed pages

2025-02-17 Thread Steven Rostedt
From: Steven Rostedt The amount of memory that ftrace uses to save the descriptors to manage the functions it can trace is shown at output. But if there are a lot of functions that are skipped because they were weak or the architecture added holes into the tables, then the extra pages that were a

[PATCH v4 3/6] scripts/sorttable: Always use an array for the mcount_loc sorting

2025-02-17 Thread Steven Rostedt
From: Steven Rostedt The sorting of the mcount_loc section is done directly to the section for x86 and arm32 but it uses a separate array for arm64 as arm64 has the values for the mcount_loc stored in the rela sections of the vmlinux ELF file. In order to use the same code to remove weak functio

[PATCH v4 0/6] scripts/sorttable: ftrace: Remove place holders for weak functions in available_filter_functions

2025-02-17 Thread Steven Rostedt
This series removes the place holder __ftrace_invalid_address___ from the available_filter_functions file. The rewriting of the sorttable.c code to make it more manageable has already been merged: https://git.kernel.org/torvalds/c/c0e75905caf368e19aab585d20151500e750de89 Now this is only for

Re: [PATCH v3 4/6] scripts/sorttable: Zero out weak functions in mcount_loc table

2025-02-17 Thread Steven Rostedt
On Fri, 14 Feb 2025 23:14:26 +0100 Jiri Olsa wrote: > > + while (fscanf(fp, "%16s %16s %c %*s\n", addr_str, size_str, &type) == > > 3) { > > + uint64_t addr; > > + uint64_t size; > > + > > + /* Only care about functions */ > > + if (type != 't' && type !

Re: [PATCH v5 RESEND] cpuidle: psci: Add trace for PSCI domain idle

2025-02-17 Thread Ulf Hansson
On Mon, 10 Feb 2025 at 06:58, Keita Morisaki wrote: > > The trace event cpu_idle provides insufficient information for debugging > PSCI requests due to lacking access to determined PSCI domain idle > states. The cpu_idle usually only shows -1, 0, or 1 regardless how many > idle states the power do

Re: [PATCH 2/2] selftests/ftrace: Make uprobe test more robust against binary name

2025-02-17 Thread Heiko Carstens
On Tue, Jan 07, 2025 at 09:11:16PM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Make add_remove_uprobe test case more robust against various real > binary name. > Current add_remove_uprobe.tc test expects the real binary of /bin/sh > is '*/bin/*sh', but it does no

[PATCH v2 03/11] sched: Add sched tracepoints for RV task model

2025-02-17 Thread Gabriele Monaco
Add the following tracepoints: * sched_entry(bool preempt, ip) Called while entering __schedule * sched_exit(bool is_switch, ip) Called while exiting __schedule * sched_set_state(task, curr_state, state) Called when a task changes its state (to and from running) These tracepoints are u

[PATCH v2 11/11] tools/rv: Allow rv list to filter for container

2025-02-17 Thread Gabriele Monaco
Add possibility to supply the container name to rv list: # rv list sched mon1 mon2 mon3 This lists only monitors in sched, without indentation. Supplying -h, any option (string starting with -) or more than 1 argument will still print the usage. Passing a non-existent container prints not

[PATCH] tracing/user_events: Don't use %pK through printk

2025-02-17 Thread Thomas Weißschuh
pr_warn("user_events: Fault for mm: 0x%pK @ 0x%llx event: %s\n", + pr_warn("user_events: Fault for mm: 0x%p @ 0x%llx event: %s\n", mm->mm, (unsigned long long)uaddr, EVENT_NAME(user)); } --- base-commit: 0ad2507d5d93f39619fc42372c3

[PATCH v2 10/11] Documentation/rv: Add docs for the sched monitors

2025-02-17 Thread Gabriele Monaco
Add man page and kernel documentation for the sched monitors, as sched is a container of other monitors, document all in the same page. sched is the first nested monitor, also explain what is a nested monitor and how enabling containers or children monitors work. To: Ingo Molnar To: Peter Zijlstr

[PATCH v2 09/11] verification/dot2k: Add support for nested monitors

2025-02-17 Thread Gabriele Monaco
RV now supports nested monitors, this functionality requires a container monitor, which has virtually no functionality besides holding other monitors, and nested monitors, that have a container as parent. Add the -p flag to pass a parent to a monitor, this sets it up while registering the monitor

[PATCH v2 06/11] rv: Add snroc per-task monitor

2025-02-17 Thread Gabriele Monaco
Add a per-task monitor as part of the sched model: * snroc: set non runnable on its own context Monitor to ensure set_state happens only in the respective task's context To: Ingo Molnar To: Peter Zijlstra Cc: Juri Lelli Cc: John Kacur Cc: Clark Williams Signed-off-by: Gabriele Monaco --

[PATCH v2 07/11] rv: Add scpd, snep and sncid per-cpu monitors

2025-02-17 Thread Gabriele Monaco
Add 3 per-cpu monitors as part of the sched model: * scpd: schedule called with preemption disabled Monitor to ensure schedule is called with preemption disabled * snep: schedule does not enable preempt Monitor to ensure schedule does not enable preempt * sncid: schedule not called with in

[PATCH v2 05/11] rv: Add sco and tss per-cpu monitors

2025-02-17 Thread Gabriele Monaco
Add 2 per-cpu monitors as part of the sched model: * sco: scheduling context operations Monitor to ensure sched_set_state happens only in thread context * tss: task switch while scheduling Monitor to ensure sched_switch happens only in scheduling context To: Ingo Molnar To: Peter Zijlstr

[PATCH v2 04/11] rv: Add option for nested monitors and include sched

2025-02-17 Thread Gabriele Monaco
Monitors describing complex systems, such as the scheduler, can easily grow to the point where they are just hard to understand because of the many possible state transitions. Often it is possible to break such descriptions into smaller monitors, sharing some or all events. Enabling those smaller m

[PATCH v2 00/11] rv: Add scheduler specification monitors

2025-02-17 Thread Gabriele Monaco
This patchset starts including adapted scheduler specifications from Daniel's task model [1]. As the model is fairly complicated, it is split in several generators and specifications. The tool used to create the model can output a unified model, but that would be hardly readable (9k states). RV al

[PATCH v2 08/11] tools/rv: Add support for nested monitors

2025-02-17 Thread Gabriele Monaco
RV now supports nested monitors, this functionality requires a container monitor, which has virtually no functionality besides holding other monitors, and nested monitors, that have a container as parent. Nested monitors' sysfs folders are physically nested in the container's folder, and they are

[PATCH v2 01/11] tracing: Fix DECLARE_TRACE_CONDITION

2025-02-17 Thread Gabriele Monaco
Commit 287050d39026 ("tracing: Add TRACE_EVENT_CONDITIONAL()") adds macros to define conditional trace events (TRACE_EVENT_CONDITIONAL) and tracepoints (DECLARE_TRACE_CONDITION), but sets up functionality for direct use only for the former. Add preprocessor bits in define_trace.h to allow usage of

[PATCH v2 02/11] rv: Add license identifiers to monitor files

2025-02-17 Thread Gabriele Monaco
Some monitor files like the main header and the Kconfig are missing the license identifier. Add it to those and make sure the automatic generation script includes the line in newly created monitors. Signed-off-by: Gabriele Monaco --- kernel/trace/rv/monitors/wip/Kconfig| 2 ++ kerne

[PATCH -next] uprobes: fix two zero old_folio bugs in __replace_page()

2025-02-17 Thread Tong Tiangen
We triggered the following error logs in syzkaller test: BUG: Bad page state in process syz.7.38 pfn:1eff3 page: refcount:0 mapcount:0 mapping: index:0x0 pfn:0x1eff3 flags: 0x3f4004(referenced|reserved|node=0|zone=1|lastcpupid=0x1f) raw: 003f4004 e6

Re: [PATCH v5 RESEND] cpuidle: psci: Add trace for PSCI domain idle

2025-02-17 Thread Sudeep Holla
On Mon, Feb 17, 2025 at 12:57:07PM +0100, Rafael J. Wysocki wrote: > +Ulf > > On Mon, Feb 10, 2025 at 6:58 AM Keita Morisaki wrote: > > > > The trace event cpu_idle provides insufficient information for debugging > > PSCI requests due to lacking access to determined PSCI domain idle > > states. T

Re: [PATCHv3 perf/core] uprobes: Harden uretprobe syscall trampoline check

2025-02-17 Thread Jiri Olsa
On Thu, Feb 13, 2025 at 09:58:29AM -0800, Andy Lutomirski wrote: > On Thu, Feb 13, 2025 at 1:16 AM Jiri Olsa wrote: > > > > On Wed, Feb 12, 2025 at 05:37:11PM -0800, Andy Lutomirski wrote: > > > On Wed, Feb 12, 2025 at 2:04 PM Jiri Olsa wrote: > > > > > > > > Jann reported [1] possible issue when

Re: [PATCH v5 RESEND] cpuidle: psci: Add trace for PSCI domain idle

2025-02-17 Thread Rafael J. Wysocki
+Ulf On Mon, Feb 10, 2025 at 6:58 AM Keita Morisaki wrote: > > The trace event cpu_idle provides insufficient information for debugging > PSCI requests due to lacking access to determined PSCI domain idle > states. The cpu_idle usually only shows -1, 0, or 1 regardless how many > idle states the

[PATCH] docs: tracing: Reduce maxdepth in index documentation

2025-02-17 Thread Purva Yeshi
Reduce :maxdepth: from 2 to 1 in index.rst to simplify the table of contents, showing only top-level document titles for better readability. Signed-off-by: Purva Yeshi --- Documentation/trace/index.rst | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/t

[PATCH v3] docs: tracing: Refactor index.rst documentation

2025-02-17 Thread Purva Yeshi
Refactor Documentation/trace/index.rst to improve clarity, structure, and organization. Reformat sections and add appropriate headings for better readability. Improve section grouping and refine descriptions for better usability. Signed-off-by: Purva Yeshi --- V1 - https://lore.kernel.org/all/20

Re: [PATCH v2 03/17] mm/rmap: convert make_device_exclusive_range() to make_device_exclusive()

2025-02-17 Thread David Hildenbrand
On 17.02.25 01:01, Alistair Popple wrote: On Tue, Feb 11, 2025 at 09:33:54AM +0100, David Hildenbrand wrote: On 11.02.25 06:00, Andrew Morton wrote: On Mon, 10 Feb 2025 20:37:45 +0100 David Hildenbrand wrote: The single "real" user in the tree of make_device_exclusive_range() always requests

Re: [RFC v2 0/9] khugepaged: mTHP support

2025-02-17 Thread Dev Jain
On 15/02/25 12:08 pm, Dev Jain wrote: On 15/02/25 6:22 am, Nico Pache wrote: On Thu, Feb 13, 2025 at 7:02 PM Dev Jain wrote: On 14/02/25 1:09 am, Nico Pache wrote: On Thu, Feb 13, 2025 at 1:26 AM Dev Jain wrote: On 12/02/25 10:19 pm, Nico Pache wrote: On Tue, Feb 11, 2025 at 5:5