lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 13 Apr 2015 18:53:13 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	rusty@...tcorp.com.au, mathieu.desnoyers@...icios.com,
	oleg@...hat.com, paulmck@...ux.vnet.ibm.com,
	torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
	andi@...stfloor.org, rostedt@...dmis.org, tglx@...utronix.de,
	laijs@...fujitsu.com, linux@...izon.com,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v5 08/10] module: Make the mod_tree stuff conditional on
 PERF_EVENTS || TRACING


* Peter Zijlstra <peterz@...radead.org> wrote:

> Andrew worried about the overhead on small systems; only use the fancy
> code when either perf or tracing is enabled.
> 
> Cc: Rusty Russell <rusty@...tcorp.com.au>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Requested-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
>  kernel/module.c |   30 ++++++++++++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -102,6 +102,8 @@ DEFINE_MUTEX(module_mutex);
>  EXPORT_SYMBOL_GPL(module_mutex);
>  static LIST_HEAD(modules);
>  
> +#if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_TRACING)
> +
>  /*
>   * Use a latched RB-tree for __module_address(); this allows us to use
>   * RCU-sched lookups of the address from any context.
> @@ -112,6 +114,10 @@ static LIST_HEAD(modules);
>   *
>   * Because init ranges are short lived we mark them unlikely and have placed
>   * them outside the critical cacheline in struct module.
> + *
> + * This is conditional on PERF_EVENTS || TRACING because those can really hit
> + * __module_address() hard by doing a lot of stack unwinding; potentially from
> + * NMI context.

So I think we'd be better off introducing a helper Kconfig bool for 
that, CONFIG_MODULE_LATCHED_LOOKUPS or so, and select that symbol from 
the perf and tracing Kconfig code directly?

Beyond it being a cleaner, self-maintaining construct, that would also 
allow other subsystems to set it as well, without having to modify 
kernel/module.c.

Thanks,

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