From: Wei Wang <wei.w.wang@intel.com>
To: jbeulich@suse.com, andrew.cooper3@citrix.com,
xen-devel@lists.xen.org, wei.liu2@citrix.com
Cc: Wei Wang <wei.w.wang@intel.com>
Subject: [PATCH v6 2/6] x86/intel_pstate: introduce the internal_governor struct
Date: Wed, 28 Oct 2015 11:21:14 +0800 [thread overview]
Message-ID: <1446002478-16105-3-git-send-email-wei.w.wang@intel.com> (raw)
In-Reply-To: <1446002478-16105-1-git-send-email-wei.w.wang@intel.com>
Introduce a simple internal_governor struct to manage internal
governor related variables. Also, add a condition check in
cpufreq_del_cpu to avoid going through the old ACPI governor
framework when an internal governor is in use.
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
---
changes in v6:
1) create this patch by spliting it from the next big one.
xen/drivers/cpufreq/cpufreq.c | 5 +++--
xen/include/acpi/cpufreq/cpufreq.h | 7 +++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 6e666e4..2c1c713 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -334,8 +334,9 @@ int cpufreq_del_cpu(unsigned int cpu)
/* for HW_ALL, stop gov for each core of the _PSD domain */
/* for SW_ALL & SW_ANY, stop gov for the 1st core of the _PSD domain */
- if (hw_all || (cpumask_weight(cpufreq_dom->map) ==
- perf->domain_info.num_processors))
+ if (!policy->internal_gov &&
+ (hw_all || (cpumask_weight(cpufreq_dom->map) ==
+ perf->domain_info.num_processors)))
__cpufreq_governor(policy, CPUFREQ_GOV_STOP);
cpufreq_statistic_exit(cpu);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 48ad1d0..8947368 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -53,6 +53,12 @@ struct perf_limits {
uint32_t min_policy_pct;
};
+struct internal_governor {
+ char *avail_gov;
+ uint32_t gov_num;
+ uint32_t cur_gov;
+};
+
struct cpufreq_policy {
cpumask_var_t cpus; /* affected CPUs */
unsigned int shared_type; /* ANY or ALL affected CPUs
@@ -66,6 +72,7 @@ struct cpufreq_policy {
* governors are used */
struct perf_limits limits;
struct cpufreq_governor *governor;
+ struct internal_governor *internal_gov;
bool_t resume; /* flag for cpufreq 1st run
* S3 wakeup, hotplug cpu, etc */
--
1.9.1
next prev parent reply other threads:[~2015-10-28 3:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 3:21 [PATCH v6 0/6] Porting the intel_pstate driver to Xen Wei Wang
2015-10-28 3:21 ` [PATCH v6 1/6] x86/intel_pstate: add some calculation related support Wei Wang
2015-11-17 17:36 ` Jan Beulich
2015-10-28 3:21 ` Wei Wang [this message]
2015-11-20 11:48 ` [PATCH v6 2/6] x86/intel_pstate: introduce the internal_governor struct Jan Beulich
2015-10-28 3:21 ` [PATCH v6 3/6] x86/intel_pstate: the main body of the intel_pstate driver Wei Wang
2015-11-20 14:09 ` Jan Beulich
2015-10-28 3:21 ` [PATCH v6 4/6] x86/intel_pstate: add a booting param to select the driver to load Wei Wang
2015-11-20 14:22 ` Jan Beulich
2015-10-28 3:21 ` [PATCH v6 5/6] x86/intel_pstate: support the use of intel_pstate in pmstat.c Wei Wang
2015-10-28 11:18 ` Wei Liu
2015-11-20 14:47 ` Jan Beulich
2015-10-28 3:21 ` [PATCH v6 6/6] tools: enable xenpm to control the intel_pstate driver Wei Wang
2015-10-28 11:36 ` Wei Liu
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=1446002478-16105-3-git-send-email-wei.w.wang@intel.com \
--to=wei.w.wang@intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).