Re: [PATCH v7] module: replace module_layout with module_memory

From
Song Liu <hidden>
Date
2023-02-01 22:28:10
Also in
lkml
Reply to
Peter Zijlstra, 2023-02-01
On Feb 1, 2023, at 1:24 PM, Peter Zijlstra [off-list ref] wrote:

On Wed, Feb 01, 2023 at 10:44:22AM -0800, Song Liu wrote:
quoted
static ssize_t show_datasize(struct module_attribute *mattr,
    struct module_kobject *mk, char *buffer)
{
- return sprintf(buffer, "%u\n", mk->mod->data_layout.size);
+ unsigned int size = 0;
+
+ for_class_mod_mem_type(type, core) {
+ if (type == MOD_TEXT)
+ continue;
isn't this the same as:

for_class_mod_mem_type(type, core_data)

?
Great catch!
quoted
+ size += mk->mod->mem[type].size;
+ }
+ return sprintf(buffer, "%u\n", size);
}
quoted
- lockdep_free_key_range(mod->data_layout.base, mod->data_layout.size);
+ for_class_mod_mem_type(type, core) {
+ lockdep_free_key_range(mod->mem[type].base,
+       mod->mem[type].size);
+ }
Why the core_data to core change? Specifically the difference seems to
be you now include text. Now, we shouldn't be having lockdep keys in
text, so it's harmless, still a bit weird.
Will fix!

Thanks,
Song
Thread (3 messages) 3 messages, 3 authors, last reply 2023-02-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help