Talk:RT Kernel Instructions

From openSUSE

PAM build fix: kiss realtime-lsm goodbye :)

Hi,

Today I've tried to (re)build and install Linux-PAM packages on my opensuse 10.0 box, and got it to work around the missing resource limit definitions, namely "rtprio" and "nice".

It all means that I can now get rid of the realtime-lsm and start jackd in realtime mode, even under the opensuse 10.0 stock kernel (2.6.13). It all suffices to rebuild the pam, pam-devel and possibly also pam-modules packages, which I taken borrowed from the publicly available SRPMS.

Its all seems to be due one ridiculous line, as the one shown in the following patch to Linux-PAM source tree:

--- modules/pam_limits/pam_limits.c.orig	2005-07-06 09:05:32.000000000 +0100
+++ modules/pam_limits/pam_limits.c	2006-03-05 12:37:56.000000000 +0000
@@ -30,6 +30,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/resource.h>
+#include <asm/resource.h>
 #include <limits.h>
 
 #include <utmp.h>

I have my custom RPMS here:

pam-0.80-8.suse100.rncbc.i586.rpm
pam-devel-0.80-8.suse100.rncbc.i586.rpm

and also the SRPM:

pam-0.80-8.suse100.rncbc.src.rpm

Ah, of course, you also have to edit your /etc/security/limits.conf configuration file accordingly. Mine looks like follows:

# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - an user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open files
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4

@audio          -       rtprio          90
@audio          -       nice            -10
@audio          -       memlock         4000000

# End of file

Enjoy.

-- rncbc aka Rui Nuno Capela


RTIRQ init script

Hi again,

I though you would like to know about this (rtirq) script which I'm using since the (Ingo Molnar's) realtime-preempt kernel patch inception, quite handy, happily and steady. My own authorship ;) fully automated and ready as an LSB init script. I guess it will be a nobrainer on other distros too. It is known to work on SUSE 10.0, Mandriva 2006.0 and the awesome PlanetCCRMA (Fedora core 4). I hope it could be part of the jacklab premises too. You tell me ;)

The main purpose is all about fixing the IRQ thread RT priorities (SCHED_FIFO) in some configurable but generic order (no magic hardwired numbers:).

Just check the installed configuration on /etc/sysconfig/rtirq, and edit if you see fit. The default priority order goes as follows:

 99 - softirq-timer/s
 90 - rtc - real-time clock (usually IRQ 8 )
 80 - snd - ALSA PCI sound modules (usually IRQ 5, 17 and/or 22 ...)
 70 - usb - USB host controllers (usually IRQ 10, 16, 18, 19 and/or 23 ...)
 60 - i8042 - keyboard/ps2-mouse controllers (usually IRQ 1 and/or 12 ...)

This setup has proven to be quite stable and reliable, as long as jackd -R runs with few or no xruns, near very low-latency (e.g. -p64) for most general and practical audio setups. It works for me, either on PCI or USB audio interfaces.

The main script /etc/init.d/rtirq should be LSB compliant, or so I assume. Feel free to use it. Feedback highly appreciated.

As an example, on my P4@3.3GHz/HT SUSE 10.0 OSS, custom kernel (2.6.15.5-rt16.0-smp) I get the following IRQ threading status, once rtirq is started:

# /etc/init.d/rtirq status

  PID CLS RTPRIO  NI PRI %CPU STAT COMMAND
    4 FF      99   - 139  0.0 S    softirq-timer/0
   14 FF      99   - 139  0.0 S    softirq-timer/1
  670 FF      90   - 130  0.0 S<   IRQ 8        rtc
 2902 FF      80   - 120  0.0 S<   IRQ 209      Intel ICH5
 2965 FF      79   - 119  0.0 S<   IRQ 225      CS46XX
 2901 FF      78   - 118  0.0 S<   IRQ 201      ICE1712, SysKonnect SK-98xx
 2532 FF      70   - 110  0.0 S<   IRQ 177      ehci_hcd:usb1
 2716 FF      70   - 110  0.0 S<   IRQ 169      uhci_hcd:usb4
 2585 FF      69   - 109  0.0 S<   IRQ 185      uhci_hcd:usb2
 2665 FF      68   - 108  0.3 S<   IRQ 193      uhci_hcd:usb3
  728 FF      60   - 100  0.0 S<   IRQ 1        i8042
  678 FF      59   -  99  0.0 S<   IRQ 12       i8042
   39 FF      49   -  89  0.0 S<   IRQ 9        acpi
  695 FF      46   -  86  0.0 S<   IRQ 6
  807 FF      44   -  84  0.0 S<   IRQ 14       ide0
  900 FF      43   -  83  0.0 S<   IRQ 15       ide1
 1462 FF      42   -  82  0.0 S<   IRQ 4
 2960 FF      35   -  75  0.0 S<   IRQ 217      ohci1394
    3 FF       1   -  41  0.0 S    softirq-high/0
    5 FF       1   -  41  0.0 S    softirq-net-tx/
    6 FF       1   -  41  0.0 S    softirq-net-rx/
    7 FF       1   -  41  0.0 S    softirq-scsi/0
    8 FF       1   -  41  0.0 S    softirq-tasklet
    9 FF       1   -  41  0.0 S    softirq-hrtimer
   13 FF       1   -  41  0.0 S    softirq-high/1
   15 FF       1   -  41  0.0 S    softirq-net-tx/
   16 FF       1   -  41  0.0 S    softirq-net-rx/
   17 FF       1   -  41  0.0 S    softirq-scsi/1
   18 FF       1   -  41  0.0 S    softirq-tasklet
   19 FF       1   -  41  0.0 S    softirq-hrtimer

My own RPM is here:

rtirq-20060218-13.noarch.rpm

SRPM follows:

rtirq-20060218-13.src.rpm

Enjoy.

-- rncbc aka Rui Nuno Capela