linux-mips
[Top] [All Lists]

[RFC] mark Netlogic XLR chip as SMT capable

To: linux-mips@linux-mips.org
Subject: [RFC] mark Netlogic XLR chip as SMT capable
From: Hillf Danton <dhillf@gmail.com>
Date: Sun, 2 Oct 2011 15:26:14 +0800
Cc: "Jayachandran C." <jayachandranc@netlogicmicro.com>, Ralf Baechle <ralf@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=RnzzuiM1xlTgkKgoGcttznR78IK9iRhzSWhPQX/QtcA=; b=woP3lIZ2cNdBnHFVlhAGJz/H+ww1JCbE1IzVqKl/Tu+Ai0x1lU1XBai0KgMgwag61f q1WvKhrmUUXApybqZP/LRzDC0Bp7v91JtgMruIpTdQ4Y92UorPPVAXvnY7EzhZW1dteh 2HslDxrj+3Cw+bl1XphX46OdLUhoLWI01QGPg=
Sender: linux-mips-bounce@linux-mips.org
Netlogic XLR chip has multiple cores. Each core includes four integrated
hardware threads, and they share L1 data and instruction caches.

If XLR chip is marked to be SMT capable, linux scheduler then could do more,
say idle load balancing.

Any comment is welcom, thanks.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- a/arch/mips/netlogic/xlr/smp.c      Sun Oct  2 14:15:28 2011
+++ b/arch/mips/netlogic/xlr/smp.c      Sun Oct  2 14:15:58 2011
@@ -176,6 +176,7 @@ void __init nlm_smp_setup(void)

 void nlm_prepare_cpus(unsigned int max_cpus)
 {
+       smp_num_siblings = 4;
 }

 struct plat_smp_ops nlm_smp_ops = {
--- a/arch/mips/kernel/smp.c    Sun Oct  2 14:12:09 2011
+++ b/arch/mips/kernel/smp.c    Sun Oct  2 14:14:58 2011
@@ -73,7 +73,12 @@ static inline void set_cpu_sibling_map(i

        if (smp_num_siblings > 1) {
                for_each_cpu_mask(i, cpu_sibling_setup_map) {
-                       if (cpu_data[cpu].core == cpu_data[i].core) {
+                       if (current_cpu_type() == CPU_XLR) {
+                               if (((i>>2) & 0x7) == ((cpu>>2) & 0x7))
+                                       goto set;
+                       }
+                       else if (cpu_data[cpu].core == cpu_data[i].core) {
+set:
                                cpu_set(i, cpu_sibling_map[cpu]);
                                cpu_set(cpu, cpu_sibling_map[i]);
                        }

<Prev in Thread] Current Thread [Next in Thread>