Messages in this thread | | | Date | Thu, 26 Feb 2015 13:00:38 +0100 | From | Ingo Molnar <> | Subject | Re: [RFC][PATCH] module: Optimize __module_address() using a latched RB-tree |
| |
* Peter Zijlstra <peterz@infradead.org> wrote:
> +static struct module *mod_tree_find(unsigned long addr) > +{ > + struct module *m; > + unsigned int seq; > + > + do { > + seq = raw_read_seqcount(&mod_tree.seq); > + m = __tree_find(&mod_tree.tree[seq & 1], addr); > + } while (read_seqcount_retry(&mod_tree.seq, seq)); > + > + return m; > +}
Btw., if your approach works out fine I bet we could add one more optimization as well: a PER_CPU(last_module_found) front cache would help as well, as usually there's quite a bit of repetition between addresses being looked up and the resulting modules.
Thanks,
Ingo
| |