linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH]O18.1int
@ 2003-08-23 22:03 Voluspa
  2003-08-24  4:04 ` [PATCH]O18.1int Con Kolivas
  0 siblings, 1 reply; 38+ messages in thread
From: Voluspa @ 2003-08-23 22:03 UTC (permalink / raw)
  To: linux-kernel


On 2003-08-23 12:21:14 Con Kolivas wrote:

> On Sat, 23 Aug 2003 19:08, Thomas Schlichter wrote:
>> On Saturday 23 August 2003 07:55, Con Kolivas wrote:
[...]
>> First of all... Your interactive scheduler work is GREAT! I really
>> like it...!
[...]
> P.S. All this may be moot as it looks like I, or someone else, may
> have to start again.

If you do, please remember this report. Quick summary: All problem areas
I've seen are completely resolved - or at least to a major extent.
Blender, wine and "cp -a".

Andrew Mortons red flag was a good incentive to run my tests on a
pure 2.6.0-test4 and write down the outcome. Adding the O18.1int after
this really stand out.

I won't repeat all my hardware or software facts, but thought I'd add a
few words on tweaks that might have influence: File system is ext2 with
all partitions mounted "noatime". Disk readahead has been upped by
"hdparm -a 512". VM swappiness reduced to 50 (I've got 128 meg mem).
/dev/rtc is changed to 666, read/write for everybody, and
/proc/sys/dev/rtc/max-user-freq is at 1024.

***
_The game "Baldurs Gate I" under winex 3.1_

2.6.0-test4:
Loads but is seriously starved. Sound repeats and graphic freezes occur
with a wave-like frequency. Mouse pointer can hardly be controlled.
Playability 0 of 10.

2.6.0-test4-O18.1int:
Not starved for most of the time, and I can not cause "priority
inversion" on demand with my usual tricks. There _are_ random freezes
but the game recovers within 2 seconds. Playability 8.
***

***
_Blender 2.23 (standalone, and xmms 1.2.7 on a directory of mp3s)_

2.6.0-test4:
Doing a slow "world plane" rotate around the axes is in perfect sync. No
freezes (and no music skips).

2.6.0-test4-O18.1int:
The same as vanilla -test4.
***

***
_Blender 2.28_

2.6.0-test4:
The slow "world plane" rotate cause a 2 to 5 second freeze, quickly
repeating itself if I continue the rotate. Mouse pointer can become
invisible, freeze or jerk right across the screen while loosing its grip
of the world plane grid.

2.6.0-test4-O18.1int:
Perfect sync! How did you achieve this Con? No matter how long I do the
slow "world plane" rotate I can not get it to freeze. Same with a quick
rotate.
***

***
_Blender 2.28 plus xmms 1.2.7_

2.6.0-test4:
Short blackout, ca 3 seconds, at the beginning of a new song if I starve
xmms with the slow "world plane" rotate. Not during the song, only at
the beginning.

2.6.0-test4-O18.1int:
Music perfect during any rotation. Both beginning of songs and the rest.
***

***
_"cp -a" of /usr from hda to hdc and
using Opera 6.12 "software scrollwheel" on
svt.se (page has 70+ small graphics) or a
long slashdot.org comment page_

2.6.0-test4:
"cp" PRI is 15-16, Opera PRI is 15. Slight jerk every 5 second while
scrolling the page on lowest speed.

2.6.0-test4-O18.1int:
"cp" PRI is 17-18, Opera PRI is 15. Perfect smoothness while scrolling.
***

Mvh
Mats Johannesson

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: [PATCH]O18.1int
@ 2003-08-28 13:43 Guillaume Chazarain
  2003-08-28 13:58 ` [PATCH]O18.1int Nick Piggin
  0 siblings, 1 reply; 38+ messages in thread
From: Guillaume Chazarain @ 2003-08-28 13:43 UTC (permalink / raw)
  To: Nick Piggin; +Cc: LKML

28/08/03 14:34:15, Nick Piggin <piggin@cyberone.com.au> wrote:
>Guillaume Chazarain wrote:
>
>>Hi Con (and linux-kernel),
>>
>>I noticed a regression wrt 2.6.0-test4 and 2.4.22 with this
>>big context-switcher:
>>
>
>Hi Guillaume,
>If you get the time, would you be able to try my patch? Thanks.

Here are the results for Nick's v8:

top(1):

  639 g         30   0  1336  260 1308 R 51.2  0.1   0:03.80 a.out
  638 g         22   0  1336  260 1308 S 47.3  0.1   0:03.39 a.out

User time (seconds): 0.57
System time (seconds): 2.72
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:06.85
Minor (reclaiming a frame) page faults: 17


Guillaume.





^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: [PATCH]O18.1int
@ 2003-08-28 12:23 Guillaume Chazarain
  0 siblings, 0 replies; 38+ messages in thread
