WINE + Galciv + Con Kolivar's 09 patch to 2.6.0-test1-mm2
Kudos to CK
In 2.4.21 galciv + wine was fine.
In 2.4.21 + CK patches, galvic + wine would pause every 15 seconds or so (maybe it was when little animations played).
In 2.6.0-test1-mm2 (vanilla, or + 08) Galciv would stutter horribly and freeze my machine in wine. It might run smoothly until I loaded a nautilus window or something then stutters and loss of control of the system.
With 09, it is smooth as silk until I do something and then the video playbacks can be choppy but the game (turn based strategy) seems to run without the long pauses of 2.4.21 CK or 2.6.0 vanilla. I can switch between apps and go back without any problem.
09 seems to be a big improvement for whatever caused the stutter & die problems in wine+galciv.
Quoted 1 line · gaxt
Kudos to CK
Thanks.
Quoted 10 lines
In 2.4.21 galciv + wine was fine.
In 2.4.21 + CK patches, galvic + wine would pause every 15 seconds or so (maybe it was when little animations played).
In 2.6.0-test1-mm2 (vanilla, or + 08) Galciv would stutter horribly and freeze my machine in wine. It might run smoothly until I loaded a nautilus window or something then stutters and loss of control of the system.
Quoted 7 lines
With 09, it is smooth as silk until I do something and then the video playbacks can be choppy but the game (turn based strategy) seems to run without the long pauses of 2.4.21 CK or 2.6.0 vanilla. I can switch between apps and go back without any problem.
09 seems to be a big improvement for whatever caused the stutter & die problems in wine+galciv.
Therein lies the problem with large MAX_SLEEP_AVG values. It may prevent interactive tasks from becoming non interactive (which is the point), but if an interactive task turns into a true cpu hog it can literally stall the machine for seconds. Which is why the workaround in O*int that allow small MSAs help.
Con
260test2+O10int breaks : Re: WINE + Galciv + Con Kolivar's 09 patch to 2.6.0-test1-mm2
Update: 260-test2 with O10int has returned wine+galciv to freezing the whole computer on starting the game. The intro avi plays less than 1 second and the machine freezes up. I can swtich from virtual terminals but not enter any input.
Quoted 32 lines · Con Kolivas
Quoted 1 line · gaxt
Kudos to CK
Thanks.
Quoted 10 lines
In 2.4.21 galciv + wine was fine.
In 2.4.21 + CK patches, galvic + wine would pause every 15 seconds or so (maybe it was when little animations played).
In 2.6.0-test1-mm2 (vanilla, or + 08) Galciv would stutter horribly and freeze my machine in wine. It might run smoothly until I loaded a nautilus window or something then stutters and loss of control of the system.
Quoted 7 lines
With 09, it is smooth as silk until I do something and then the video playbacks can be choppy but the game (turn based strategy) seems to run without the long pauses of 2.4.21 CK or 2.6.0 vanilla. I can switch between apps and go back without any problem.
09 seems to be a big improvement for whatever caused the stutter & die problems in wine+galciv.
Therein lies the problem with large
MAX_SLEEP_AVGvalues. It may prevent interactive tasks from becoming non interactive (which is the point), but if an interactive task turns into a true cpu hog it can literally stall the machine for seconds. Which is why the workaround in O*int that allow small MSAs help.Con
260-test2-vanilla works fine with a little stutter playing the avis 260-test2-O10 causes horrible stutter and loss of input to system 260-test2-mm1 causes horrible stutter and loss of input to system
NOTE: Instead of re-setting, by switching consoles by pressing Alt F7 then Alt-F1 back and forth (ie from X to virtual console) it seems I could prod wine+galciv into edging forward, stalling, edging forward etc. through the opening AVIs. ie. I would hear the sounds of the movie advance each time I switched into Alt-F1.
Once into the turn-based game itself (after opening animations) ability to input was restored again and the game can be played and windows moved around etc.
So it seems the playing of the little movies is what really locks up the whole system using the O10/mm1 scheduling???
Quoted 10 lines · gaxt
260-test2-vanilla works fine with a little stutter playing the avis 260-test2-O10 causes horrible stutter and loss of input to system 260-test2-mm1 causes horrible stutter and loss of input to system
NOTE: Instead of re-setting, by switching consoles by pressing Alt F7 then Alt-F1 back and forth (ie from X to virtual console) it seems I could prod wine+galciv into edging forward, stalling, edging forward etc. through the opening AVIs. ie. I would hear the sounds of the movie advance each time I switched into Alt-F1.
Quoted 6 lines
Once into the turn-based game itself (after opening animations) ability to input was restored again and the game can be played and windows moved around etc.
So it seems the playing of the little movies is what really locks up the whole system using the O10/mm1 scheduling???
File I/O ? Try booting with elevator=deadline
Con
Quoted 16 lines · Con Kolivas
Quoted 14 lines · gaxt
260-test2-vanilla works fine with a little stutter playing the avis 260-test2-O10 causes horrible stutter and loss of input to system 260-test2-mm1 causes horrible stutter and loss of input to system
NOTE: Instead of re-setting, by switching consoles by pressing Alt F7 then Alt-F1 back and forth (ie from X to virtual console) it seems I could prod wine+galciv into edging forward, stalling, edging forward etc. through the opening AVIs. ie. I would hear the sounds of the movie advance each time I switched into Alt-F1.
Once into the turn-based game itself (after opening animations) ability to input was restored again and the game can be played and windows moved around etc.
Quoted 7 lines
Quoted 2 lines
So it seems the playing of the little movies is what really locks up the whole system using the O10/mm1 scheduling???
File I/O ? Try booting with elevator=deadline
Con
Setting elevator=deadline results in wine+galciv loading without the horrible long pauses but there is still chugging and while the AVIs play, the rest of Gnome is unresponsive (ie can't switch windows by clicking etc) though I can switch to Alt-F1 virtual terminal. Still not as good as 260-test-2-vanilla
Quoted 8 lines · gaxt
Quoted 1 line · Con Kolivas
File I/O ? Try booting with elevator=deadline
Setting elevator=deadline results in wine+galciv loading without the horrible long pauses but there is still chugging and while the AVIs play, the rest of Gnome is unresponsive (ie can't switch windows by clicking etc) though I can switch to Alt-F1 virtual terminal. Still not as good as 260-test-2-vanilla
Well that is weird, but no doubt IO is playing some part here. Can you please try the preview O11 patch (incremental against 2.6.0-test2-mm1 but should patch against an O10 patched vanilla) in
http://kernel.kolivas.org/2.5/experimental
While not specifically addressing this problem, it may help.
Con
Re: WINE + Galciv + Con Kolivas's 011 patch to 2.6.0-test2
I tried O11. Still chuggy in the AVIs and then locks out input into X. I switch to Alt-F1 console and hear the video advance, switch back, it pauses, switch to Alt-F1 etc. to get it through the video and then it's fine.
Incidentally, I moved my /home to another hard drive last night (same 7200 rpms) to get more space. It makes no difference to performance. 260-test2-vanilla was quite good and -mm1 and -O11 are chuggy and lock out input to X and require switching to virtual console to advance through the videos.
If there is some other data I can provide you, let me know.
Quoted 22 lines · Con Kolivas
Quoted 9 lines · gaxt
Quoted 1 line · Con Kolivas
File I/O ? Try booting with elevator=deadline
Setting elevator=deadline results in wine+galciv loading without the horrible long pauses but there is still chugging and while the AVIs play, the rest of Gnome is unresponsive (ie can't switch windows by clicking etc) though I can switch to Alt-F1 virtual terminal. Still not as good as 260-test-2-vanilla
Well that is weird, but no doubt IO is playing some part here. Can you please try the preview O11 patch (incremental against 2.6.0-test2-mm1 but should patch against an O10 patched vanilla) in
http://kernel.kolivas.org/2.5/experimental
While not specifically addressing this problem, it may help.
Con
Re: WINE + Galciv + Con Kolivas's 011 patch to 2.6.0-test2
Quoted 5 lines · gaxt
I tried O11. Still chuggy in the AVIs and then locks out input into X. I switch to Alt-F1 console and hear the video advance, switch back, it pauses, switch to Alt-F1 etc. to get it through the video and then it's fine.
Quoted 7 lines
Incidentally, I moved my /home to another hard drive last night (same 7200 rpms) to get more space. It makes no difference to performance. 260-test2-vanilla was quite good and -mm1 and -O11 are chuggy and lock out input to X and require switching to virtual console to advance through the videos.
If there is some other data I can provide you, let me know.
What top shows as the PRI of all the important processes concerned during all this would be helpful.
Con
Re: WINE + Galciv + Con Kolivas's 011 patch to 2.6.0-test2
Quoted 13 lines · Con Kolivas
Quoted 11 lines · gaxt
I tried O11. Still chuggy in the AVIs and then locks out input into X. I switch to Alt-F1 console and hear the video advance, switch back, it pauses, switch to Alt-F1 etc. to get it through the video and then it's fine.
Incidentally, I moved my /home to another hard drive last night (same 7200 rpms) to get more space. It makes no difference to performance. 260-test2-vanilla was quite good and -mm1 and -O11 are chuggy and lock out input to X and require switching to virtual console to advance through the videos.
Quoted 6 lines
Quoted 1 line
If there is some other data I can provide you, let me know.
What top shows as the PRI of all the important processes concerned during all this would be helpful.
Con
It's hard to grab top info as the interface freezes up. I'd have to ssh in from another system.
However, browsing lkml, I noticed someone saying I/O throughput was affected by a readahead setting of 256 instead of 512 using hdparm -a ###. I changed the readahead on my root and home drives and galciv was able to load (with some mild stuttering in the movies).
I've never adjusted this setting before. Perhaps it compensates for scheduler activity by allowing the system to draw more data within a given timeslice? Or am I babbling?
Running top while glaciv + wine is running with the new hdparm -a 512 setting, I can mention the following patterns:
When loading up playing AVIs, the top are wineserver, wine, wine, and X (there is also another wine process). When the game chugs/pauses badly in playing an avi, wineserver leaps to the top with >50% CPU with wineserver+wine processes+x taking 100% CPU. Then when chugging lapses, wineserver drops down to the 26% range and the other wine processes are the same or a bit above. When the game is loaded, two wine processes at 21% CPU each are at top, then X with 5-10% then wineserver with 2-3% (a huge drop) or even a couple of appas above wineserver.
Perhaps this data helps?
Re: WINE + Galciv + Con Kolivas's 011 patch to 2.6.0-test2
More notes.
galciv+wine even with hdparm -a is still too chuggy even within the game. Wineserver drops down to a 1-3% in game play but wine processes +x add up to 95 - 100% and slows things down. Using other windows in X takes long pauses. Not like vanilla 260 at all which was very smooth in the game and switching between apps.
Quoted 36 lines · gaxt
Quoted 13 lines · Con Kolivas
Quoted 11 lines · gaxt
I tried O11. Still chuggy in the AVIs and then locks out input into X. I switch to Alt-F1 console and hear the video advance, switch back, it pauses, switch to Alt-F1 etc. to get it through the video and then it's fine.
Incidentally, I moved my /home to another hard drive last night (same 7200 rpms) to get more space. It makes no difference to performance. 260-test2-vanilla was quite good and -mm1 and -O11 are chuggy and lock out input to X and require switching to virtual console to advance through the videos.
Quoted 7 lines
Quoted 1 line
If there is some other data I can provide you, let me know.
What top shows as the PRI of all the important processes concerned during all this would be helpful.
Con
It's hard to grab top info as the interface freezes up. I'd have to ssh in from another system.
However, browsing lkml, I noticed someone saying I/O throughput was affected by a readahead setting of 256 instead of 512 using hdparm -a ###. I changed the readahead on my root and home drives and galciv was able to load (with some mild stuttering in the movies).
I've never adjusted this setting before. Perhaps it compensates for scheduler activity by allowing the system to draw more data within a given timeslice? Or am I babbling?
Running top while glaciv + wine is running with the new hdparm -a 512 setting, I can mention the following patterns:
When loading up playing AVIs, the top are wineserver, wine, wine, and X (there is also another wine process). When the game chugs/pauses badly in playing an avi, wineserver leaps to the top with >50% CPU with wineserver+wine processes+x taking 100% CPU. Then when chugging lapses, wineserver drops down to the 26% range and the other wine processes are the same or a bit above. When the game is loaded, two wine processes at 21% CPU each are at top, then X with 5-10% then wineserver with 2-3% (a huge drop) or even a couple of appas above wineserver.
Perhaps this data helps?
Re: WINE + Galciv + Con Kolivas's 011 patch to 2.6.0-test2
Quoted 3 lines · gaxt
More notes.
galciv+wine even with hdparm -a is still too chuggy even within the game. Wineserver drops down to a 1-3% in game play but wine processes +x add up to 95 - 100% and slows things down. Using other windows in X takes long pauses. Not like vanilla 260 at all which was very smooth in the game and switching between apps.
sorry -> 260-test2 vanilla NOT 260test1 which would lock galciv+wine up.
Quoted 43 lines
Quoted 38 lines · gaxt
Quoted 13 lines · Con Kolivas
Quoted 11 lines · gaxt
I tried O11. Still chuggy in the AVIs and then locks out input into X. I switch to Alt-F1 console and hear the video advance, switch back, it pauses, switch to Alt-F1 etc. to get it through the video and then it's fine.
Incidentally, I moved my /home to another hard drive last night (same 7200 rpms) to get more space. It makes no difference to performance. 260-test2-vanilla was quite good and -mm1 and -O11 are chuggy and lock out input to X and require switching to virtual console to advance through the videos.
Quoted 8 lines
Quoted 1 line
If there is some other data I can provide you, let me know.
What top shows as the PRI of all the important processes concerned during all this would be helpful.
Con
It's hard to grab top info as the interface freezes up. I'd have to ssh in from another system.
However, browsing lkml, I noticed someone saying I/O throughput was affected by a readahead setting of 256 instead of 512 using hdparm -a ###. I changed the readahead on my root and home drives and galciv was able to load (with some mild stuttering in the movies).
I've never adjusted this setting before. Perhaps it compensates for scheduler activity by allowing the system to draw more data within a given timeslice? Or am I babbling?
Running top while glaciv + wine is running with the new hdparm -a 512 setting, I can mention the following patterns:
When loading up playing AVIs, the top are wineserver, wine, wine, and X (there is also another wine process). When the game chugs/pauses badly in playing an avi, wineserver leaps to the top with >50% CPU with wineserver+wine processes+x taking 100% CPU. Then when chugging lapses, wineserver drops down to the 26% range and the other wine processes are the same or a bit above. When the game is loaded, two wine processes at 21% CPU each are at top, then X with 5-10% then wineserver with 2-3% (a huge drop) or even a couple of appas above wineserver.
Perhaps this data helps?
2.6.0-test2-mm5 + July Wine + Galciv
In reply to Con KolivasAs an update to the messages I've been posting about running Galactic Civ in Wine on the 260 series:
260-test2-mm5 seems quite nice.
When programs are intially run (ie. Nautilus, OpenOffice etc. as well as Galciv in wine) there can be minor stuttering and some long delays but once the software is up, it can be switched back and forth with little problem. (When initially starting up even the movies ran fine without pauses)
There can be some minor stuttering when flipping between apps but it seems to smooth out after using a particular app for awhile which I would guess is the adpative nature of the scheduler?
Re: WINE + Galciv + 2.6.0-test3-mm1-O15
In reply to Con KolivasPhotoshop 6 (yes, legal owned version) in wine is flawless (as it was with 2.6.0-test3)
Galciv plays videos quite smoothly but as soon as I run it it will freeze the cursor for 12-15 seconds every half-minute or so even within the game itself which is turn-based strategy without a lot of whizbang stuff. In the past, the videos would stutter but the game would not suffer from more than short pauses now and then.
Re: WINE + Galciv + 2.6.0-test3-mm1-O15
Quoted 8 lines · gaxt
Photoshop 6 (yes, legal owned version) in wine is flawless (as it was with 2.6.0-test3)
Galciv plays videos quite smoothly but as soon as I run it it will freeze the cursor for 12-15 seconds every half-minute or so even within the game itself which is turn-based strategy without a lot of whizbang stuff. In the past, the videos would stutter but the game would not suffer from more than short pauses now and then.
Yes, herein lies one of those mysteries that still eludes me but I have been investigating it. I can now reproduce in other applications what appears to be the problem - Two cpu hogs, X and evolution for example are running and evolution is making X the cpu hog. The problem is that X gets demoted whereas evolution doesn't. Strangely, dropping evolution to nice +1 or making X -1 seems to change which one gets demoted, and X is now much smoother. I assume the same thing is happening here between wine and wineserver, which is why you've seen reversal of priorities in your previous posts. See if renicing one of them +1 helps for the time being. I will continue investigating to find out why the heck this happens and try and fix it.
Con
P.S. I've cc'ed MG because he has seen the scheduler do other forms of trickery and may have thoughts on why this happens.
Re: WINE + Galciv + 2.6.0-test3-mm1-O15
Quoted 21 lines · Con Kolivas
Quoted 8 lines · gaxt
Photoshop 6 (yes, legal owned version) in wine is flawless (as it was with 2.6.0-test3)
Galciv plays videos quite smoothly but as soon as I run it it will freeze the cursor for 12-15 seconds every half-minute or so even within the game itself which is turn-based strategy without a lot of whizbang stuff. In the past, the videos would stutter but the game would not suffer from more than short pauses now and then.
Yes, herein lies one of those mysteries that still eludes me but I have been investigating it. I can now reproduce in other applications what appears to be the problem - Two cpu hogs, X and evolution for example are running and evolution is making X the cpu hog. The problem is that X gets demoted whereas evolution doesn't. Strangely, dropping evolution to nice +1 or making X -1 seems to change which one gets demoted, and X is now much smoother. I assume the same thing is happening here between wine and wineserver, which is why you've seen reversal of priorities in your previous posts. See if renicing one of them +1 helps for the time being. I will continue investigating to find out why the heck this happens and try and fix it.
Quoted 4 lines
Con
P.S. I've cc'ed MG because he has seen the scheduler do other forms of trickery and may have thoughts on why this happens.
That sounds suspiciously similar to my scenario, but mine requires a third element to trigger.
<scritch scritch scritch>
What about this? In both your senario and mine, X is running low on cash while doing work at the request of a client right? Charge for it. If X is lower on cash than the guy he's working for, pick the client's pocket... take the remainder of your slice from his sleep_avg for your trouble. If you're not in_interrupt(), nothing's free. Similar to Robinhood, but you take from the rich, and keep it :) He's probably going straight to the bank after he wakes you anyway, so he likely won't even miss it. Instead of backboost of overflow, which can cause nasty problems, you could try backtheft.
-Mike
Re: WINE + Galciv + 2.6.0-test3-mm1-O15
Quoted 6 lines · Mike Galbraith
That sounds suspiciously similar to my scenario, but mine requires a third element to trigger.
<scritch scritch scritch>
What about this? In both your senario and mine, X is running low on cash while doing work at the request of a client right? Charge for it. If X is lower on cash than the guy he's working for, pick the client's pocket... take the remainder of your slice from his
sleep_avgfor your trouble. If you're notin_interrupt(), nothing's free. Similar to Robinhood, but you take from the rich, and keep it :) He's probably going straight to the bank after he wakes you anyway, so he likely won't even miss it. Instead of backboost of overflow, which can cause nasty problems, you could try backtheft.
How is this different from back-boost?
Re: WINE + Galciv + 2.6.0-test3-mm1-O15
Quoted 9 lines · Timothy Miller
Quoted 4 lines · Mike Galbraith
That sounds suspiciously similar to my scenario, but mine requires a third element to trigger.
<scritch scritch scritch>
What about this? In both your senario and mine, X is running low on cash while doing work at the request of a client right? Charge for it.
If X is lower on cash than the guy he's working for, pick the client's pocket... take the remainder of your slice from hissleep_avgfor your trouble. If you're notin_interrupt(), nothing's free. Similar to Robinhood, but you take from the rich, and keep it :) He's probably going straight to the bank after he wakes you anyway, so he likely won't even miss it. Instead of backboost of overflow, which can cause nasty problems, you could try backtheft.How is this different from back-boost?
With backboost, you take everything that overflows MAX_SLEEP_AVG and give it all to the waker... you always pull-up. With back-theft (blech;), there's constant pull-up and push-down for all parties instead of only those who reach MAX_SLEEP_AVG, so while you'll still tend to group tasks which are related (the original goal of backboost), it shouldn't (wild theory) go raging out of control.
-Mike
Re: WINE + Galciv + 2.6.0-test3-mm1-O15
In reply to Mike GalbraithQuoted 33 lines · Mike Galbraith
Quoted 22 lines · Con Kolivas
Quoted 8 lines · gaxt
Photoshop 6 (yes, legal owned version) in wine is flawless (as it was with 2.6.0-test3)
Galciv plays videos quite smoothly but as soon as I run it it will freeze the cursor for 12-15 seconds every half-minute or so even within the game itself which is turn-based strategy without a lot of whizbang stuff. In the past, the videos would stutter but the game would not suffer from more than short pauses now and then.
Yes, herein lies one of those mysteries that still eludes me but I have been investigating it. I can now reproduce in other applications what appears to be the problem - Two cpu hogs, X and evolution for example are running and evolution is making X the cpu hog. The problem is that X gets demoted whereas evolution doesn't. Strangely, dropping evolution to nice +1 or making X -1 seems to change which one gets demoted, and X is now much smoother. I assume the same thing is happening here between wine and wineserver, which is why you've seen reversal of priorities in your previous posts. See if renicing one of them +1 helps for the time being. I will continue investigating to find out why the heck this happens and try and fix it.
Quoted 4 lines
Con
P.S. I've cc'ed MG because he has seen the scheduler do other forms of trickery and may have thoughts on why this happens.That sounds suspiciously similar to my scenario, but mine requires a third element to trigger.
<scritch scritch scritch>
Quoted 9 lines
What about this? In both your senario and mine, X is running low on cash while doing work at the request of a client right? Charge for it. If X is lower on cash than the guy he's working for, pick the client's pocket... take the remainder of your slice from his
sleep_avgfor your trouble. If you're notin_interrupt(), nothing's free. Similar to Robinhood, but you take from the rich, and keep it :) He's probably going straight to the bank after he wakes you anyway, so he likely won't even miss it. Instead of backboost of overflow, which can cause nasty problems, you could try backtheft.
Not a bad idea at all. The working for someone else thing is killing me. Now, how to implement...
Con
Re: WINE + Galciv + 2.6.0-test3-mm1-O15
Quoted 44 lines · Con Kolivas
Quoted 33 lines · Mike Galbraith
Quoted 22 lines · Con Kolivas
Quoted 8 lines · gaxt
Photoshop 6 (yes, legal owned version) in wine is flawless (as it was with 2.6.0-test3)
Galciv plays videos quite smoothly but as soon as I run it it will freeze the cursor for 12-15 seconds every half-minute or so even within the game itself which is turn-based strategy without a lot of whizbang stuff. In the past, the videos would stutter but the game would not suffer from more than short pauses now and then.
Yes, herein lies one of those mysteries that still eludes me but I have been investigating it. I can now reproduce in other applications what appears to be the problem - Two cpu hogs, X and evolution for example are running and evolution is making X the cpu hog. The problem is that X gets demoted whereas evolution doesn't. Strangely, dropping evolution to nice +1 or making X -1 seems to change which one gets demoted, and X is now much smoother. I assume the same thing is happening here between wine and wineserver, which is why you've seen reversal of priorities in your previous posts. See if renicing one of them +1 helps for the time being. I will continue investigating to find out why the heck this happens and try and fix it.
Quoted 4 lines
Con
P.S. I've cc'ed MG because he has seen the scheduler do other forms of trickery and may have thoughts on why this happens.That sounds suspiciously similar to my scenario, but mine requires a third element to trigger.
<scritch scritch scritch>
Quoted 9 lines
What about this? In both your senario and mine, X is running low on cash while doing work at the request of a client right? Charge for it. If X is lower on cash than the guy he's working for, pick the client's pocket... take the remainder of your slice from his
sleep_avgfor your trouble. If you're notin_interrupt(), nothing's free. Similar to Robinhood, but you take from the rich, and keep it :) He's probably going straight to the bank after he wakes you anyway, so he likely won't even miss it. Instead of backboost of overflow, which can cause nasty problems, you could try backtheft.
Quoted 2 lines
Not a bad idea at all. The working for someone else thing is killing me. Now, how to implement...
I had to back up and regroup a bit because of backboost sanity problems (wish I could pull those dang fangs, backboost is wonderful otherwise), but the attached cured my inversion problem.
-Mike
kernel/sched.c renamed from kernel/sched.c.org +19 -0
@@ -358,6 +358,8 @@if (sleep_time >0 ) {unsigned long long sleep_avg; +unsigned long run_time = now - current->timestamp; +unsigned int slice =1000000 * current->time_slice;/* * This code gives a bonus to interactive tasks.
@@ -381,6 +383,22 @@ p->sleep_avg = sleep_avg; p->prio =effective_prio (p); } +/* +* If the awakened task has been asleep for longer than the +* waker has had the CPU plus round-robin time, and it is +* going to preempt, there is a good chance that the waker +* is not getting enough CPU to service the awakened task in +* a timely manner, and that this is the cause of the preempt. +* Take some of the resulting sleep_time from the awakened +* task, and give it to the waker. +*/ +if (!in_interrupt () && p->mm && current->mm && sleep_avg > + current->sleep_avg + slice && sleep_time > run_time + + (1000000 *this_rq ()->nr_running *TIMESLICE_GRANULARITY ) && +TASK_PREEMPTS_CURR (p,task_rq (current))) { + current->sleep_avg += slice; + sleep_avg -= slice; + } } }
@@ -1414,6 +1432,7 @@ next->timestamp = now; rq->nr_switches++; rq->curr = next; + next->timestamp = now;prepare_arch_switch (rq, next); prev =context_switch (rq, prev, next);