Linux: Interactivity Improvements Backported

Submitted by Jeremy
on April 9, 2003 - 9:12pm

By popular request, Con Kolivas [interview] has backported Ingo Molnar's [interview] earlier interactivity improvements [story] to the 2.4.20 stable kernel. The interactivity patch was first added as an enhancment to Con's desktop oriented patchset [story] in 2.4.20-ck4. I immediately downloaded the patch myself and gave it a try, disappointed to discover it was less responsive than Con's plain -ck4 patchset. By switching tab views in GnuCash I could consistently skip music that was playing with XMMS, something I've rarely experienced since I started using Con's patchset back in September. The only improvement I noticed was that the system responded very well when performing the less-than-scientific "wiggle test" (grab a window and wiggle it around on the screen quickly).

Fortunately, 48 hours later Con has released 2.4.20-ck5, adding a host of improvements. I quickly compiled a new kernel with his -ck5 patch and Rik van Riel's [interview] rmap15e VM applied, and then booted into an improved desktop experience. I tried really, really hard to get XMMS to skip again on my aging PIII 550, but try as I might, it refused. And the system continued to respond well when performing the wiggle test. Con describes the desktop tuning changes he made:

"It became clear that even with the interactivity changes audio skipping could occur so I've added some more desktop tuning to this version far less drastic than the previous kernels. The desktop tuning patch just changes a few of the default settings and these are all able to be modified at config or after boot if so desired."

Con goes on to list the three options that he modified. In -ck5, the Hz is set to 500, the minimum timeslice is set to 2ms, and the maximum timeslice is set to 40ms. Find Con's latest patchset on his kernel patch homepage. The newly added FAQ offers more information.


From: Con Kolivas
To: linux kernel mailing list
Subject: Interactivity backport to 2.4.20-ck*
Date: Mon, 7 Apr 2003 23:53:38 +1000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've had numerous requests for a backport of the interactivity changes to the 
O(1) scheduler for the -ck* kernels. I have resisted posting my backport 
because people had described real problems with these patches. However it 
seems most, if not all of the problems are related to one patch. 

I've posted a special split out patch 
(001_o1_int_pe_ll_030407_ck_2.4.20.patch) for ck that includes the new 
interactivity changes, with the one patch responsible for problems backed 
out. No desktop tuning patch is supposed to be necessary for this so I've 
removed it from the site.Note that the full -ck4 patch does not include this 
update. I would like some feedback from people using it before I make a more 
substantial update to bring out a -ck5. The patches must be applied manually 
in order as they're desired. I've been using them for a little while without 
any problems. 

Get them here:

http://kernel.kolivas.org

Con
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+kYLlF6dfvkL3i1gRAk4+AKClVUe0bhxJKSM5rls1zEfNE9TymQCglChA
xheK/JrNmZUnpm14LhgKMeQ=
=/Vun
-----END PGP SIGNATURE-----


From: Con Kolivas To: linux kernel mailing list Subject: 2.4.20-ck5 Date: Thu, 10 Apr 2003 00:50:40 +1000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've posted an update to my patchset: http://kernel.kolivas.org O(1) scheduler Interactivity backport Preempt Low Latency AA VM Read Latency2 Supermount XFS 1.2 ACPI CD/DVD Packet Writing Variable HZ Scheduler Tunables Desktop Tuning +/- Rmap15e Significant updates: The interactivity changes to the O(1) scheduler by Mingo have been incorporated. Supermount has had a minor touch up to remove annoying warnings on shutdown. XFS has been updated to the latest snapshot. Hz may be set at config time again Scheduler tunables has been backported from 2.5 Rmap has been updated to 15e It became clear that even with the interactivity changes audio skipping could occur so I've added some more desktop tuning to this version far less drastic than the previous kernels. The desktop tuning patch just changes a few of the default settings and these are all able to be modified at config or after boot if so desired. The options chosen were: Hz set to 500 Min timeslice set to 2ms Max Timeslice set to 40ms A FAQ on NOT renicing X with this kernel has been added to my homepage. Please feel free to send me comments, queries, suggestions, bug reports, patches etc. Enjoy! Con -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+lDNAF6dfvkL3i1gRAqVSAJ4v6YMFE4OH0hN/EeOM5xssu7JrqwCglp3t DXDZ8zNH90jxivl7I4nKee8= =TZkg -----END PGP SIGNATURE-----

Related Links:

Packet-writing?

Anonymous
on
April 9, 2003 - 11:56pm

