public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>, Mike Travis <travis@sgi.com>
Cc: Mike Travis <travis@sgi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Subject: [PATCH 1/4] cpumask: cpu_coregroup_mask(): x86
Date: Mon, 1 Dec 2008 16:46:34 +1030	[thread overview]
Message-ID: <200812011646.35018.rusty@rustcorp.com.au> (raw)

Like cpu_coregroup_map, but returns a (const) pointer.

(This will go to Ingo separately as part of the x86 series, just
airing it here for thoroughness).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Ingo Molnar <mingo@redhat.com>
---
 arch/x86/include/asm/topology.h |    1 +
 arch/x86/kernel/smpboot.c       |   11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff -r 11a884ebd99b arch/x86/include/asm/topology.h
--- a/arch/x86/include/asm/topology.h	Thu Nov 20 13:54:24 2008 +1030
+++ b/arch/x86/include/asm/topology.h	Thu Nov 20 13:55:44 2008 +1030
@@ -231,6 +231,7 @@
 #endif
 
 extern cpumask_t cpu_coregroup_map(int cpu);
+extern const struct cpumask *cpu_coregroup_mask(int cpu);
 
 #ifdef ENABLE_TOPO_DEFINES
 #define topology_physical_package_id(cpu)	(cpu_data(cpu).phys_proc_id)
diff -r 11a884ebd99b arch/x86/kernel/smpboot.c
--- a/arch/x86/kernel/smpboot.c	Thu Nov 20 13:54:24 2008 +1030
+++ b/arch/x86/kernel/smpboot.c	Thu Nov 20 13:55:44 2008 +1030
@@ -497,7 +497,7 @@
 }
 
 /* maps the cpu to the sched domain representing multi-core */
-cpumask_t cpu_coregroup_map(int cpu)
+const struct cpumask *cpu_coregroup_mask(int cpu)
 {
 	struct cpuinfo_x86 *c = &cpu_data(cpu);
 	/*
@@ -505,9 +505,14 @@
 	 * And for power savings, we return cpu_core_map
 	 */
 	if (sched_mc_power_savings || sched_smt_power_savings)
-		return per_cpu(cpu_core_map, cpu);
+		return &per_cpu(cpu_core_map, cpu);
 	else
-		return c->llc_shared_map;
+		return &c->llc_shared_map;
+}
+
+cpumask_t cpu_coregroup_map(int cpu)
+{
+	return *cpu_coregroup_mask(cpu);
 }
 
 static void impress_friends(void)



             reply	other threads:[~2008-12-01  6:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-01  6:16 Rusty Russell [this message]
2008-12-17 22:54 ` [PATCH 1/4] cpumask: cpu_coregroup_mask(): x86 Mike Travis
2008-12-17 23:02   ` Mike Travis
2008-12-18  6:14   ` Rusty Russell

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=200812011646.35018.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=travis@sgi.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