From: Morten Rasmussen <Morten.Rasmussen@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "paulmck@linux.vnet.ibm.com" <paulmck@linux.vnet.ibm.com>,
"pjt@google.com" <pjt@google.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"suresh.b.siddha@intel.com" <suresh.b.siddha@intel.com>,
"linaro-sched-sig@lists.linaro.org"
<linaro-sched-sig@lists.linaro.org>,
"linaro-dev@lists.linaro.org" <linaro-dev@lists.linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Arvind Chauhan <Arvind.Chauhan@arm.com>,
Robin Randhawa <Robin.Randhawa@arm.com>,
Amit Kucheria <amit.kucheria@linaro.org>
Subject: Re: [RFC PATCH 07/10] ARM: sched: Setup SCHED_HMP domains
Date: Wed, 10 Oct 2012 14:29:02 +0100 [thread overview]
Message-ID: <20121010132902.GF3729@e103034-lin> (raw)
In-Reply-To: <CAKohpokqC9Okav5HfNuN-Jd=58qoMvNO9SxVxDJWA7rqmsrkWA@mail.gmail.com>
On Thu, Oct 04, 2012 at 07:58:45AM +0100, Viresh Kumar wrote:
> On 22 September 2012 00:02, <morten.rasmussen@arm.com> wrote:
> > diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
>
> > +void __init arch_get_hmp_domains(struct list_head *hmp_domains_list)
> > +{
> > + struct cpumask hmp_fast_cpu_mask;
> > + struct cpumask hmp_slow_cpu_mask;
>
> can be merged to single line.
>
> > + struct hmp_domain *domain;
> > +
> > + arch_get_fast_and_slow_cpus(&hmp_fast_cpu_mask, &hmp_slow_cpu_mask);
> > +
> > + /*
> > + * Initialize hmp_domains
> > + * Must be ordered with respect to compute capacity.
> > + * Fastest domain at head of list.
> > + */
> > + domain = (struct hmp_domain *)
> > + kmalloc(sizeof(struct hmp_domain), GFP_KERNEL);
>
> should be:
>
> domain = kmalloc(sizeof(*domain), GFP_KERNEL);
>
> > + cpumask_copy(&domain->cpus, &hmp_slow_cpu_mask);
>
> what if kmalloc failed?
>
> > + list_add(&domain->hmp_domains, hmp_domains_list);
> > + domain = (struct hmp_domain *)
> > + kmalloc(sizeof(struct hmp_domain), GFP_KERNEL);
>
> would be better to kmalloc only once with size 2* sizeof(*domain)
>
> > + cpumask_copy(&domain->cpus, &hmp_fast_cpu_mask);
> > + list_add(&domain->hmp_domains, hmp_domains_list);
>
> Also would be better to create a macro for above two lines to remove
> code redundancy.
>
Agree on all of the above.
Thanks,
Morten
next prev parent reply other threads:[~2012-10-10 13:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-21 18:32 [RFC PATCH 00/10] sched: Task placement for heterogeneous MP systems morten.rasmussen
2012-09-21 18:32 ` [RFC PATCH 01/10] sched: entity load-tracking load_avg_ratio morten.rasmussen
2012-09-21 18:32 ` [RFC PATCH 02/10] sched: Task placement for heterogeneous systems based on task load-tracking morten.rasmussen
2012-10-04 6:02 ` Viresh Kumar
2012-10-04 6:54 ` Amit Kucheria
2012-10-09 15:56 ` Morten Rasmussen
2012-10-09 16:58 ` Viresh Kumar
2012-09-21 18:32 ` [RFC PATCH 03/10] sched: Forced task migration on heterogeneous systems morten.rasmussen
2012-10-04 6:18 ` Viresh Kumar
2012-09-21 18:32 ` [RFC PATCH 04/10] sched: Introduce priority-based task migration filter morten.rasmussen
2012-10-04 4:37 ` Viresh Kumar
2012-10-04 6:27 ` Viresh Kumar
2012-10-09 16:40 ` Morten Rasmussen
2012-10-24 2:32 ` li guang
2012-09-21 18:32 ` [RFC PATCH 05/10] ARM: Add HMP scheduling support for ARM architecture morten.rasmussen
2012-09-21 18:32 ` [RFC PATCH 06/10] ARM: sched: Use device-tree to provide fast/slow CPU list for HMP morten.rasmussen
2012-10-04 6:49 ` Viresh Kumar
2012-10-10 10:17 ` Morten Rasmussen
2012-10-10 10:33 ` Viresh Kumar
2012-10-10 11:04 ` Morten Rasmussen
2012-10-10 11:29 ` Jon Medhurst (Tixy)
2012-09-21 18:32 ` [RFC PATCH 07/10] ARM: sched: Setup SCHED_HMP domains morten.rasmussen
2012-10-04 6:58 ` Viresh Kumar
2012-10-10 13:29 ` Morten Rasmussen [this message]
2012-09-21 18:32 ` [RFC PATCH 08/10] sched: Add ftrace events for entity load-tracking morten.rasmussen
2012-09-21 18:32 ` [RFC PATCH 09/10] sched: Add HMP task migration ftrace event morten.rasmussen
2012-09-21 18:32 ` [RFC PATCH 10/10] sched: SCHED_HMP multi-domain task migration control morten.rasmussen
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=20121010132902.GF3729@e103034-lin \
--to=morten.rasmussen@arm.com \
--cc=Arvind.Chauhan@arm.com \
--cc=Robin.Randhawa@arm.com \
--cc=amit.kucheria@linaro.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linaro-sched-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=suresh.b.siddha@intel.com \
--cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).