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. Set Android application dependency from custom Java library



Hi,

first you need a Eclipse project for the library and you have to
advice Eclipse to generate on each modification a jar for the custom
library. For that you need a little ant script which look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!--
======================================================================
 
======================================================================
-->
<project name="project" default="default" basedir=".">
    <description>
            description
    </description>

    <!-- =================================
          target: default
         ================================= -->
    <target name="default" depends="depends"
description="description">

        <jar destfile="YourCustomLib.jar">
            <fileset dir="bin" includes="**/*.class" />
            <fileset dir="src" includes="**/*.java" />
        </jar>
    </target>

    <!-- - - - - - - - - - - - - - - - - -
          target: depends
         - - - - - - - - - - - - - - - - - -->
    <target name="depends">
    </target>

</project>

Name that ant script e.g. build.xml and put this file somewehre into
the project directory.  Under "Project Properties/Builders" make a new
Ant Builder and put them at the end of the builder list (if there are
any). Use as build file the mentioned build.xml.

Next you can add the YourCustomLib.jar to your Android project with
"Configure Build Path/Library/Add Jar". With this Eclipse checks
automatically whether the Android .pkg hat to be rebuild based on
library changes.

That's it.

regards

spachner

-- 

2. Android Application which use framebuffer

Hi,

      I need a Android application that uses the framebuffer only and
displays something on it.
Could anyone please guide me to use it or if there already any
application which displays on the framebuffer , please give me a link
to it. I am desperately in need of such an application. Any sort of
application will do

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Virtual Keyboard

4. Do You Have Obsessive-ROM Updating Disorder (ORD)?

5. Incorrect documentation for Xml Attributes (onclick, padding, etc), all API Levels?

6. HELP goldcard magic

7. Connect two emulator instances through the network