lkml.org 
[lkml]   [2006]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch -mm4] i386: __init should be __cpuinit
On Tue, Jan 31, 2006 at 11:49:43PM -0500, Chuck Ebbert wrote:
> When CONFIG_HOTPLUG_CPU on i386 there are places where __init[data] is
> referenced from normal code.
>
> On startup:
> arch/i386/kernel/cpu/amd.c::amd_init_cpu():
> cpu_devs[X86_VENDOR_AMD] = &amd_cpu_dev;
> amd_cpu_dev is declared __initdata and is freed
>
> On CPU hotplug:
> arch/i386/kernel/cpu/common.c::get_cpu_vendor():
> for (i = 0; i < X86_VENDOR_NUM; i++) {
> if (cpu_devs[i]) {
> if (!strcmp(v,cpu_devs[i]->c_ident[0]) ||
>
> To fix this, change every instance of __init that seems suspicious
> into __cpuinit. When !CONFIG_HOTPLUG_CPU there is no change in .text
> or .data size. When enabled, .text += 3248 bytes; .data += 2148 bytes.
>
> This should be safe in every case; the only drawback is the extra code and
> data when CPU hotplug is enabled.

Especially as for the bulk of them, those CPUs aren't hotplug capable.
(I seriously doubt we'll ever see a hotplugable cyrix for eg, which
takes up the bulk of your diff).

How about leaving it __init on non-hotplug systems, and somehow removing
those from cpu_devs, so get_cpu_vendor() just skips them ?
NULL'ing those entries should be just a few bytes, instead of adding 5KB.

Dave

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

\
 
 \ /
  Last update: 2006-02-01 06:36    [W:0.060 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site