From patchwork Fri Oct 21 16:56:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 4785 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id BDD3223DEF for ; Fri, 21 Oct 2011 16:56:43 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id B209EA182ED for ; Fri, 21 Oct 2011 16:56:43 +0000 (UTC) Received: by eyg5 with SMTP id 5so5274679eyg.11 for ; Fri, 21 Oct 2011 09:56:43 -0700 (PDT) Received: by 10.223.60.73 with SMTP id o9mr25995695fah.18.1319216203499; Fri, 21 Oct 2011 09:56:43 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.1.71 with SMTP id 7cs22905lak; Fri, 21 Oct 2011 09:56:43 -0700 (PDT) Received: by 10.227.156.70 with SMTP id v6mr236478wbw.27.1319216202686; Fri, 21 Oct 2011 09:56:42 -0700 (PDT) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id em9si10169905wbb.77.2011.10.21.09.56.42 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Oct 2011 09:56:42 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) smtp.mail=vincent.guittot@linaro.org Received: by wwi18 with SMTP id 18so5984508wwi.31 for ; Fri, 21 Oct 2011 09:56:42 -0700 (PDT) Received: by 10.227.38.200 with SMTP id c8mr5585816wbe.101.1319216201955; Fri, 21 Oct 2011 09:56:41 -0700 (PDT) Received: from localhost.localdomain (pas72-1-88-161-60-229.fbx.proxad.net. [88.161.60.229]) by mx.google.com with ESMTPS id ei16sm22807943wbb.21.2011.10.21.09.56.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Oct 2011 09:56:41 -0700 (PDT) From: Vincent Guittot To: linaro-dev@lists.linaro.org Cc: patches@linaro.org, Vincent Guittot Subject: [RFC PATCH 08/11] ARM: cpu topology: Add asym topology flag for using cpu0 1st Date: Fri, 21 Oct 2011 18:56:27 +0200 Message-Id: <1319216187-2649-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.4.1 Modify the CPU sched_domain flags in powersave mode for using the cpu0 in ched_mc powersave mode Signed-off-by: Vincent Guittot --- arch/arm/include/asm/topology.h | 33 +++++++++++++++++++++++++++++++++ arch/arm/kernel/topology.c | 11 +++++++++++ 2 files changed, 44 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h index 58b8b84..f7f02e3 100644 --- a/arch/arm/include/asm/topology.h +++ b/arch/arm/include/asm/topology.h @@ -34,6 +34,39 @@ static inline void store_cpu_topology(unsigned int cpuid) { } #endif +/* Common values for CPUs */ +#ifndef SD_CPU_INIT +#define SD_CPU_INIT (struct sched_domain) { \ + .min_interval = 1, \ + .max_interval = 4, \ + .busy_factor = 64, \ + .imbalance_pct = 125, \ + .cache_nice_tries = 1, \ + .busy_idx = 2, \ + .idle_idx = 1, \ + .newidle_idx = 0, \ + .wake_idx = 0, \ + .forkexec_idx = 0, \ + \ + .flags = 1*SD_LOAD_BALANCE \ + | 1*SD_BALANCE_NEWIDLE \ + | 1*SD_BALANCE_EXEC \ + | 1*SD_BALANCE_FORK \ + | 0*SD_BALANCE_WAKE \ + | 1*SD_WAKE_AFFINE \ + | 0*SD_PREFER_LOCAL \ + | 0*SD_SHARE_CPUPOWER \ + | 0*SD_SHARE_PKG_RESOURCES \ + | 0*SD_SERIALIZE \ + | arch_sd_sibling_asym_packing() \ + | sd_balance_for_package_power() \ + | sd_power_saving_flags() \ + , \ + .last_balance = jiffies, \ + .balance_interval = 1, \ +} +#endif + #include #endif /* _ASM_ARM_TOPOLOGY_H */ diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 9f75967..c312937 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -165,6 +165,17 @@ unsigned long arch_scale_freq_power(struct sched_domain *sd, int cpu) } /* + * sched_domain flag configuration + */ +/* TODO add a config flag for this function */ +int arch_sd_sibling_asym_packing(void) +{ + if (sched_smt_power_savings || sched_mc_power_savings) + return SD_ASYM_PACKING; + return 0; +} + +/* * default topology function */