public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Vincent Guittot 
	<public-vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@plane.gmane.org>
Cc: public-linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@plane.gmane.org,
	public-linux-kernel-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org,
	public-linaro-dev-cunTk1MwBs8s++Sfvej+rw@plane.gmane.org,
	public-devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@plane.gmane.org,
	public-a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@plane.gmane.org,
	public-rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@plane.gmane.org,
	public-linux-lFZ/pmaqli7XmaaqVzeoHQ@plane.gmane.org
Subject: Re: [PATCH v2 2/5] ARM: topology: factorize the update of sibling masks
Date: Wed, 20 Jun 2012 09:54:31 +0900	[thread overview]
Message-ID: <87bokehkfs.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1340094536-20873-3-git-send-email-vincent.guittot@linaro.org> (Vincent Guittot's message of "Tue, 19 Jun 2012 10:28:53 +0200")




On Tue, 19 Jun 2012 10:28:53 +0200, Vincent Guittot wrote:
> This factorization has also been proposed in another patchset that has not been
> merged yet:
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-January/080873.html
> So, this patch could be dropped depending of the state of the other one.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>
> Signed-off-by: Vincent Guittot <vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  arch/arm/kernel/topology.c |   47 ++++++++++++++++++++++++--------------------
>  1 file changed, 26 insertions(+), 21 deletions(-)
>
> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> index 37e2e57..92c2fb3 100644
> --- a/arch/arm/kernel/topology.c
> +++ b/arch/arm/kernel/topology.c
> @@ -82,6 +82,31 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
>  	return &cpu_topology[cpu].core_sibling;
>  }
>  
> +void update_siblings_masks(unsigned int cpuid)
> +{
> +	struct cputopo_arm *cpu_topo, *cpuid_topo = &cpu_topology[cpuid];
> +	int cpu;
> +	/* update core and thread sibling masks */
> +	for_each_possible_cpu(cpu) {
> +		cpu_topo = &cpu_topology[cpu];
> +
> +		if (cpuid_topo->socket_id == cpu_topo->socket_id) {

I think this will make the code a little bit cleaner:

                if (cpuid_topo->socket_id != cpu_topo->socket_id)
                	continue;

Thanks,
Namhyung


> +			cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
> +			if (cpu != cpuid)
> +				cpumask_set_cpu(cpu, &cpuid_topo->core_sibling);
> +
> +			if (cpuid_topo->core_id == cpu_topo->core_id) {
> +				cpumask_set_cpu(cpuid,
> +					&cpu_topo->thread_sibling);
> +				if (cpu != cpuid)
> +					cpumask_set_cpu(cpu,
> +						&cpuid_topo->thread_sibling);
> +			}
> +		}
> +	}
> +	smp_wmb();
> +}
> +



  reply	other threads:[~2012-06-20  5:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19  8:28 [PATCH v2 0/5] ARM: topology: set the capacity of each cores for big.LITTLE Vincent Guittot
2012-06-19  8:28 ` [PATCH v2 1/5] ARM: topology: Add arch_scale_freq_power function Vincent Guittot
     [not found]   ` <87fw9qhkl9.fsf@sejong.aot.lge.com>
2012-06-20  9:04     ` Vincent Guittot
2012-06-19  8:28 ` [PATCH v2 2/5] ARM: topology: factorize the update of sibling masks Vincent Guittot
2012-06-20  0:54   ` Namhyung Kim [this message]
2012-06-19  8:28 ` [PATCH v2 3/5] ARM: topology: Update cpu_power according to DT information Vincent Guittot
     [not found]   ` <877gv2hjhb.fsf@sejong.aot.lge.com>
2012-06-20  8:43     ` Vincent Guittot
2012-06-19  8:28 ` [PATCH v2 4/5] sched, x86: Remove broken power estimation Vincent Guittot
2012-06-19  8:28 ` [PATCH v2 5/5] sched: cpu_power: enable ARCH_POWER Vincent Guittot
2012-06-19  9:01   ` Yong Zhang
2012-06-20  9:11     ` Vincent Guittot
2012-06-20  9:19       ` Peter Zijlstra

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=87bokehkfs.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=public-a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@plane.gmane.org \
    --cc=public-devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@plane.gmane.org \
    --cc=public-linaro-dev-cunTk1MwBs8s++Sfvej+rw@plane.gmane.org \
    --cc=public-linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@plane.gmane.org \
    --cc=public-linux-kernel-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org \
    --cc=public-linux-lFZ/pmaqli7XmaaqVzeoHQ@plane.gmane.org \
    --cc=public-rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@plane.gmane.org \
    --cc=public-vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@plane.gmane.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