Greetings,
I have disabled power saving features in linaro ubuntu 11.10 on a
PandaBoard, in order to prevent the screen going black, since there is no
mouse nor keyboard attached to the board (It is simply displaying videos,
in a closed loop). But when I reboot (Or power up after a time with the
board off) sometimes this works, and sometimes not. There seems not to be
any kind of rule for it to work, it can fail 5 or 6 times (going black
after 10 minutes, even when it is set to "never"), and later work ok for 3
or 4 reboots. And then, fail again.
Can anyone enlighten me a bit? Sorry for the joke, but my brain is almost
as dark as black the screen goes...
thanks in advance,
While discussing at the U-Boot mailing list about i.MX6Q USB host
support for U-Boot, there was the question what's about the same for
mainline Linux. See below.
I'd like to continue this discussion with a new subject and adding the
Linaro mailing list.
On 12.02.2012 09:46, Marek Vasut wrote:
>> On 11.02.2012 19:46, Fabio Estevam wrote:
>>> On Sat, Feb 11, 2012 at 5:12 AM, Marek Vasut<marek.vasut(a)gmail.com> wrote:
>>>> btw Fabio, do we support mx6q USB host in mainline Linux ?
>>>
>>> Not yet, Marek.
>>
>> Linaro has it working with
>>
>> http://git.linaro.org/gitweb?p=bsp/freescale/linux-linaro.git;a=commit;h=de
>> 941f9ac0b59c34053618e90e3c1f1d8b5a2d22
>>
>> http://git.linaro.org/gitweb?p=bsp/freescale/linux-linaro.git;a=commit;h=40
>> 26cfa27332f2e53cfbf72cc98cf4db8c2f2127
>>
>> It shouldn't be that hard to apply these to plain mainline Linux (?).
>
> Do you believe this will be accepted into mainline Linux if basically the same
> stuff, except for mx28 did NOT get accepted?
Do you have any pointers to the discussion about this? Hopefully we
could learn from that.
> The shape of the code was almost
> identical, maybe better. Actually, even the file names are the same here and in
> the old FSL BSP for mx28.
I think the good news is at least that Linaro is working on a more or
less recent kernel (atm 3.2). So, as mentioned above, porting it from
the Linaro kernel to the mainline kernel shouldn't be that hard. The
next step would be to clean them up, hopefully learning from the mx28
experience mentioned above.
What do you think?
Best regards
Dirk
IIUC, an idea behind clock_getres() is to give a hint about the resolution of
specified clock. This hint may be used by an application programmer to check whether
this clock is suitable for a some purpose. So why clock_getres() always returns
something like {0, 1} (if hrtimers are enabled) regardless of the underlying platform's
real numbers?
For example, OMAP4's real resolution of CLOCK_REALTIME is 30.5us for 32K timer and 26ns
for MPU timer. Such a difference definitely makes sense - but clock_getres(CLOCK_REALTIME,..)
always returns {0, KTIME_HIGH_RES}. Since this behavior causes a confusion like
http://lists.linaro.org/pipermail/linaro-dev/2012-February/010112.html, I'm considering
this as a stupid misfeature.
Dmitry
The LAVA server on validation.linaro.org is temporarily down. We are
working on the problem and will have it back up as soon as possible.
Thanks,
Paul Larson
Generalize CONFIG_IRQ_TIME_ACCOUNTING between X86 and
ARM, move "noirqtime=" option to common debugging code.
For a bit of backward compatibility, X86-specific option
"tsc=noirqtime" is preserved, but issues a warning.
Suggested-by: Yong Zhang <yong.zhang0(a)gmail.com>
Suggested-by: Russell King <rmk+kernel(a)arm.linux.org.uk>
Suggested-by: Venki Pallipadi <venki(a)google.com>
Signed-off-by: Dmitry Antipov <dmitry.antipov(a)linaro.org>
---
Documentation/kernel-parameters.txt | 9 +++++----
arch/arm/kernel/sched_clock.c | 2 ++
arch/x86/Kconfig | 11 -----------
arch/x86/kernel/tsc.c | 12 ++++++------
include/linux/sched.h | 17 ++++++++++-------
kernel/sched/core.c | 20 +++++++++++---------
lib/Kconfig.debug | 12 ++++++++++++
7 files changed, 46 insertions(+), 37 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 033d4e6..666d20e 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1790,6 +1790,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
noirqdebug [X86-32] Disables the code which attempts to detect and
disable unhandled interrupt sources.
+ noirqtime [X86,ARM] Used to run time disable IRQ_TIME_ACCOUNTING,
+ should give a negligible performance improvement.
+
no_timer_check [X86,APIC] Disables the code which tests for
broken timer IRQ sources.
@@ -2636,10 +2639,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
as the stability checks done at bootup. Used to enable
high-resolution timer mode on older hardware, and in
virtualized environment.
- [x86] noirqtime: Do not use TSC to do irq accounting.
- Used to run time disable IRQ_TIME_ACCOUNTING on any
- platforms where RDTSC is slow and this accounting
- can add overhead.
+ [x86] noirqtime: obsoleted by "noirqtime" generic option,
+ see it's documentation for details.
turbografx.map[2|3]= [HW,JOY]
TurboGraFX parallel port interface
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
index 5416c7c..30b5f89 100644
--- a/arch/arm/kernel/sched_clock.c
+++ b/arch/arm/kernel/sched_clock.c
@@ -144,6 +144,8 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
*/
cd.epoch_ns = 0;
+ enable_sched_clock_irqtime();
+
pr_debug("Registered %pF as sched_clock source\n", read);
}
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5bed94e..4759676 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -805,17 +805,6 @@ config SCHED_MC
making when dealing with multi-core CPU chips at a cost of slightly
increased overhead in some places. If unsure say N here.
-config IRQ_TIME_ACCOUNTING
- bool "Fine granularity task level IRQ time accounting"
- default n
- ---help---
- Select this option to enable fine granularity task irq time
- accounting. This is done by reading a timestamp on each
- transitions between softirq and hardirq state, so there can be a
- small performance impact.
-
- If in doubt, say N here.
-
source "kernel/Kconfig.preempt"
config X86_UP_APIC
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index a62c201..f1b2b63 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -103,14 +103,15 @@ int __init notsc_setup(char *str)
__setup("notsc", notsc_setup);
-static int no_sched_irq_time;
-
static int __init tsc_setup(char *str)
{
if (!strcmp(str, "reliable"))
tsc_clocksource_reliable = 1;
- if (!strncmp(str, "noirqtime", 9))
- no_sched_irq_time = 1;
+ if (!strncmp(str, "noirqtime", 9)) {
+ printk(KERN_WARNING "tsc: tsc=noirqtime is "
+ "obsolete, use noirqtime instead\n");
+ disable_sched_clock_irqtime();
+ }
return 1;
}
@@ -978,8 +979,7 @@ void __init tsc_init(void)
/* now allow native_sched_clock() to use rdtsc */
tsc_disabled = 0;
- if (!no_sched_irq_time)
- enable_sched_clock_irqtime();
+ enable_sched_clock_irqtime();
lpj = ((u64)tsc_khz * 1000);
do_div(lpj, HZ);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7d379a6..9b13f79 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1961,13 +1961,16 @@ extern void sched_clock_idle_wakeup_event(u64 delta_ns);
#endif
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
-/*
- * An i/f to runtime opt-in for irq time accounting based off of sched_clock.
- * The reason for this explicit opt-in is not to have perf penalty with
- * slow sched_clocks.
- */
-extern void enable_sched_clock_irqtime(void);
-extern void disable_sched_clock_irqtime(void);
+extern int sched_clock_irqtime;
+static inline void enable_sched_clock_irqtime(void)
+{
+ if (sched_clock_irqtime == -1)
+ sched_clock_irqtime = 1;
+}
+static inline void disable_sched_clock_irqtime(void)
+{
+ sched_clock_irqtime = 0;
+}
#else
static inline void enable_sched_clock_irqtime(void) {}
static inline void disable_sched_clock_irqtime(void) {}
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5255c9d..a7ec043 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -757,18 +757,20 @@ static DEFINE_PER_CPU(u64, cpu_hardirq_time);
static DEFINE_PER_CPU(u64, cpu_softirq_time);
static DEFINE_PER_CPU(u64, irq_start_time);
-static int sched_clock_irqtime;
-void enable_sched_clock_irqtime(void)
-{
- sched_clock_irqtime = 1;
-}
+/* -1 if not initialized, 0 if disabled with "noirqtime" kernel option
+ * or after unstable clock was detected, 1 if enabled and active.
+ */
+int sched_clock_irqtime = -1;
-void disable_sched_clock_irqtime(void)
+static int __init irqtime_setup(char *str)
{
sched_clock_irqtime = 0;
+ return 1;
}
+__setup("noirqtime", irqtime_setup);
+
#ifndef CONFIG_64BIT
static DEFINE_PER_CPU(seqcount_t, irq_time_seq);
@@ -822,7 +824,7 @@ void account_system_vtime(struct task_struct *curr)
s64 delta;
int cpu;
- if (!sched_clock_irqtime)
+ if (sched_clock_irqtime < 1)
return;
local_irq_save(flags);
@@ -2853,7 +2855,7 @@ void account_process_tick(struct task_struct *p, int user_tick)
cputime_t one_jiffy_scaled = cputime_to_scaled(cputime_one_jiffy);
struct rq *rq = this_rq();
- if (sched_clock_irqtime) {
+ if (sched_clock_irqtime > 0) {
irqtime_account_process_tick(p, user_tick, rq);
return;
}
@@ -2887,7 +2889,7 @@ void account_steal_ticks(unsigned long ticks)
void account_idle_ticks(unsigned long ticks)
{
- if (sched_clock_irqtime) {
+ if (sched_clock_irqtime > 0) {
irqtime_account_idle_ticks(ticks);
return;
}
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 8745ac7..236e814 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -299,6 +299,18 @@ config SCHEDSTATS
application, you can say N to avoid the very slight overhead
this adds.
+config IRQ_TIME_ACCOUNTING
+ bool "Fine granularity task level IRQ time accounting"
+ depends on X86 || ARM
+ default n
+ ---help---
+ Select this option to enable fine granularity task irq time
+ accounting. This is done by reading a timestamp on each
+ transitions between softirq and hardirq state, so there can be a
+ small performance impact.
+
+ If in doubt, say N here.
+
config TIMER_STATS
bool "Collect kernel timers statistics"
depends on DEBUG_KERNEL && PROC_FS
--
1.7.7.6
Greetings,
I'm experiencing what appears to be a minimum clock resolution issue in
using clock_gettime() on a PandaBoard ES running ubuntu.
*> uname -r*
3.1.1-8-linaro-lt-omap
*> cat /proc/version*
Linux version 3.1.1-8-linaro-lt-omap (buildd@diphda) (gcc version
4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) )
#8~lt~ci~20120118001257+025756-Ubuntu SMP PREEMPT Thu Jan 19 09:
I'm using clock_gettime() (and have tried gettimeofday()) to compute the
elapsed time around roughly 15ms of computation (image processing).
While the computed time is stable on my x86_64 machine, it is not on my
PandaBoard ES. I have tried various clocks (e.g. CLOCK_REALTIME), but
the issue remains. No error codes are returned by clock_gettime().
The result on my x86_64 machine looks like this:
*elapsed (s) elapsed (ns) elapsed (us) time
(after) time (before)*
0s 532260ns *532us* (t1: 73741s
92573265ns) (t0: 73741s 92041005ns)
0s 544413ns *544us* (t1: 73741s
109390136ns) (t0: 73741s 108845723ns)
0s 529328ns *529us* (t1: 73741s
126024860ns) (t0: 73741s 125495532ns)
A: 1.7s in total. *0.536ms* on average.
If I move over to my PandaBoard ES, I calculate elapsed times of 0us on
some iterations.
*elapsed (s) elapsed (ns) elapsed (us) time
(after) time (before)*
0s 0ns *0us* (t1: 269529s
192626951ns) (t0: 269529s 192626951ns)
0s 0ns *0us* (t1: 269529s 215606688ns)
(t0: 269529s 215606688ns)
0s 2655030ns *2655us* (t1: 269529s 252349852ns) (t0:
269529s 249694822ns)
0s 2593994ns *2593us* (t1: 269529s 286163328ns) (t0:
269529s 283569334ns)
0s 30518ns *30us* (t1: 269529s 317657469ns) (t0:
269529s 317626951ns)
If I crank up the amount of work done between the time calls
(timetest.c:18: inneriters = 1e7;) such that the timed loop takes around
72ms, the timing results seem accurate and none of the intermediate
calculations result in a 0us elapsed time. If I reduce it to around
10-25ms (inneriters=1e6), I get occasional 0us elapsed times. Around 2ms
(inneriters=1e5), most results measure an elapsed time of 0us.
I'm trying to optimize image processing functions, which take on the
order of 2-15ms to process. Am I stuck with this timing resolution? I
want to be careful to not omit issues like cache performance when
timing, as I might if I repeatedly process an image to average the
results. Currently, that seems like the best option.
Source code and makefile attached, as well as /proc/timer_list
Is this a property of the hardware, or might it be a bug?
Thanks,
Andrew
Hi,
I have encountered a failure running live-build that I could use
some help debugging.
Using the instructions in the LiveBuild wiki page:
https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/LiveBuild
the procedure fails during the adduser step. The failure is:
I: create linaro user
Can't set $0 with prctl(): Bad address at /usr/sbin/adduser line 86.
Here is the perl code around line 86 in adduser:
----
my %config; # configuration hash
my @defaults = ("/etc/adduser.conf");
my $nogroup_id = getgrnam("nogroup") || 65534;
$0 =~ s+.*/++; <<<<<<<<< Line 86 >>>>>>>>>>>
----
This is the call to adduser from the 01-setup_user_linaro.chroot
script that causes the problem:
adduser --gecos linaro --disabled-login linaro
The funny thing about this failure, if I chroot into the build
area and run that command manually, everything works fine.
1st, what is that perl command doing?
2nd, anybody have any ideas on what would cause this failure?
TIA,
Matt
Hi,
we've added a new session to Connect - tomorrow at 11:
What Android and Embedded Linux can learn from each other.
This is a preview (and fix-it-up session ;) ) for the talk I'm going
to give at ELC - the basic premise is:
Android and "normal" Embedded Linux are often seen as completely
different projects with different communities - merely sharing a
common kernel. However, there are many things the two projects can
learn from each other, and there's lots of useful code from the "other
side" that members of "one side" typically aren't aware of - or never
thought of using in their environment. This session will identify
useful code from both sides that can be useful to the "other side" -
in the hopes of moving both the projects and the communities a bit
closer together.
https://blueprints.launchpad.net/linaro-android/+spec/linaro-platforms-q112…
It would be nice to have some attendants from "both sides".
ttyl
bero