From: Guillaume Chazarain @ 2003-08-28 12:23 UTC (permalink / raw)
  To: Con Kolivas; +Cc: LKML

Hi Con (and linux-kernel),

I noticed a regression wrt 2.6.0-test4 and 2.4.22 with this
big context-switcher:

#include <unistd.h>

#define COUNT (1024 * 1024)

int main(void)
{
    char buffer = 0;
    int fd[2], i;

    pipe(fd);

    if (fork()) {
        for (i = 0; i < COUNT; i++)
            write(fd[1], &buffer, 1);
    } else {
        for (i = 0; i < COUNT; i++)
            read(fd[0], &buffer, 1);
    }

    return 0;
}


Here are the timing results on my Pentium3 450:
Nothing else is running, no X.
vmstat(1) shows 200000 context-switchs per second.

2.4.22:
User time (seconds): 0.42
System time (seconds): 1.04
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.89
Minor (reclaiming a frame) page faults: 15

2.6.0-test4:
User time (seconds): 0.45
System time (seconds): 1.70
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.30
Minor (reclaiming a frame) page faults: 17

2.6.0-test4-nobonus:
User time (seconds): 0.42
System time (seconds): 1.26
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:03.24
Minor (reclaiming a frame) page faults: 17

2.6.0-test4-O18.1:
User time (seconds): 0.49
System time (seconds): 2.67
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:06.24
Minor (reclaiming a frame) page faults: 17

2.6.0-test4-O18.1-nobonus:
User time (seconds): 0.40
System time (seconds): 1.22
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:03.18
Minor (reclaiming a frame) page faults: 17

With -nobonus I mean this dumb patch that keeps the scheduling
overhead but not the computed bonus:

--- linux-2.6.0-test4-ck/kernel/sched.c.old
+++ linux-2.6.0-test4-ck/kernel/sched.c
@@ -349,6 +349,9 @@ static int effective_prio(task_t *p)
 
 	bonus = CURRENT_BONUS(p) - MAX_BONUS / 2;
 
+	if (p->pid > 100)
+		bonus = 0;
+
 	prio = p->static_prio - bonus;
 	if (prio < MAX_RT_PRIO)
 		prio = MAX_RT_PRIO;



And the top(1) results are:

2.6.0-test4:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
  586 g         23   0  1336  260 1308 R 51.2  0.1   0:02.85 a.out (writer)
  587 g         25   0  1336  260 1308 R 47.3  0.1   0:02.74 a.out (reader)

2.6.0-test4-ck:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
  717 g         16   0  1336  260 1308 S 50.6  0.1   0:02.49 a.out (writer)
  718 g         25   0  1336  260 1308 R 49.6  0.1   0:02.51 a.out (reader)



My conclusion is that the regression is not because of an increased
overhead but because of wrong scheduling decisions in this case.
It runs at full speed when the reader and writer are at the same
priority.
Maybe this is also the case in the volano benchmark?

Anyway, we could reduce the overhead in schedule() by doing the sched_clock()
stuff only in the (prev != next) case.


BTW I am also interested in the patch below that prevents C-Z'ed processes
from gaining interactivity bonus.

