[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y9rYcvPx4MhA+c+u@hirez.programming.kicks-ass.net>
Date: Wed, 1 Feb 2023 22:24:02 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Song Liu <song@...nel.org>
Cc: linux-modules@...r.kernel.org, linux-kernel@...r.kernel.org,
hch@....de, kernel-team@...a.com,
Luis Chamberlain <mcgrof@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Guenter Roeck <linux@...ck-us.net>,
Christophe Leroy <christophe.leroy@...roup.eu>
Subject: Re: [PATCH v7] module: replace module_layout with module_memory
On Wed, Feb 01, 2023 at 10:44:22AM -0800, Song Liu wrote:
> 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)
?
> + size += mk->mod->mem[type].size;
> + }
> + return sprintf(buffer, "%u\n", size);
> }
> - 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.
Anyway, looks real good to me otherwise. Thanks!
Powered by blists - more mailing lists