I noticed that he includes the packet-writing pathes to his kernel. How dows that work exactly? To my knowledge, packet-writing means that you can copy files to the CD like you would copy to any other directory (by using your favourite filemanager). Does it really work?

I know packet-writing is planned to be included on the 2.5-kernel, any news regarding that?

Testing needed

Con Kolivas
on
April 10, 2003 - 12:10am

Packet writing should allow you to write on the fly to a cdrw/dvdrw like a big floppy. To date noone has volunteered to test this functionality for me, even though I had people requesting it. Here's a page with info:

http://w1.894.telia.com/~u89404340/

If you do try it, please report back to me :-)

Have to think about that ;)

Anonymous
on
April 10, 2003 - 12:46am

But right now I'm too busy with my final thesis to test & troubleshoot kernel-features :(. But I'll give it a shot once that's finished.

Re: Interactivity

Anonymous
on
April 12, 2003 - 9:04pm

For me, the biggest improvement I've noticed lately was when I tried out the -mm kernels. They made an immediate, noticable difference. I'm impressed, I wasn't expecting very much at all.

Now I'm curious to try it on an older smaller system I've got (p233mmx) to see if it's present there too. Anyone care to comment on improvements with older & slower systems? (I've got an online friend with an aging p166mmx and am sad to report that he found using KDE3 unbearably slow :( )

interactivity bonus - latency

Anonymous
on
April 10, 2003 - 5:19am

I use Con's incremental ck5-patches.
How fast does the (interactive) father of a interactive child gain interactivity?
to me it feels like it can take a while. I made some window-whiggling tests (with kernel-compile), and at first it wasn't much better than before (it "feeled" even worse a bit) , but after a while of whiggling xmms started to play smooth, und the mouse movement got smoother too.
After that while, I couldn't make xmms stutter anymore, it runs smooth now until eternity.
Is it just a feeling, or could it be that it takes a while until the bonus is shared to the father?

Balancing delay

Con Kolivas
on
April 10, 2003 - 5:33am

Good observation. What you describe is exactly what happens. I guess it has to avoid overshoot so it must be a damped response. I don't know what the time constant is for the bonus to be distributed, but there is no doubt that that it is well within human perception range.

Re: Balancing delay

Cuboci
on
April 10, 2003 - 6:35am

I've experienced the same behaviour. Looks like it can be up to a few seconds. Otherwise -ck5 works perfectly :)

ext3 fixes for 2.4.20 and ck5

Anonymous
on
April 10, 2003 - 10:04am

I've been using 2.4.20-ck4 with the ext3 patches applied:
http://www.zip.com.au/~akpm/linux/ext3/
The problem was that they failed to patch 2.4.20-ck4, I had to fix manually some lines... I'm not an kernel hacker so I was a bit worried, but in the end it compiled and worked OK, the machine and the FS is stable. But -ck5 looks much more tough to patch with the ext3 fixes.
Has anybody the same problem? The ext3 fixes page says "These fix fairly serious problems, and they should be applied." so not using them seems a bit risky... A kind soul with some free time and more kernel experience than me could merge the two patch sets, please :)

apply the ext3 patches first

flugstadp
on
April 10, 2003 - 1:39pm

Okay, this is the first time I've seen the ext3 patches.
They certainly look like something that should go in.
Anyone know if they are going to be in 2.4.21?

I got them to work with CK5 by applying the ext3 patches to
stock 2.4.20 FIRST, then applying CK5. I had to fix just one
problem in CK5, but it was quite trivial (I'm not quite sure
why patch had a problem with it). Everything else in CK5
went in just fine (with a little fuzz here or there, nothing
more than 2 lines).

I'm building now, so we'll see how this works....

nVidia? ALSA?

florin
on
April 10, 2003 - 11:10am

How does it work with the latest nVidia driver?
Any known issues with nForce?
How about ALSA?

The drivers for nVidia works

Anonymous
on
April 10, 2003 - 11:42am

The drivers for nVidia works great with 2.4.20-ck5 - it complaines about not knowing the headers of the kernel etc, just ignore.

Latest is 1.0-4349 - automated installation and everything ;)

ALSA & Nvidia work

Con Kolivas
on
April 10, 2003 - 6:30pm

ALSA works fine - I use it on all of my boxen.

NVIDIA also works fine, I use it on one of my boxes (shame on me).

Not sure about rmap and the new NVIDIA driver. The old nvidia driver wouldn't work without a small patch to it.

ive been running -ck5+rmap wi

