From patchwork Fri Oct 18 11:52:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 21125 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6FD48246F1 for ; Fri, 18 Oct 2013 11:54:03 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kq14sf6202099pab.8 for ; Fri, 18 Oct 2013 04:54:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=o5m3EHDXtGXht5k3ObjvfLNrzxzQUNREO3N25Q5m6qI=; b=IP8+PKjoGlZiAI2KrH3y52X87h1r98cGX7jkQE59BksHzg31QUkw+pvhnGkiEv+lzV fgx1ktsUpGPT4a90sN5jc1bmw3QVsYhy2bFZw8JGfPCa3edb+qfNoldX55lS0lgJoYYy Xcdo53bxmB5GUah9fTPQEDdJMLN/yGTdPjdkvrRj7WQKzyyZQtkM2oDJl2IMx0xBtT5I gByZxj8k+/2zhFpMji6yHoHC+VK1oyJR0PGAjziJziLTTA+2D/Ta/XhOz7nBOlG3oQD1 HxOwCatog9O7IyT2PkIQZx3lCLEAdkW9r1A0NNOzqRyPqe1LCCovgusk9a6bOO7wgPxG HA2A== X-Received: by 10.68.189.41 with SMTP id gf9mr945872pbc.3.1382097242740; Fri, 18 Oct 2013 04:54:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.53.2 with SMTP id x2ls475120qeo.34.gmail; Fri, 18 Oct 2013 04:54:02 -0700 (PDT) X-Received: by 10.52.169.37 with SMTP id ab5mr13336vdc.31.1382097242594; Fri, 18 Oct 2013 04:54:02 -0700 (PDT) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id wp10si234494vdb.45.2013.10.18.04.54.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:54:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id h10so1821932vbh.34 for ; Fri, 18 Oct 2013 04:54:02 -0700 (PDT) X-Gm-Message-State: ALoCoQlRuh9aNYcvauhDnyWLOK4B8M5rNY9zDsaYxZGlgTI/3TXZIcVWa1pkkXUUu1hwVSPBk75D X-Received: by 10.220.186.202 with SMTP id ct10mr1782819vcb.14.1382097242460; Fri, 18 Oct 2013 04:54:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp29494vcz; Fri, 18 Oct 2013 04:54:01 -0700 (PDT) X-Received: by 10.194.93.3 with SMTP id cq3mr2282942wjb.26.1382097241587; Fri, 18 Oct 2013 04:54:01 -0700 (PDT) Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by mx.google.com with ESMTPS id r2si422643wia.9.2013.10.18.04.54.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:54:01 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.53 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.53; Received: by mail-wg0-f53.google.com with SMTP id y10so3706786wgg.32 for ; Fri, 18 Oct 2013 04:54:01 -0700 (PDT) X-Received: by 10.180.198.44 with SMTP id iz12mr2128847wic.32.1382097241072; Fri, 18 Oct 2013 04:54:01 -0700 (PDT) Received: from localhost.localdomain (LPuteaux-156-14-44-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id lr3sm25000673wic.5.2013.10.18.04.53.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:54:00 -0700 (PDT) From: Vincent Guittot To: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, pjt@google.com, Morten.Rasmussen@arm.com, cmetcalf@tilera.com, tony.luck@intel.com, alex.shi@intel.com, preeti@linux.vnet.ibm.com, linaro-kernel@lists.linaro.org Cc: rjw@sisk.pl, paulmck@linux.vnet.ibm.com, corbet@lwn.net, tglx@linutronix.de, len.brown@intel.com, arjan@linux.intel.com, amit.kucheria@linaro.org, l.majewski@samsung.com, Vincent Guittot Subject: [RFC][PATCH v5 12/14] sched: create a statistic structure Date: Fri, 18 Oct 2013 13:52:25 +0200 Message-Id: <1382097147-30088-12-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1382097147-30088-1-git-send-email-vincent.guittot@linaro.org> References: <1382097147-30088-1-git-send-email-vincent.guittot@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vincent.guittot@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Create a statistic structure that will be used to share information with other frameworks like cpuidle and cpufreq. This structure only contains the current wake up latency of a core for now but could be extended with other usefull information. Signed-off-by: Vincent Guittot --- include/linux/sched.h | 12 +++++++++++- kernel/sched/fair.c | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 2004cdb..d676aa2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2,7 +2,7 @@ #define _LINUX_SCHED_H #include - +#include struct sched_param { int sched_priority; @@ -63,6 +63,16 @@ struct fs_struct; struct perf_event_context; struct blk_plug; +/* This structure is used to share information and statistics with other + * frameworks. It only shares wake up latency fro the moment but should be + * extended with other usefull informations + */ +struct sched_pm { + atomic_t wake_latency; /* time to wake up the cpu */ +}; + +DECLARE_PER_CPU(struct sched_pm, sched_stat); + /* * List of flags we want to share for kernel threads, * if only because they are not used by them anyway. diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2d9f782..ad8b99a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -178,6 +178,11 @@ void sched_init_granularity(void) update_sysctl(); } +/* Save per_cpu information that will be shared with other frameworks */ +DEFINE_PER_CPU(struct sched_pm, sched_stat) = { + .wake_latency = ATOMIC_INIT(0) +}; + #ifdef CONFIG_SMP static unsigned long available_of(int cpu) {