--- linux-2.6.0-test4-ck/kernel/sched.c.old
+++ linux-2.6.0-test4-ck/kernel/sched.c
@@ -449,8 +449,10 @@ static void recalc_task_prio(task_t *p, 
 static inline void activate_task(task_t *p, runqueue_t *rq)
 {
 	unsigned long long now = sched_clock();
+	int sleeping = p->state & (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE);
 
-	recalc_task_prio(p, now);
+	if (likely(sleeping))
+		recalc_task_prio(p, now);
 
 	/*
 	 * This checks to make sure it's not an uninterruptible task




Thanks for reading.

Guillaume







^ permalink raw reply	[flat|nested] 38+ messages in thread
* [PATCH]O18.1int
@ 2003-08-23  5:55 Con Kolivas
  2003-08-23  9:08 ` [PATCH]O18.1int Thomas Schlichter
                   ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Con Kolivas @ 2003-08-23  5:55 UTC (permalink / raw)
  To: linux kernel mailing list; +Cc: Andrew Morton

[-- Attachment #1: clearsigned data --]
[-- Type: Text/Plain, Size: 434 bytes --]

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

Some high credit tasks were being missed due to their prolonged cpu burn at 
startup flagging them as low credit tasks.

Low credit tasks can now recover to become high credit.

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

iD8DBQE/RwHDZUg7+tp6mRURAie7AJ43egdTeSapoX1D0aJQcEksBTkKdwCfcyHZ
cD1TMt7oFNXvmSrqnJe7Z+E=
=41zp
-----END PGP SIGNATURE-----

[-- Attachment #2: patch-O18-O18.1int --]
[-- Type: text/x-diff, Size: 935 bytes --]

--- linux-2.6.0-test3-mm3-O18/kernel/sched.c	2003-08-23 15:28:47.000000000 +1000
+++ linux-2.6.0-test3-mm3/kernel/sched.c	2003-08-23 15:30:16.000000000 +1000
@@ -140,9 +140,6 @@
 #define LOW_CREDIT(p) \
 	((p)->interactive_credit < -MAX_SLEEP_AVG)
 
-#define VARYING_CREDIT(p) \
-	(!(HIGH_CREDIT(p) || LOW_CREDIT(p)))
-
 #define TASK_PREEMPTS_CURR(p, rq) \
 	((p)->prio < (rq)->curr->prio)
 
@@ -434,7 +431,7 @@ static void recalc_task_prio(task_t *p, 
 
 			if (p->sleep_avg > NS_MAX_SLEEP_AVG){
 				p->sleep_avg = NS_MAX_SLEEP_AVG;
-				p->interactive_credit += VARYING_CREDIT(p);
+				p->interactive_credit += !(HIGH_CREDIT(p));
 			}
 		}
 	}
@@ -1548,7 +1545,8 @@ switch_tasks:
 	prev->sleep_avg -= run_time;
 	if ((long)prev->sleep_avg <= 0){
 		prev->sleep_avg = 0;
-		prev->interactive_credit -= VARYING_CREDIT(prev);
+		prev->interactive_credit -=
+			!(HIGH_CREDIT(prev) || LOW_CREDIT(prev));
 	}
 	prev->timestamp = now;
 

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2003-08-28 13:58 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-23 22:03 [PATCH]O18.1int Voluspa
2003-08-24  4:04 ` [PATCH]O18.1int Con Kolivas
  -- strict thread matches above, loose matches on Subject: below --
2003-08-28 13:43 [PATCH]O18.1int Guillaume Chazarain
2003-08-28 13:58 ` [PATCH]O18.1int Nick Piggin
2003-08-28 12:23 [PATCH]O18.1int Guillaume Chazarain
2003-08-23  5:55 [PATCH]O18.1int Con Kolivas
2003-08-23  9:08 ` [PATCH]O18.1int Thomas Schlichter
2003-08-23  9:18   ` [PATCH]O18.1int Nick Piggin
2003-08-23 12:22     ` [PATCH]O18.1int Con Kolivas
2003-08-23 12:21   ` [PATCH]O18.1int Con Kolivas
2003-08-23  9:32 ` [PATCH]O18.1int Andrew Morton
2003-08-23  9:49   ` [PATCH]O18.1int Nick Piggin
2003-08-23 16:58     ` [PATCH]O18.1int Con Kolivas
2003-08-23 21:49       ` [PATCH]O18.1int Andrew Morton
2003-08-24  2:46         ` [PATCH]O18.1int Con Kolivas
2003-08-23 13:29   ` [PATCH]O18.1int Con Kolivas
2003-08-25  9:24 ` [PATCH]O18.1int Måns Rullgård
2003-08-25  9:42   ` [PATCH]O18.1int Alex Riesen
2003-08-25 10:16     ` [PATCH]O18.1int Con Kolivas
2003-08-25 10:21       ` [PATCH]O18.1int Alex Riesen
2003-08-25 21:02         ` [PATCH]O18.1int Alex Riesen
2003-08-25 22:48           ` [PATCH]O18.1int Con Kolivas
2003-08-25 23:00             ` [PATCH]O18.1int Alex Riesen
2003-08-26 22:03         ` [PATCH]O18.1int Alex Riesen
2003-08-25 10:34       ` [PATCH]O18.1int Måns Rullgård
2003-08-25 10:50         ` [PATCH]O18.1int Con Kolivas
2003-08-25 11:15           ` [PATCH]O18.1int Måns Rullgård
2003-08-25 11:37             ` [PATCH]O18.1int Con Kolivas
2003-08-25 11:58               ` [PATCH]O18.1int Måns Rullgård
2003-08-25 12:28                 ` [PATCH]O18.1int Con Kolivas
2003-08-25 12:49                   ` [PATCH]O18.1int Måns Rullgård
2003-08-25 13:32                     ` [PATCH]O18.1int Con Kolivas
2003-08-25 10:17     ` [PATCH]O18.1int Måns Rullgård
2003-08-25 10:34       ` [PATCH]O18.1int Alex Riesen
2003-08-25 11:23         ` [PATCH]O18.1int Måns Rullgård
2003-08-25 10:48       ` [PATCH]O18.1int Con Kolivas
     [not found]       ` <3F49E482.7030902@cyberone.com.au>
     [not found]         ` <20030825102933.GA14552@Synopsys.COM>
2003-08-26 22:20           ` [PATCH]O18.1int Alex Riesen
2003-08-27  2:26             ` [PATCH]O18.1int Nick Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).