mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH/RFC] cpuhp code and data usage on UP systems
Date: Mon, 2 Oct 2017 20:52:23 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1710022047200.2114@nanos> (raw)
In-Reply-To: <nycvar.YSQ.7.76.1710021347550.5407@knanqh.ubzr>

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

      reply	other threads:[~2017-10-02 18:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 17:59 Nicolas Pitre
2017-10-02 18:52 ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1710022047200.2114@nanos \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.pitre@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®