mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Pavlu <petr.pavlu@suse.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Luis Chamberlain <mcgrof@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	Daniel Gomez <da.gomez@samsung.com>,
	linux-modules@vger.kernel.org
Subject: Re: [PATCH v3 5/8] module: Add module_for_each_mod() function
Date: Wed, 5 Mar 2025 09:47:49 +0100	[thread overview]
Message-ID: <17c0cce7-03c7-488a-b61a-6c41d5bacfa1@suse.com> (raw)
In-Reply-To: <20250304095714.47a171fa@gandalf.local.home>

On 3/4/25 15:57, Steven Rostedt wrote:
> 
> Luis,
> 
> Can I get an Acked-by from you?
> 
> This follows the changes you have in linux-next.

Hi Steven,

I'm not Luis, but we started rotating the modules maintenance every six
months and I'm currently looking after the modules tree. I see Luis
seemed ok with the change in the previous discussion and the patch looks
reasonable to me.

Acked-by: Petr Pavlu <petr.pavlu@suse.com>

-- 
Thanks,
Petr

> 
> 
> 
> 
> On Mon, 03 Mar 2025 20:25:21 -0500
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
>> From: Steven Rostedt <rostedt@goodmis.org>
>>
>> The tracing system needs a way to save all the currently loaded modules
>> and their addresses into persistent memory so that it can evaluate the
>> addresses on a reboot from a crash. When the persistent memory trace
>> starts, it will load the module addresses and names into the persistent
>> memory. To do so, it will call the module_for_each_mod() function and pass
>> it a function and data structure to get called on each loaded module. Then
>> it can record the memory.
>>
>> This only implements that function.
>>
>> Cc: Luis Chamberlain <mcgrof@kernel.org>
>> Cc: Petr Pavlu <petr.pavlu@suse.com>
>> Cc: Sami Tolvanen <samitolvanen@google.com>
>> Cc: Daniel Gomez <da.gomez@samsung.com>
>> Cc: linux-modules@vger.kernel.org
>> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
>> ---
>> Changes since v2: https://lore.kernel.org/20250215034404.902259250@goodmis.org
>>
>> - Use RCU guard instead of disabling preemption
>>
>>  include/linux/module.h |  6 ++++++
>>  kernel/module/main.c   | 13 +++++++++++++
>>  2 files changed, 19 insertions(+)
>>
>> diff --git a/include/linux/module.h b/include/linux/module.h
>> index 30e5b19bafa9..9a71dd2cb11f 100644
>> --- a/include/linux/module.h
>> +++ b/include/linux/module.h
>> @@ -782,6 +782,8 @@ static inline void *module_writable_address(struct module *mod, void *loc)
>>  	return __module_writable_address(mod, loc);
>>  }
>>  
>> +void module_for_each_mod(int(*func)(struct module *mod, void *data), void *data);
>> +
>>  #else /* !CONFIG_MODULES... */
>>  
>>  static inline struct module *__module_address(unsigned long addr)
>> @@ -894,6 +896,10 @@ static inline void *module_writable_address(struct module *mod, void *loc)
>>  {
>>  	return loc;
>>  }
>> +
>> +static inline void module_for_each_mod(int(*func)(struct module *mod, void *data), void *data)
>> +{
>> +}
>>  #endif /* CONFIG_MODULES */
>>  
>>  #ifdef CONFIG_SYSFS
>> diff --git a/kernel/module/main.c b/kernel/module/main.c
>> index 1fb9ad289a6f..927a2e0ffd5f 100644
>> --- a/kernel/module/main.c
>> +++ b/kernel/module/main.c
>> @@ -3809,6 +3809,19 @@ bool is_module_text_address(unsigned long addr)
>>  	return ret;
>>  }
>>  
>> +void module_for_each_mod(int(*func)(struct module *mod, void *data), void *data)
>> +{
>> +	struct module *mod;
>> +
>> +	guard(rcu)();
>> +	list_for_each_entry_rcu(mod, &modules, list) {
>> +		if (mod->state == MODULE_STATE_UNFORMED)
>> +			continue;
>> +		if (func(mod, data))
>> +			break;
>> +	}
>> +}
>> +
>>  /**
>>   * __module_text_address() - get the module whose code contains an address.
>>   * @addr: the address.
> 


  reply	other threads:[~2025-03-05  8:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04  1:25 [PATCH v3 0/8] ring-buffer/tracing: Save module information in persistent memory Steven Rostedt
2025-03-04  1:25 ` [PATCH v3 1/8] ring-buffer: Use kaslr address instead of text delta Steven Rostedt
2025-03-04  1:25 ` [PATCH v3 2/8] ring-buffer: Add buffer meta data for persistent ring buffer Steven Rostedt
2025-03-04  1:25 ` [PATCH v3 3/8] ring-buffer: Add ring_buffer_meta_scratch() Steven Rostedt
2025-03-04  1:25 ` [PATCH v3 4/8] tracing: Have persistent trace instances save KASLR offset Steven Rostedt
2025-03-04  1:25 ` [PATCH v3 5/8] module: Add module_for_each_mod() function Steven Rostedt
2025-03-04 14:57   ` Steven Rostedt
2025-03-05  8:47     ` Petr Pavlu [this message]
2025-03-05 15:21       ` Steven Rostedt
2025-03-04  1:25 ` [PATCH v3 6/8] tracing: Have persistent trace instances save module addresses Steven Rostedt
2025-03-04  1:25 ` [PATCH v3 7/8] tracing: Show module names and addresses of last boot Steven Rostedt
2025-03-04  1:25 ` [PATCH v3 8/8] tracing: Update modules to persistent instances when loaded Steven Rostedt

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=17c0cce7-03c7-488a-b61a-6c41d5bacfa1@suse.com \
    --to=petr.pavlu@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=da.gomez@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.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

all inboxes | Powered by JetHome®