Bug 478514

Summary: CONFIG_HZ=1000 and PREEMPT enabled would be preffered for desktop kernels
Product: [openSUSE] openSUSE 11.1 Reporter: Stefan Sauer <ensonic>
Component: KernelAssignee: E-mail List <kernel-maintainers>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None CC: chrubis, forgotten_b49zM5D78q, georgmueller, kontakt
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Stefan Sauer 2009-02-22 19:48:25 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.6) Gecko/20080528 Epiphany/2.22 Firefox/3.0

Various applications like multimedia or profilers would benefit from a higher timer resolution. Instead of
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250

this would be much nicer:

# CONFIG_HZ_100 is not set
# CONFIG_HZ_250  is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000


Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Stefan Sauer 2009-02-22 20:03:23 UTC
Please also consider to enable: CONFIG_PREEMPT and CONFIG_PREEMPT_VOLUNTARY

CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set

http://kernel.xc.net/html/linux-2.6.23/i386/PREEMPT
http://kernel.xc.net/html/linux-2.6.23/i386/PREEMPT_VOLUNTARY
Comment 2 Jakub Rusinek 2009-02-24 14:28:58 UTC
Example explanation: https://tango.0pointer.de/pipermail/pulseaudio-discuss/2009-February/003150.html
Comment 3 Greg Kroah-Hartman 2009-02-26 16:07:54 UTC
Because we share this kernel with servers, we can't change the HZ, it would dramatically decrease our throughput on those workloads.

As for any seen latencies, please let us know where they are and we will be glad to work to resolve them.  You can try using the latencytop tool to locate them.
Comment 4 Georg Müller 2009-02-26 16:37:40 UTC
This is related to bug 461361.

For future releases, would it be possible to have a desktop kernel and a server kernel?
Can PREEMPT help here without changing the HZ?
Comment 5 Greg Kroah-Hartman 2009-02-26 16:46:07 UTC
(In reply to comment #4)
> This is related to bug 461361.
> 
> For future releases, would it be possible to have a desktop kernel and a server
> kernel?

We are taking it under consideration, but in reality, it's better to just fix the latency issues in the specific portions of the kernel that have it than to have two separate kernels.

> Can PREEMPT help here without changing the HZ?

Not much.

Again, if you can help find the places where there is latency, we can fix them.  Try using latencytop, that is what it is for.
Comment 6 Stefan Sauer 2009-02-26 20:05:16 UTC
Having separate kernels seems to be a practise followed by different distros. The issue for me is audio. PulseAudio does not work reliably in glich-free mode - latency is way too high. Also the jack audio server is barely useable for me on 11.1. Interestingly jack worked reasonable on 11.0.

I am playing with latencytop right now, but I have to figure yet how to interpret the values. This is shown in the upper part:
Cause                                                Maximum     Percentage
ATA/SCSI disk ioctl                                77.2 msec          1.9 %
Scheduler: waiting for cpu                         66.6 msec         28.4 %
Executing raw SCSI command                         21.7 msec         26.7 %
Writing buffer to disk (synchronous)               20.0 msec          0.3 %
opening cdrom device                                6.4 msec          5.6 %
Waiting for event (select)                          5.0 msec         16.3 %
Waiting for event (poll)                            5.0 msec         16.8 %
SCSI cdrom ioctl                                    4.1 msec          1.2 %
Userspace lock contention                           4.1 msec          2.0 %

In the lower part I get no listing for pulseaudio or jack. Dunno if they need to be running for a while. For X I get e.g. this:
Process X (5105)                           Total: 503.9 msec                                                                                                               
Scheduler: waiting for cpu                          5.3 msec         79.8 %
Waiting for event (select)                          4.9 msec         20.2 %
Comment 7 Jakub Rusinek 2009-02-26 20:22:35 UTC
I filed bug 480020 about latency.

The output of latencytop was:

Cause                                                Maximum     Percentage
fsync() on a file                                 110.7 msec          0.5 %
Scheduler: waiting for cpu                         81.1 msec         45.6 %
Writing a page to disk                             14.6 msec          0.1 %
opening cdrom device                               10.0 msec          0.2 %
Executing raw SCSI command                          5.4 msec          0.2 %
Waiting for event (poll)                            5.0 msec         15.7 %
Waiting for event (select)                          5.0 msec          7.7 %
Userspace lock contention                           5.0 msec         30.0 %
Waiting for event (epoll)                           4.0 msec          0.1 %


Process pulseaudio (2998)                  Total: 3586.0 msec                   
Scheduler: waiting for cpu                         81.1 msec         99.1 %
Waiting for event (poll)                            4.8 msec          0.9 %
Userspace lock contention                           0.1 msec          0.0 %