Anonymous
on
April 10, 2003 - 8:54pm

ive been running -ck5+rmap with Hz is set to 750, ive noticed cpu load problems, during playing a file using mplayer, it often stutters (considering 2.4.20+rmap doesnt do it), or using winex to play a game the samething happens, cpu max's out...causes the game to stutter for a brief second, and returns to normal (and it reoccurs every so often).

This with preemtive on, lowlatency on..

Decrease the Hz

Con Kolivas
on
April 10, 2003 - 10:18pm

Increasing the Hz increases the system overhead. I only chose 500 to have adequate difference in priority timeslices between lowest and highest priority. A lower Hz setting consumes less resources and about 200 is probably better if you're not interested in finely grained timeslice differences in priorities.

Same here

Anonymous
on
April 11, 2003 - 5:52am

I have this with 2.5.65 and above, so something in the interactivity patch really messed things up since 2.5.64 and below have zero stutter during heavy load situations (compile in background, movie playing and browsing, no problems), while 2.5.65+ makes the movie stutter if I just open a gnome-terminal or something.

Any ideas? I run 2.5.67-mm1 atm, but I've tried pretty much every version since .64 and all have same problem and I'd love to know what and possible if it can be backed out or perhaps some patch to take care of it.

Sound server?

Con Kolivas
on
April 11, 2003 - 6:30am

I think the enlightened sound daemon and the interactivity patch don't like each other very much from reports. If you're using that, I've had reports of it getting better with a reniced esd. No I don't think this is ideal, but despite all the hype, the interactivity patch fixes some things and can affect others. A lot of things have been tuned in the past around the stable kernel scheduler. If you're not interested in carefully finegrained timeslices then changing the max timeslice and the min timeslice to 10ms can help a lot. Note the scheduler tunable /proc/sys/sched/max_timeslice is in number of jiffies, and a Hz of 500 means they are 2ms each.

seemingly better performance using a timing of 150HZ than 500HZ

Anonymous
on
April 15, 2003 - 8:17pm

I am using the ck6 patchset and my impression is a timing of 150HZ is a lot snappier than 500HZ especially under load. Why?

Higher HZ == More Overhead

Con Kolivas
on
April 16, 2003 - 4:28am

The system overhead increases as you increase the Hz. Increasing the Hz does not necessarily "speed up" the machine. As the load increases, the proportion of time spent doing interrupt related work increases and the cpu time left to do other stuff decreases. Therefore a lower Hz "speeds up" the machine, but may introduce small latencies. The default in ck6 is 200Hz to minimise the latencies without a massive increase in overhead. The reason I recommend setting the Hz according to the cpu speed is because the cpu has to be fast enough to service more Hz without detriment to the system.

ck5 sucks

Con Kolivas
on
April 11, 2003 - 8:15pm

Ok the feedback I've gotten is that the interactivity patch looks good on paper but performs worse in more settings :-(. I've updated the split out patches on my web site and they no longer include this patch. Stay tuned for ck6 :-)

Oh yeah and rmap15f is available now.

reiserfs question

Anonymous
on
April 11, 2003 - 11:10pm

Con,

On your site you mention you prefer reiserfs over ext3, et al because it gives you better responsiveness. I was just curious how you were mounting your reierfs partitions. Are you using noatime or notail?

Notail

Con Kolivas
on
April 11, 2003 - 11:13pm

I personally mount them all notail. Space is hardly an issue these days.

re: ck5 sucks

Jeremy
on
April 12, 2003 - 9:02am

Interesting... I've not been using my computer much the past few days, but when I have used it I've found -ck5 to feel great...

So it goes.

ext3 fixes for 2.4.20

Anonymous
on
April 12, 2003 - 12:03pm

they look pretty needed for 2.4.20. i've been using them with 2.4.20-ck4 since it came out, and the system is rock solid. any chances for including them for us lowly ext3-using creatures? :)

http://www.zip.com.au/~akpm/linux/ext3/

cool!

Anonymous
on
April 12, 2003 - 7:27am

thank very much for the patch-set Con!

ever sence 2.4.18 the music whould sometimes under heavy read and write to disk stop playing until the writes/reads have not stopped, i tryed the development kernels but sence version 2.5.62 the soundblaster driver whouldnt compile, so it was useless, but it solved my problem, even with read/writes of various services it didnt jump or (that with less 2.5.62)
i had to hack the sounddriver a litle bit to get it working with 2.5.67, and it was fine too but the powrvr(kyro2 driver whoudlnt compile coz of the module system changes..) i didnt bother to try to fix it, then i found your patchset, the sound skips a bit as someone else mentioned when it first starts playing, other than that it works like a rocket :)

