Re: How how latent should non-preemptive scheduling be?

From: Ingo Molnar
Date: Mon Sep 29 2008 - 04:37:38 EST



* Sitsofe Wheeler <sitsofe@xxxxxxxxx> wrote:

> Ingo Molnar wrote:
>> does it get better if you have CONFIG_PREEMPT_VOLUNTARY=y enabled? That
>>
>
> CONFIG_PREEMPT_VOLUNTARY=y has always been enabled in these results.

okay - then this definitely needs fixed.

>> _should_ break up this section neatly. If it doesnt then please add a
>> might_sleep() check to kernel/kernel/semaphore.c's down_timeout()
>> function - that is called a number of times in this trace.
>
> I added might_sleep() to the start of down_timeout() but it neither
> printed anything to dmesg nor changed the latency issue...
>
> Strangely stalling only seems to turn up in linux-tip kernels with
> very little debugging options set within them. I have a linux-tip that
> has lots of extra debugging options set and this problem doesn't show
> up...
>
> I've also asked about this on the ACPI mailing list and had a huge
> amount of help from finding a good point for a cond_resched -
> http://marc.info/?l=linux-acpi&m=122236450105747&w=2 . Certain things
> (like games) still stutter when the battery is read but it's enough to
> play back sound in rhythmbox without stuttering.
>
> Any ideas why the issue would go away with a debug kernel though?

hm, that's weird indeed. You could try to trace the full battery readout
itself, via a script like this:

cat /debug/tracing/trace > /dev/null # drain trace
cat /proc/acpi/whatever
cat /debug/tracing/trace > trace.txt

this way you should be seeing a full trace of the whole thing. (with the
'ftrace' tracer plugin set in current_tracer)

then, assuming the trace.txt is complete, you can check where it
reschedules and why. Search for 'schedule' calls. Compare the debug
versus non-debug traces.

You can even turn on stack backtrace tracing feature, via:

echo stacktrace > /debug/tracing/iter_ctrl

this adds extra trace entries that show the call path of every
reschedule. [this attribute is default-disabled.]

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/