lkml.org 
[lkml]   [2015]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2015-02-26 13:41    [W:0.172 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site