Re: [RFC][PATCH] module: Optimize __module_address() using a latched RB-tree

From: Rusty Russell
Date: Fri Feb 27 2015 - 07:11:49 EST


Peter Zijlstra <peterz@xxxxxxxxxxxxx> writes:
> On Thu, Feb 26, 2015 at 12:43:09PM +0100, Peter Zijlstra wrote:
>
> Assuming struct module is cacheline aligned, Rusty? from what I can find
> its squirreled away in some data structure:
>
> mod = (void *)info->sechdrs[info->index.mod].sh_addr
>
> And I can't seem to quickly find its alignment. If its not cacheline
> aligned, can we make it so?

If the ELF says to align it, it will be aligned. Thus your patch
below should make it Just Work:

> @@ -278,7 +276,7 @@
> int (*init)(void);
>
> /* If this is non-NULL, vfree after init() returns */
> - void *module_init;
> + void *module_init ____cacheline_aligned;
>
> /* Here is the actual code + data, vfree'd on unload. */
> void *module_core;

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/