lkml.org 
[lkml]   [2008]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 1/1] sched: remove unnecessary kzalloc in sched_init_smp
    Tony Luck wrote:
    > On Fri, Apr 4, 2008 at 6:11 PM, Mike Travis <travis@sgi.com> wrote:
    >> @@ -7297,6 +7287,11 @@ void __init sched_init_smp(void)
    >> #else
    >> void __init sched_init_smp(void)
    >> {
    >> +#if defined(CONFIG_NUMA)
    >> + sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **),
    >> + GFP_KERNEL);
    >> + BUG_ON(sched_group_nodes_bycpu == NULL);
    >> +#endif
    >> sched_init_granularity();
    >> }
    >> #endif /* CONFIG_SMP */
    >
    > This hunk is causing problems with one of my builds (generic,
    > uniprocessor). Note
    > that the #else at the start of this hunk is from a #ifdef CONFIG_SMP ... so I'm
    > wondering why we need #if defined(CONFIG_NUMA) inside uniprocessor code :-)
    > How can you have NUMA issues with only one cpu!!!

    >>> CONFIG_NUMA is dependent on CONFIG_SMP for x86 so that caused me to miss
    >>> the error. But here's the fix:

    * sched_group_nodes_bycpu is defined only for the SMP + NUMA case,
    it should not be referenced in the !SMP + NUMA case.

    For inclusion into sched-devel/latest tree.

    Based on:
    git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
    + sched-devel/latest .../mingo/linux-2.6-sched-devel.git

    Signed-off-by: Mike Travis <travis@sgi.com>
    ---
    kernel/sched.c | 5 -----
    1 file changed, 5 deletions(-)

    --- linux-2.6.sched.orig/kernel/sched.c
    +++ linux-2.6.sched/kernel/sched.c
    @@ -8028,11 +8028,6 @@ void __init sched_init_smp(void)
    #else
    void __init sched_init_smp(void)
    {
    -#if defined(CONFIG_NUMA)
    - sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **),
    - GFP_KERNEL);
    - BUG_ON(sched_group_nodes_bycpu == NULL);
    -#endif
    sched_init_granularity();
    }
    #endif /* CONFIG_SMP */

    \
     
     \ /
      Last update: 2008-04-22 19:07    [W:0.027 / U:60.916 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site