i wonder if there is anyone else having problems with the soundblaster awe64 driver?

Crashes

Anonymous
on
April 12, 2003 - 4:34pm

I don't get it...this patchset works fine for everyone, but my system with Slackware 9.0 which has XFree86 4.3.0, 2.4.20-ck{4,5} kernels, and _any_ nvidia proprietary driver, makes my system misbehave when exiting X/switching to console! And I've tried normal console, VESA framebuffer console, and RivaFB console...they all crash! Anyone else experiencing this? This never happened to me before :\

Thanx

Well

Anonymous
on
April 13, 2003 - 6:24pm

Unfortunately I don't think you'll get any response from the kernel devs due to use the the nVidia binary module.

Doesn't nVidia have a mailing list that can be tried? The problem is that I haven't heard anyone else experiencing your problem...

Re: Crashes

Anonymous
on
April 20, 2003 - 10:01am

Does it do the same thing if you use the nv driver instead of the nvidia driver? (that is, use XFree86's driver instead of NVidia's driver).

Preempt broken in -ck*?

Anonymous
on
April 13, 2003 - 3:19pm

I noticed this line of code was missing from in kernel/exit.c that appears in RML's preemptible patch. When I put the following code in exit.c, *everything* exits with a preempt count of 1, meaning preempt was disabled somewhere and not reenabled.

This is using 001_o1_pe_ll_030412_ck_2.4.20.patch only

from kernel/exit.c

tsk->flags |= PF_EXITING;
del_timer_sync(&tsk->real_timer);

+ if (unlikely(preempt_get_count()))
+ printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
+ current->comm, current->pid,
+ preempt_get_count());
+
fake_volatile:
#ifdef CONFIG_BSD_PROCESS_ACCT
acct_process(code);

Preempt broken?

Anonymous
on
April 13, 2003 - 3:23pm

I put this line back into the 001_o1_pe_ll_030412_ck_2.4.20 patch and *everything* exited with a preempt count of 1. I think this means preempt is disabled while the process was running, since I don't get it with RML's preempt patch for 2.4.20 only.


tsk->flags |= PF_EXITING;
del_timer_sync(&tsk->real_timer);

+ if (unlikely(preempt_get_count()))
+ printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
+ current->comm, current->pid,
+ preempt_get_count());
+
fake_volatile:
#ifdef CONFIG_BSD_PROCESS_ACCT
acct_process(code);

oops, first post didn't show

Anonymous
on
April 13, 2003 - 3:25pm

oops, first post didn't show up :(

Different preempt patch

Con Kolivas
on
April 16, 2003 - 4:30am

This is based on a completely different preempt patchset not for an O(1) scheduler so is not a relevant part of mine. Try disabling preempt on my patchset and see for yourself.

preempt cause kernel panic aiee on nforce2

Anonymous
on
April 15, 2003 - 3:42am

i compiled and boot my system using ck4 with preempt enable and the result was kernel panic aiee, after disabling preempt, everything work just great

Me too :(

Anonymous (not verified)
on
December 16, 2005 - 2:30pm

Have rarely had a kernel panic, but:

- Nvidia Drivers 1.0-8174 w/ agpgart
- nForce chipset
- Pre-empt
- 2.6.14-ck6

Definitely causes problems.

Will try disabling pre-empt, to see if it helps...

ck6 + NVIDIA 43.49 = 4300s fps w/ ti4800SE

Anonymous
on
April 15, 2003 - 7:29am

using ck6, the fps drop down from 4700s to 4300s, is it normal?

probably due to the higher Hz

Anonymous
on
April 15, 2003 - 10:56am

probably due to the higher Hz. See the post above about how to adjust Hz.

Interactivity changes in -ck6?

Cuboci
on
April 15, 2003 - 8:34am

Con,

are the interactivity changes still backed out or did you find a way to make them work?

Backed out.

Con Kolivas
on
April 16, 2003 - 4:33am

ck6 contains a timer granularity update to O(1), and a small bugfix to the scheduler, both from 2.5. The interactivity modifications are removed. They may be available separately at a later stage or reincorporated if they get better.

Separate patches

Con Kolivas
on
April 16, 2003 - 4:38am

I haven't tried them, but try applying the separated out patches instead of the full patch, and omit the xfs patch (since you aren't using it). I seem to remember it diddling with dquot.

yeap it works

