Double ! or !! are normally required to get 0 or 1 out of a expression. A
comparision always returns 0 or 1 and hence there is no need to apply double !
over it again.
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
kernel/power/suspend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 62ee437..90b3d93 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -39,7 +39,7 @@ static const struct platform_suspend_ops *suspend_ops;
static bool need_suspend_ops(suspend_state_t state)
{
- return !!(state > PM_SUSPEND_FREEZE);
+ return state > PM_SUSPEND_FREEZE;
}
static DECLARE_WAIT_QUEUE_HEAD(suspend_freeze_wait_head);
--
1.7.12.rc2.18.g61b472e
On 23 January 2014 11:11, Lei Wen <adrian.wenl(a)gmail.com> wrote:
> On Wed, Jan 22, 2014 at 10:07 PM, Thomas Gleixner <tglx(a)linutronix.de> wrote:
>> On Wed, 22 Jan 2014, Lei Wen wrote:
>>> Recently I want to do the experiment for cpu isolation over 3.10 kernel.
>>> But I find the isolated one is periodically waken up by IPI interrupt.
>>>
>>> By checking the trace, I find those IPI is generated by add_timer_on,
>>> which would calls wake_up_nohz_cpu, and wake up the already idle cpu.
>>>
>>> With further checking, I find this timer is added by on_demand governor of
>>> cpufreq. It would periodically check each cores' state.
>>> The problem I see here is cpufreq_governor using INIT_DEFERRABLE_WORK
>>> as the tool, while timer is made as deferrable anyway.
>>> And what is more that cpufreq checking is very frequent. In my case, the
>>> isolated cpu is wakenup by IPI every 5ms.
>>>
>>> So why kernel need to wake the remote processor when mount the deferrable
>>> timer? As per my understanding, we'd better keep cpu as idle when use
>>> the deferrable timer.
>>
>> Indeed, we can avoid the wakeup of the remote cpu when the timer is
>> deferrable.
>
> Glad to hear that we could fix this unwanted wakeup.
> Do you have related patches already?
>
>>
>> Though you really want to figure out why the cpufreq governor is
>> arming timers on other cores every 5ms. That smells like an utterly
>> stupid approach.
>
> Not sure why cpufreq choose such frequent profiling over each cpu.
> As my understanding, since kernel is smp, launching profiler over one cpu
> would be enough...
Hi Guys,
So the first question is why cpufreq needs it and is it really stupid?
Yes, it is stupid but that's how its implemented since a long time. It does
so to get data about the load on CPUs, so that freq can be scaled up/down.
Though there is a solution in discussion currently, which will take
inputs from scheduler and so these background timers would go away.
But we need to wait until that time.
Now, why do we need that for every cpu, while that for a single cpu might
be enough? The answer is cpuidle here: What if the cpu responsible for
running timer goes to sleep? Who will evaluate the load then? And if we
make this timer run on one cpu in non-deferrable mode then that cpu
would be waken up again and again from idle. So, it was decided to have
a per-cpu deferrable timer. Though to improve efficiency, once it is fired
on any cpu, timer for all other CPUs are rescheduled, so that they don't
fire before 5ms (sampling time)..
I think below diff might get this fixed for you, though I am not sure if it
breaks something else. Probably Thomas/Frederic can answer here.
If this looks fine I will send it formally again:
diff --git a/kernel/timer.c b/kernel/timer.c
index accfd24..3a2c7fa 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -940,7 +940,8 @@ void add_timer_on(struct timer_list *timer, int cpu)
* makes sure that a CPU on the way to stop its tick can not
* evaluate the timer wheel.
*/
- wake_up_nohz_cpu(cpu);
+ if (!tbase_get_deferrable(timer->base))
+ wake_up_nohz_cpu(cpu);
spin_unlock_irqrestore(&base->lock, flags);
}
EXPORT_SYMBOL_GPL(add_timer_on);
This patchset relies on the "setting the table for integration of cpuidle with
the scheduler" from Nicolas Pitre where the idle.c file has been moved into the
sched directory.
It encapsulate the cpuidle main code into three exported functions which are
used by the cpuidle_idle_call function. This one is then moved into the idle.c
file.
The third patch shows an example on how integrating cpuidle information in the
scheduler is easier.
Daniel Lezcano (3):
cpuidle: split cpuidle_idle_call main function into functions
cpuidle: move the cpuidle_idle_call function to idle.c
idle: store the idle state index in the struct rq
drivers/cpuidle/cpuidle.c | 80 +++++++++++++++++++++++++--------------------
include/linux/cpuidle.h | 9 +++--
kernel/sched/idle.c | 53 ++++++++++++++++++++++++++++++
kernel/sched/sched.h | 3 ++
4 files changed, 108 insertions(+), 37 deletions(-)
--
1.7.9.5
As everyone should know by now, we want to integrate the cpuidle
governor with the scheduler for a more efficient idling of CPUs.
In order to help the transition, this small patch series moves the
existing interaction with cpuidle from architecture code to generic
core code. The ARM, PPC, SH and X86 architectures are concerned.
No functional change should have occurred yet.
@peterz: Are you willing to pick up those patches?
Change from v1:
- dropped removal of arch_cpu_idle_prepare()
arch/arm/kernel/process.c | 16 +++------
arch/powerpc/platforms/pseries/processor_idle.c | 5 +++
arch/powerpc/platforms/pseries/setup.c | 34 ++++++++-----------
arch/sh/kernel/idle.c | 4 +--
arch/x86/kernel/process.c | 5 +--
kernel/Makefile | 1 -
kernel/cpu/Makefile | 1 -
kernel/sched/Makefile | 2 +-
kernel/{cpu => sched}/idle.c | 4 ++-
9 files changed, 30 insertions(+), 42 deletions(-)
Nicolas
From: Mark Brown <broonie(a)linaro.org>
Don't wait indefinitely for transfers to complete but time out after 10ms
more than we expect the transfer to take on the wire.
Signed-off-by: Mark Brown <broonie(a)linaro.org>
---
drivers/spi/spi.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 7f23cf9afa79..1826a50c2aaf 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -710,6 +710,7 @@ static int spi_transfer_one_message(struct spi_master *master,
bool cur_cs = true;
bool keep_cs = false;
int ret = 0;
+ int ms = 1;
spi_set_cs(msg->spi, true);
@@ -727,7 +728,16 @@ static int spi_transfer_one_message(struct spi_master *master,
if (ret > 0) {
ret = 0;
- wait_for_completion(&master->xfer_completion);
+ ms = xfer->len * 8 * 1000 / xfer->speed_hz;
+ ms += 10; /* some tolerance */
+
+ ms = wait_for_completion_timeout(&master->xfer_completion,
+ msecs_to_jiffies(ms));
+ }
+
+ if (ms == 0) {
+ dev_err(&msg->spi->dev, "SPI transfer timed out\n");
+ msg->status = -ETIMEDOUT;
}
trace_spi_transfer_stop(msg, xfer);
--
1.9.rc1
Add AARCH64 specific support. This includes the following:
- AARCH64 perf registers definition and hooks,
- compat mode registers use, i.e. profiling a 32-bit binary on
a 64-bit system,
- unwinding using the dwarf information from the .debug_frame
section of the ELF binary,
- unwinding using the frame pointer information; in 64-bit and
compat modes.
Note: support for unwinding using the dwarf information in compat
mode requires some changes to the libunwind code. Those changes
have been submitted on the libunwind ML and are in discussion.
Tested on ARMv7, ARMv8 and x86_64 platforms. The compat mode has been
tested on ARMv8 using statically built 32-bit binaries.
Jean Pihet (4):
ARM64: perf: add support for perf registers API
ARM64: perf: wire up perf_regs and unwind support
ARM64: perf: add support for frame pointer unwinding in compat mode
ARM64: perf: support dwarf unwinding in compat mode
arch/arm64/Kconfig | 2 +
arch/arm64/include/asm/compat.h | 2 +-
arch/arm64/include/asm/ptrace.h | 3 +-
arch/arm64/include/uapi/asm/Kbuild | 1 +
arch/arm64/include/uapi/asm/perf_regs.h | 40 ++++++++++++++
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/perf_event.c | 75 +++++++++++++++++++++++---
arch/arm64/kernel/perf_regs.c | 44 ++++++++++++++++
tools/perf/arch/arm64/Makefile | 7 +++
tools/perf/arch/arm64/include/perf_regs.h | 88 +++++++++++++++++++++++++++++++
tools/perf/arch/arm64/util/dwarf-regs.c | 80 ++++++++++++++++++++++++++++
tools/perf/arch/arm64/util/unwind.c | 82 ++++++++++++++++++++++++++++
tools/perf/config/Makefile | 8 ++-
13 files changed, 422 insertions(+), 11 deletions(-)
create mode 100644 arch/arm64/include/uapi/asm/perf_regs.h
create mode 100644 arch/arm64/kernel/perf_regs.c
create mode 100644 tools/perf/arch/arm64/Makefile
create mode 100644 tools/perf/arch/arm64/include/perf_regs.h
create mode 100644 tools/perf/arch/arm64/util/dwarf-regs.c
create mode 100644 tools/perf/arch/arm64/util/unwind.c
--
1.7.11.7
From: Mark Brown <broonie(a)linaro.org>
Once we have full constraints then all supply mappings should be known to
the regulator API. This means that we should treat failed lookups as fatal
rather than deferring in the hope of further registrations but this was
broken by commit 9b92da1f1205bd25 "regulator: core: Fix default return
value for _get()" which was targeted at DT systems but unintentionally
broke non-DT systems by changing the default return value.
Fix this by explicitly returning -EPROBE_DEFER from the DT lookup if we
find a property but no corresponding regulator and by having the non-DT
case default to -ENODEV when we have full constraints.
Fixes: 9b92da1f1205bd25 "regulator: core: Fix default return value for _get()"
Signed-off-by: Mark Brown <broonie(a)linaro.org>
---
drivers/regulator/core.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index b38a6b669e8c..16a309e5c024 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1272,6 +1272,8 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
if (r->dev.parent &&
node == r->dev.of_node)
return r;
+ *ret = -EPROBE_DEFER;
+ return NULL;
} else {
/*
* If we couldn't even get the node then it's
@@ -1312,7 +1314,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
struct regulator_dev *rdev;
struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
const char *devname = NULL;
- int ret = -EPROBE_DEFER;
+ int ret;
if (id == NULL) {
pr_err("get() with no identifier\n");
@@ -1322,6 +1324,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
if (dev)
devname = dev_name(dev);
+ if (have_full_constraints())
+ ret = -ENODEV;
+ else
+ ret = -EPROBE_DEFER;
+
mutex_lock(®ulator_list_mutex);
rdev = regulator_dev_lookup(dev, id, &ret);
--
1.8.5.3
The changes in patch 1431574a1c4c (lib/decompressors: fix "no limit"
output buffer length) avoid doing decompression a byte at a time when
decompressing into high physical addresses using a small, well isolated
change. The patch can give a very noticable improvement in kernel boot
times on affected systems, for example with one ARM system this reduces
the total time to boot the kernel by more than a third.
Would you consider this patch for stable? It doesn't quite fit within
the criteria but you've indicated in the past that such isolated and
well supported changs can be acceptable anyway. If it's not OK for
stable it seems like it should be a good candidate for LTSI.