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
Calendar Week 41: Here is test result summary for Linaro ubuntu image on
following boards:
1) ARM Versatile Express A9;
2) Samsung Origen;
3) TI Panda Board 4430;
4) TI Panda Board 4460.
Synopsis: No change on feature status for vexpress A9 & Samsung Origen
boards. Both HDMI & DVI-D back to work on Panda 4430 & 4460. For SD card
flashing, now command "dd" backs to work on all images.
1. vexpress A9 + ubuntu (Column AD):
https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdFNmV…
Features' status is exactly same as previous week.
2. Origen + ubuntu (Column Y):
https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEowN…
Features' status is exactly same as previous week.
3. Panda 4430 + ubuntu (Column AA):
https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEwwZ…
Audio over HDMI doesn't work, and this causes no sound can be heard when
using "rhythmbox" to play music. Bluetooth now let system crashes again,
after pairing process. Also, system crashes during the Power Management
test "lava-test run pwrmgmt", with log output flushing in serial console.
4. Panda 4460 + ubuntu (Column Y):
https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEwwZ…
The test result on Panda 4460 is quite different with Panda 4430. On TI
Panda 4460 board, Audio over HDMI works well, Bluetooth headset works well,
and Power Management test works well. Even suspend / resume starts to work,
although many error log output flushes in serial console.
For the previous week (Calendar week 40) summary, please refer to
attachment.
Thank you.
Best Regards
Botao Sun
Hi Andrey,
I was just thinking, it would be good if we have another config fragment in
linaro/ to enable kernel debug config options like: CONFIG_DEBUG_INFO.
What do you think?
--
viresh
This patch introduces os save and restore mechanism for v7.1 debug and
self-hosted debuggers.
It enables the os to save DBGDSCR before powerdown and restore it when power
is restored.
The clearing of the os lock in the restore function kick-starts the debug
logic again.
The os save and restore routines are hooked into the CPU PM event notifier
chain. CPU PM events are used to save and restore per-cpu context when a
single CPU is preparing to enter or has exited a low power state.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann(a)arm.com>
---
Hi Viresh,
this patch is for the upcoming Linaro release.
Tested on TC2 big.LITTLE testchip (cpuidle, on both A7 and A15 clusters).
The patch is against 8f18a4e pdsw-ci:29418/kernel, branch
origin/linaro-lt-integration-linaro-vexpress.
Review comment from Liviu fixed.
arch/arm/kernel/hw_breakpoint.c | 57 +++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 281bf33..eed4d0c 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -28,6 +28,7 @@
#include <linux/perf_event.h>
#include <linux/hw_breakpoint.h>
#include <linux/smp.h>
+#include <linux/cpu_pm.h>
#include <asm/cacheflush.h>
#include <asm/cputype.h>
@@ -42,6 +43,11 @@ static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[ARM_MAX_BRP]);
/* Watchpoint currently in use for each WRP. */
static DEFINE_PER_CPU(struct perf_event *, wp_on_reg[ARM_MAX_WRP]);
+#ifdef CONFIG_CPU_PM
+/* Storage for OS Save and Restore. */
+static DEFINE_PER_CPU(u32, cpu_dscr);
+#endif
+
/* Number of BRP/WRP registers on this CPU. */
static int core_num_brps;
static int core_num_wrps;
@@ -990,6 +996,55 @@ static struct notifier_block __cpuinitdata dbg_reset_nb = {
.notifier_call = dbg_reset_notify,
};
+#ifdef CONFIG_CPU_PM
+static void os_save(int cpu)
+{
+ /* Set OS Lock. */
+ asm volatile("mcr p14, 0, %0, c1, c0, 4" : : "r" (0xC5ACCE55));
+ isb();
+
+ /* Save DSCRext. */
+ ARM_DBG_READ(c2, 2, per_cpu(cpu_dscr, cpu));
+}
+
+static void os_restore(int cpu)
+{
+ /* Restore DSCRext. */
+ ARM_DBG_WRITE(c2, 2, per_cpu(cpu_dscr, cpu));
+
+ /* Clear OS Lock. */
+ asm volatile("mcr p14, 0, %0, c1, c0, 4" : : "r" (0));
+ isb();
+}
+
+static int dbg_cpu_pm_notify(struct notifier_block *self, unsigned long action,
+ void *v)
+{
+ int cpu = smp_processor_id();
+
+ if (action == CPU_PM_ENTER)
+ os_save(cpu);
+ else if (action == CPU_PM_EXIT)
+ os_restore(cpu);
+
+ return NOTIFY_OK;
+}
+
+static struct notifier_block __cpuinitdata dbg_cpu_pm_nb = {
+ .notifier_call = dbg_cpu_pm_notify,
+};
+
+static void __init pm_init(void)
+{
+ if (get_debug_arch() == ARM_DEBUG_ARCH_V7_1)
+ cpu_pm_register_notifier(&dbg_cpu_pm_nb);
+}
+#else
+static inline void pm_init(void)
+{
+}
+#endif
+
static int __init arch_hw_breakpoint_init(void)
{
u32 dscr;
@@ -1048,6 +1103,8 @@ static int __init arch_hw_breakpoint_init(void)
/* Register hotplug notifier. */
register_cpu_notifier(&dbg_reset_nb);
+
+ pm_init();
return 0;
}
arch_initcall(arch_hw_breakpoint_init);
--
1.7.9.5