Anonymous
on
April 17, 2003 - 12:23am

at least with combination of:

001_o1_pe_ll_030412_ck_2.4.20.patch.bz2
002_aavm_030226_ck_2.4.20.patch.bz2
003_rl2_021215_ck.2.4.20.patch.bz2
008_VH_030409_ck_2.4.20.patch.bz2
009_ST_030412_ck_2.4.20.patch.bz2
010_DT_030413_ck_2.4.20.patch.bz2
ext3-use-after-free.patch
ext3-scheduling-storm.patch
ide-akpm.patch
sync_fs.patch
sync_fs-fix.patch
sync_fs-fix-2.patch

just fix it manually

flugstadp
on
April 17, 2003 - 11:39am

This is trival, just change the call:

DQUOT_SYNC(dev);

to:

DQUOT_SYNC_DEV(dev);

I don't know why patch is having a problem with this. I did this,
and it seems to work just fine.

Pete

ck6 available

Con Kolivas
on
April 16, 2003 - 6:03pm

Ok I've posted ck6.

This does not include the interactivity update by default, but the interactivity patch is available as an addon. Other minor tuning updates have been made as well, including setting the default Hz to 200.

Why?

Anonymous
on
April 17, 2003 - 4:07am

I have no Problems with the interactivity boost, altough I heard of it I couldn't reproduce them.
Perhaps you could note on your homepage that renicing does make sense if you don't use interactivity patch.
Or am I wrong? Is it just the O(1) schedular that makes renicing obsolete?

O(1) effect

Con Kolivas
on
April 17, 2003 - 8:02pm

The O(1) scheduler treats priorities much more seriously than the old scheduler does. Renicing X even without the interactivity patch can make audio skip when switching tabs etc in some programs on some hardware.

Since some people have the problem, it is safer to offer the interactivity patch as an addon rather than the default which causes no problems.

System frozen

Anonymous
on
April 17, 2003 - 5:16am

Con,

I'm testing your latest available patch (ck6) in my notebook (Presario 710). Today (2nd testing day) I got a total system freeze, while the caps lock led remained blinking, does this mean something to you ?, no oops was generated.

This has never happened to me before with standard kernels (AC or vanilla).

Anyway, I'm running it again, will see what happens...
Bye and thanks for your patch.
JC

OOM

Con Kolivas
on
April 17, 2003 - 8:17pm

You can see that with out of memory conditions or a VM problem. Can't guess offhand what it would be.

Memory leak?

Anonymous
on
April 20, 2003 - 1:41am

is anyone else having problems with 2.4.20-ck6 leaking like a sieve? After some testing I've narrowed it down to disk activity. For example, updating the locate database will use about 128 MB of RAM (10 GB of files, about 230000+ files). Next, I'm trying with the ext3 patches mentioned elsewhere in this thread.

it seems the patches fixed it. Mostly.

Anonymous
on
April 20, 2003 - 9:03am

Can't say for sure. I just let a find / run and memory usage seems to be on a normal level. Still a bit higher than before starting find, though.

Memory spendthrift

Con Kolivas
on
April 21, 2003 - 1:59am

ck6 by default has the aa vm tuned to give out _heaps_ of memory. This is the best for desktop performance. There shouldn't be any memory leak as such, but it will consume memory faster.

Hmmm...

Anonymous
on
April 21, 2003 - 2:41am

Ok, that's fair. But is the memory given back to the system at some point? I can switch to single user mode, kill *everything* and free _still_ claims 85+% of the memory (256 MB total) is in use (no, it's not used by cache or buffers). After a couple of days uptime the system will start trashing madly. As a matter of fact, there's a machine which I can't log into right now because (I guess), memory has been consumed. There's enough memory for sshd to respond, but the connection is closed after authentication because it can't spawn a shell (or at least I guess as much). If I'm right and memory has been leaked and exhausted, I'm surprised that the OOM killer hasn't gone berserk yet (i.e., sshd is still running). I'll find out later today when I drive up there. I fear the console might be trashed and I won't even be able to get at look at the SysRq output. And yes, this is a desktop machine, that's why there's no console on a serial line nor anything that.

I guess it's time for me to look at that software watchdog thing again. :-\

Leak detected?

Con Kolivas
on
April 21, 2003 - 2:51am

It is definitely possible that you've detected a leak. Try applying the patches manually and not applying the aavm. It will fail on the 010 patch, but those failures are changes to the aavm and wont affect the functioning of it. Or alternatively, try with the rmap vm.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.