Hello Ming,
could you please give some pointers to observe an overall status of
oprofile support on ARM A9 cores? IIUC, now it doesn't work
without oprofile.timer=1 kernel option, at least for Linus' tree;
searching gives a lot of discussion/patches fragments and similar
stuff, but I was unable to find a complete patch/git tree/whatever
else to try.
Thanks in advance,
Dmitry
synchronize_rcu blocks the caller of opp_enable/disbale
for a complete grace period. This blocking duration prevents
any intensive use of the functions. Replace synchronize_rcu
by call_rcu which will call our function for freeing the old
opp element.
The duration of opp_enable and opp_disable will be no more
dependant of the grace period.
Signed-off-by: Vincent Guittot <vincent.guittot(a)linaro.org>
---
drivers/base/power/opp.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index ac993ea..49e4626 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -64,6 +64,7 @@ struct opp {
unsigned long u_volt;
struct device_opp *dev_opp;
+ struct rcu_head head;
};
/**
@@ -441,6 +442,17 @@ int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
}
/**
+ * opp_free_rcu() - helper to clear the struct opp when grace period has
+ * elapsed without blocking the the caller of opp_set_availability
+ */
+static void opp_free_rcu(struct rcu_head *head)
+{
+ struct opp *opp = container_of(head, struct opp, head);
+
+ kfree(opp);
+}
+
+/**
* opp_set_availability() - helper to set the availability of an opp
* @dev: device for which we do this operation
* @freq: OPP frequency to modify availability
@@ -511,7 +523,7 @@ static int opp_set_availability(struct device *dev, unsigned long freq,
list_replace_rcu(&opp->node, &new_opp->node);
mutex_unlock(&dev_opp_list_lock);
- synchronize_rcu();
+ call_rcu(&opp->head, opp_free_rcu);
/* Notify the change of the OPP availability */
if (availability_req)
@@ -521,13 +533,10 @@ static int opp_set_availability(struct device *dev, unsigned long freq,
srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_DISABLE,
new_opp);
- /* clean up old opp */
- new_opp = opp;
- goto out;
+ return 0;
unlock:
mutex_unlock(&dev_opp_list_lock);
-out:
kfree(new_opp);
return r;
}
--
1.7.9.5
Hi Andrey,
Please PULL b.L MP V10 branch from my tree.
Updates:
-------
- Based on v3.6
- Stats:
- Total Patches: 77 (V9 had incorrect count)
- New Patches: 7
- task-placement-v2: sched: Enable HMP priority filter by default
- arm-multi_pmu_v2 updated existing patches:
http://permalink.gmane.org/gmane.linux.linaro.devel/13707
- hw-bkp-v7.1-debug-v1: new branch (1 patch)
- Dropped Patches: 2
- branch cpu-hotplug-get_online_cpus-v1 removed as patches are already there
in rcu-hotplug-v1
- Updated Patches:
- per-task-load-average-v3-fixed updated with minor fixes. from:
git://git.kernel.org/pub/scm/linux/kernel/git/pjt/sched.git
------------------------8<------------------------------------------------
The following changes since commit c6617199117105f771463be72e69017303c9fe54:
config-frag/big-LITTLE: Use device-tree to provide fast/slow CPU
list for HMP (2012-10-03 16:00:21 +0530)
are available in the git repository at:
git://git.linaro.org/arm/big.LITTLE/mp.git big-LITTLE-MP-v10
for you to fetch changes up to 2027d925f44d49835beff1b4917d8fd91f8805d7:
Merge branches 'per-cpu-thread-hotplug-v3-fixed',
'task-placement-v2', 'arm-asymmetric-support-v3-v3.6-rc1',
'rcu-hotplug-v1', 'arm-multi_pmu_v2', 'scheduler-misc-v1',
'hw-bkp-v7.1-debug-v1' and 'config-fragments' into big-LITTLE-MP-v10
(2012-10-12 14:14:20 +0530)
----------------------------------------------------------------
Axel Lin (1):
ARM: ux500: Fix build error due to missing include of asm/pmu.h
in cpu-db8500.c
Ben Segall (1):
sched: maintain per-rq runnable averages
Dietmar Eggemann (1):
ARM: hw_breakpoint: v7.1 self-hosted debug powerdown support
Jon Hunter (1):
ARM: PMU: Add runtime PM Support
Lorenzo Pieralisi (1):
ARM: kernel: provide cluster to logical cpu mask mapping API
Marc Zyngier (1):
ARM: perf: add guest vs host discrimination
Mark Rutland (1):
ARM: perf: register cpu_notifier at driver init
Morten Rasmussen (12):
sched: entity load-tracking load_avg_ratio
sched: Task placement for heterogeneous systems based on task
load-tracking
sched: Forced task migration on heterogeneous systems
sched: Introduce priority-based task migration filter
ARM: Add HMP scheduling support for ARM architecture
ARM: sched: Use device-tree to provide fast/slow CPU list for HMP
ARM: sched: Setup SCHED_HMP domains
sched: Add ftrace events for entity load-tracking
sched: Add HMP task migration ftrace event
sched: SCHED_HMP multi-domain task migration control
sched: Enable HMP priority filter by default
linaro/configs: Enable HMP priority filter by default
Paul Turner (15):
sched: track the runnable average on a per-task entity basis
sched: aggregate load contributed by task entities on parenting cfs_rq
sched: maintain the load contribution of blocked entities
sched: add an rq migration call-back to sched_class
sched: account for blocked load waking back up
sched: aggregate total task_group load
sched: compute load contribution by a group entity
sched: normalize tg load contributions against runnable time
sched: maintain runnable averages across throttled periods
sched: replace update_shares weight distribution with per-entity
computation
sched: refactor update_shares_cpu() -> update_blocked_avgs()
sched: update_cfs_shares at period edge
sched: make __update_entity_runnable_avg() fast
sched: implement usage tracking
sched: introduce temporary FAIR_GROUP_SCHED dependency for load-tracking
Sudeep KarkadaNagesha (11):
ARM: pmu: remove arm_pmu_type enumeration
ARM: perf: move irq registration into pmu implementation
ARM: perf: allocate CPU PMU dynamically at probe time
ARM: perf: consistently use struct perf_event in arm_pmu functions
ARM: perf: check ARMv7 counter validity on a per-pmu basis
ARM: perf: replace global CPU PMU pointer with per-cpu pointers
ARM: perf: register CPU PMUs with idr types
ARM: perf: set cpu affinity to support multiple PMUs
ARM: perf: set cpu affinity for the irqs correctly
ARM: perf: remove spaces in CPU PMU names
ARM: perf: save/restore pmu registers in pm notifier
Viresh Kumar (1):
Merge branches 'per-cpu-thread-hotplug-v3-fixed',
'task-placement-v2', 'arm-asymmetric-support-v3-v3.6-rc1',
'rcu-hotplug-v1', 'arm-multi_pmu_v2', 'scheduler-misc-v1',
'hw-bkp-v7.1-debug-v1' and 'config-fragments' into big-LITTLE-MP-v10
Will Deacon (8):
ARM: perf: add devicetree bindings for 11MPcore, A5, A7 and A15 PMUs
ARM: pmu: remove unused reservation mechanism
ARM: perf: remove mysterious compiler barrier
ARM: perf: probe devicetree in preference to current CPU
ARM: perf: prepare for moving CPU PMU code into separate file
ARM: perf: move CPU-specific PMU handling code into separate file
ARM: perf: return NOTIFY_DONE from cpu notifier when no available PMU
ARM: perf: consistently use arm_pmu->name for PMU name