Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1743249

Re: [PATCH/RFC] cpuhp code and data usage on UP systems

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH/RFC] cpuhp code and data usage on UP systems
Date Mon, 02 Oct 2017 22:50:05 +0200
Message-ID <uwfP7-ur-89@gated-at.bofh.it> (permalink)
References <uwfP7-ur-91@gated-at.bofh.it>
User-Agent Alpine 2.20 (DEB 67 2015-01-07)
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII
X-Linutronix-Spam-Score -1.0
X-Linutronix-Spam-Level -
X-Linutronix-Spam-Status No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 47
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org
X-Original-Date Mon, 2 Oct 2017 20:52:23 +0200 (CEST)
X-Original-Message-ID <alpine.DEB.2.20.1710022047200.2114@nanos>
X-Original-References <nycvar.YSQ.7.76.1710021347550.5407@knanqh.ubzr>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1743249

Show key headers only | View raw


On Mon, 2 Oct 2017, Nicolas Pitre wrote:
> 
> On !SMP systems, we end up with the following array definition:
> 
> static struct cpuhp_step cpuhp_ap_states[] = {
>         [CPUHP_ONLINE] = {
>                 .name                   = "online",
>                 .startup.single         = NULL,
>                 .teardown.single        = NULL,
>         },
> };
> 
> where CPUHP_ONLINE = 187. That means up to 99.5% of this array is unused 
> but still allocated in the kernel's .data section i.e. 3760 bytes.
> 
> The same issue exists with cpuhp_bp_states being 1720 bytes.
> 
> The goal of this patch is mainly about illustrating the issue and 
> reducing .data usage. I have no clear idea when this stuff is really 
> needed besides standard CPU hotplug. Not knowing exactly what I'm doing 
> here, I made it conditional on CONFIG_SMP for now. There might be a case 
> for moving that code to a separate file (cpuhp.c maybe?) and omitting it 
> from the kernel when unneeded.
> 
> Comments?

Sure.

> +#ifdef CONFIG_CPUHP
> +#define ___P(proto, def_retcode) extern proto;
> +#else
> +#define ___P(proto, def_retcode) static inline proto { return def_retcode }
> +#endif
> +
> +___P(
>  int __cpuhp_setup_state(enum cpuhp_state state,	const char *name, bool invoke,
>  			int (*startup)(unsigned int cpu),
> -			int (*teardown)(unsigned int cpu), bool multi_instance);
> -
> +			int (*teardown)(unsigned int cpu), bool multi_instance), 0; )

What exactly is invoking the callbacks of states in the proper context and
manages instances on registration? Ditto for teardwon in case of modules.

Thanks,

	tglx

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH/RFC] cpuhp code and data usage on UP systems Thomas Gleixner <tglx@linutronix.de> - 2017-10-02 22:50 +0200

csiph-web