mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: vatsa@in.ibm.com, Andrew Morton <akpm@osdl.org>,
	Ingo Molnar <mingo@elte.hu>,
	suresh.b.siddha@intel.com, Dinakar Guniguntala <dino@in.ibm.com>,
	pj@sgi.com, hawkes@sgi.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.16-mm2 4/4] sched_domain: Allocate sched_group structures dynamically
Date: Sat, 1 Apr 2006 23:35:13 -0800	[thread overview]
Message-ID: <20060401233512.B8662@unix-os.sc.intel.com> (raw)
In-Reply-To: <442F2B52.6000205@yahoo.com.au>; from nickpiggin@yahoo.com.au on Sun, Apr 02, 2006 at 11:39:30AM +1000

On Sun, Apr 02, 2006 at 11:39:30AM +1000, Nick Piggin wrote:
> 
> Srivatsa Vaddagiri wrote:
> >  /*
> > @@ -6113,6 +6125,10 @@ next_sg:
> >  static int build_sched_domains(const cpumask_t *cpu_map)
> >  {
> >  	int i;
> > +	struct sched_group *sched_group_phys = NULL;
> > +#ifdef CONFIG_SCHED_MC
> > +	struct sched_group *sched_group_core = NULL;
> > +#endif
> >  #ifdef CONFIG_NUMA
> >  	struct sched_group **sched_group_nodes = NULL;
> >  	struct sched_group *sched_group_allnodes = NULL;
> > @@ -6171,6 +6187,18 @@ static int build_sched_domains(const cpu
> >  		cpus_and(sd->span, sd->span, *cpu_map);
> >  #endif
> >  
> > +		if (!sched_group_phys) {
> > +			sched_group_phys
> > +				= kmalloc(sizeof(struct sched_group) * NR_CPUS,
> > +					  GFP_KERNEL);
> > +			if (!sched_group_phys) {
> > +				printk (KERN_WARNING "Can not alloc phys sched"
> > +						     "group\n");
> > +				goto error;
> > +			}
> > +			sched_group_phys_bycpu[i] = sched_group_phys;
> > +		}
> 
> Doesn't the last assignment have to be outside the if statement?
> 
> Hmm.. this design seems like the best way to go for now. Suresh?

Only thing I see in this is, even if there are very few cpus in the
exclusive cpuset, we end up allocating NR_CPUS groups and waste memory.

thanks,
suresh

  parent reply	other threads:[~2006-04-02  7:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-01 18:56 Srivatsa Vaddagiri
2006-04-02  1:39 ` Nick Piggin
2006-04-02  5:04   ` Srivatsa Vaddagiri
2006-04-02  5:21     ` Nick Piggin
2006-04-02  9:14       ` Srivatsa Vaddagiri
2006-04-02  7:35   ` Siddha, Suresh B [this message]
2006-04-02  9:17     ` Srivatsa Vaddagiri

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=20060401233512.B8662@unix-os.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=akpm@osdl.org \
    --cc=dino@in.ibm.com \
    --cc=hawkes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=pj@sgi.com \
    --cc=vatsa@in.ibm.com \
    /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

Powered by JetHome