public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] remove (more or less) unnecessary cacheline_aligned from module_ref
@ 2009-01-12  3:18 Kyle McMartin
  2009-01-12 11:08 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Kyle McMartin @ 2009-01-12  3:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: rusty

On x86_64 systems with CONFIG_MAXSMP set, NR_CPUS is exploded to 4096
cpus. This cacheline_aligned attribute on the local_t in module_ref
results in struct module bloating to over 512KB in size on x86_64, which
tends to, er, add up. This results in insane disk usage on distro
kernel configs (1GB+ on Fedora.)

Killing cacheline_aligned reduces the size of struct module to somewhat
more sane levels.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
---
I'll followup with a patch to make mod->ref dynamically allocated, but
that needs a bit more thinking because module_unload_init currently
doesn't have a failure path.

Of course, reducing NR_CPUS to something sane was an easy way to patch
over the problem.

diff --git a/include/linux/module.h b/include/linux/module.h
index 4f7ea12..32b0bda 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -222,7 +222,7 @@ void *__symbol_get_gpl(const char *symbol);
 struct module_ref
 {
 	local_t count;
-} ____cacheline_aligned;
+};
 
 enum module_state
 {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [RFC] remove (more or less) unnecessary cacheline_aligned from module_ref
  2009-01-12  3:18 [PATCH] [RFC] remove (more or less) unnecessary cacheline_aligned from module_ref Kyle McMartin
@ 2009-01-12 11:08 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2009-01-12 11:08 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: linux-kernel

On Monday 12 January 2009 13:48:41 Kyle McMartin wrote:
> On x86_64 systems with CONFIG_MAXSMP set, NR_CPUS is exploded to 4096
> cpus. This cacheline_aligned attribute on the local_t in module_ref
> results in struct module bloating to over 512KB in size on x86_64, which
> tends to, er, add up. This results in insane disk usage on distro
> kernel configs (1GB+ on Fedora.)
> 
> Killing cacheline_aligned reduces the size of struct module to somewhat
> more sane levels.
> 
> Signed-off-by: Kyle McMartin <kyle@redhat.com>

Yep, I've applied this.

> I'll followup with a patch to make mod->ref dynamically allocated, but
> that needs a bit more thinking because module_unload_init currently
> doesn't have a failure path.

Thanks, that'd be good.  And it'll be even nicer when the new per-cpu
allocator goes in.

Thanks,
Rusty.


It really needs the per-cpu alloc patches which are pending to make it

> 
> Of course, reducing NR_CPUS to something sane was an easy way to patch
> over the problem.
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> index 4f7ea12..32b0bda 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -222,7 +222,7 @@ void *__symbol_get_gpl(const char *symbol);
>  struct module_ref
>  {
>  	local_t count;
> -} ____cacheline_aligned;
> +};
>  
>  enum module_state
>  {
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-12 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12  3:18 [PATCH] [RFC] remove (more or less) unnecessary cacheline_aligned from module_ref Kyle McMartin
2009-01-12 11:08 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox