pthread realtime scheduling with SCHED_FIFO and SCHED_OTHER

by Daniel » Thu, 30 Jul 2009 11:48:16 GMT


Sponsored Links
 ello,
I observed some strange behaviour with scheduling realtime pthreads on
Linux (2.6.26, Android 1.5).

In the first scenario we have a process that contains only one
realtime thread (SCHED_FIFO) with priority 99 and no more other
threads.
This thread has to run every 5737 microseconds and do something (runs
just a few microseconds). This scenario works perfectly even under
really high load.

Then, in the second scenario, we used the code from the first scenario
and put it into another process that also contains some other threads.
These threads are no realtime threads and there is currently no
synchronization between the realtime thread and the others. Now, the
strange thing is that the realtime thread occasionally misses some
deadline and is scheduled only after 20 milliseconds or more.

I don't have any explanation for this. Any ideas why this isn't
working and how to fix it?
We do not use group scheduling.

Above is our kernel configuration.

Best regards,
Daniel

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.26
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
# CONFIG_GENERIC_GPIO is not set
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_MMU=y
# CONFIG_NO_IOPORT is not set
CONFIG_GENERIC_HARDIRQS=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_SUPPORTS_AOUT=y
CONFIG_ZONE_DMA=y
CONFIG_ARCH_MTD_XIP=y
CONFIG_OPROFILE_ARMV6=y
CONFIG_OPROFILE_ARM11_CORE=y
CONFIG_VECTORS_BASE=0xffff0000
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_AUDIT is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_CGROUPS is not set
# CONFIG_GROUP_SCHED is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
# CONFIG_RELAY is not set
# CONFIG_NAMESPACES is not set
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_PANIC_TIMEOUT=0
CONFIG_EMBEDDED=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_SYSCTL_SYSCALL_CHECK=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_COMPAT_BRK=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_ASHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
# CONFIG_MARKERS is not set
CONFIG_OPROFILE=y
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
# CONFIG_HAVE_DMA_ATTRS is not set
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE



pthread realtime scheduling with SCHED_FIFO and SCHED_OTHER

by ruckuus » Sun, 02 Aug 2009 19:35:01 GMT


 i Daniel,

On Jul 30, 6:47pm, Daniel <daniel.himmel...@googlemail.com> wrote:

You might want to hook up on arm-linux-kernel mail-list for this.
IMHO, this is not android specific issue.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


Other Threads

1. Why is the market listing my app as exactly twice the size of the APK I uploaded?

copy-protection doubles the amount of size needed to store the app on
the device indeed.

JBQ






-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Please don't contact me directly.

--~--~---------~--~----~------------~-------~--~----~

2. Long click on Button

Hi!

I want, that when the user clicks on a button, a textfield with a
number will increase or decrease. But this should be work in a way,
that the user leaves the finger on the button and the number increases
automatically. Therefore he doesnt have to click lot of times.

I have not found any method to override that could implement such
behaviour!
Does anybody know how to implement this?

Thanks Manfred!

--~--~---------~--~----~------------~-------~--~----~

3. Why is the market listing my app as exactly twice the size of the APK I uploaded?

4. Emulator: clearing apps out of cache

5. When do I need a new Activity?

6. Android presentation backgrounds

7. Fwd: Emualator fails at Boot up