mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Serge Belyshev <belyshev@depni.sinp.msu.ru>
To: Matt Mackall <mpm@selenic.com>
Cc: Con Kolivas <kernel@kolivas.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	akpm@linux-foundation.org
Subject: Re: 2.6.21-rc3-mm1 RSDL results
Date: Fri, 09 Mar 2007 12:07:06 +0300	[thread overview]
Message-ID: <87slce945h.fsf@depni.sinp.msu.ru> (raw)
In-Reply-To: <200703091936.47128.kernel@kolivas.org> (Con Kolivas's message of "Fri\, 9 Mar 2007 19\:36\:46 +1100")

Con Kolivas <kernel@kolivas.org> writes:

> On Friday 09 March 2007 18:53, Matt Mackall wrote:
...
>>
>> With a single non-parallel make running (all in cache, mind you), the
>> system kicks up into just about 100% CPU usage at full speed. Desktop
>> spinning becomes between 10x to 100x slower (from ~30fps to < 1fps).
>> Galeon scrolling pauses for as much as a second. Mouse movement pauses
>> for as much as a second. Typing in terminals lags noticeably.
>>
>> This is not the expected behavior of a fair, low-latency scheduler.
>
> No indeed it does not sound right at all to me either. Last time I encountered 
> something like this we traced it and hit sched_yield calls somewhere in the 
> graphic pipeline. So first question is, how does mainline perform with the 
> same testcase, and second question is umm whatever it is that is slow is 
> there a way to trace it to see if it yields?

Matt, some 3d drivers are known to do sched_yield() behind user's back,

(notably dri radeon ones, grep for sched_yield:
http://webcvs.freedesktop.org/mesa/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c?revision=1.37&view=markup
http://webcvs.freedesktop.org/mesa/Mesa/src/mesa/drivers/dri/r300/radeon_ioctl.c?revision=1.14&view=markup)

thus absolutely killing any desktop interactivity whatsoever.

If you see sched_yield() when stracing any 3d program, I suggest you
to try this bruteforce workaround, which works fine for me,
disable sched_yield():


 kernel/sched.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -4285,7 +4285,7 @@ asmlinkage long sys_sched_getaffinity(pi
  * This function yields the current CPU by dropping the priority of current
  * to the lowest priority.
  */
-asmlinkage long sys_sched_yield(void)
+static long sys_sched_yield1(void)
 {
 	struct rq *rq = this_rq_lock();
 	struct task_struct *p = current;
@@ -4312,6 +4312,11 @@ asmlinkage long sys_sched_yield(void)
 	return 0;
 }
 
+asmlinkage long sys_sched_yield(void)
+{
+	return 0;
+}
+
 static void __cond_resched(void)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
@@ -4395,7 +4400,7 @@ EXPORT_SYMBOL(cond_resched_softirq);
 void __sched yield(void)
 {
 	set_current_state(TASK_RUNNING);
-	sys_sched_yield();
+	sys_sched_yield1();
 }
 EXPORT_SYMBOL(yield);
 

  reply	other threads:[~2007-03-09  9:07 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09  5:39 Matt Mackall
2007-03-09  6:28 ` Con Kolivas
2007-03-09  7:53   ` Matt Mackall
2007-03-09  8:20     ` Matt Mackall
2007-03-09  8:39       ` Con Kolivas
2007-03-09 18:27         ` Matt Mackall
2007-03-09 20:15           ` Con Kolivas
2007-03-09 20:26             ` Con Kolivas
2007-03-09 20:51               ` Matt Mackall
2007-03-09 20:55             ` Matt Mackall
2007-03-09 20:46         ` Matt Mackall
2007-03-09 21:07           ` Con Kolivas
2007-03-09 21:19             ` Con Kolivas
2007-03-09 21:39               ` Matt Mackall
2007-03-09 21:57                 ` Con Kolivas
2007-03-09 22:18                   ` Con Kolivas
2007-03-09 22:29                     ` Matt Mackall
2007-03-09 23:02                       ` Con Kolivas
2007-03-09 23:06                         ` Matt Mackall
2007-03-10  0:31                           ` Con Kolivas
2007-03-10  0:34                       ` Con Kolivas
2007-03-10  0:49                         ` Matt Mackall
2007-03-10  1:28                           ` Con Kolivas
2007-03-10  1:42                             ` Matt Mackall
2007-03-10  2:10                               ` Kyle Moffett
2007-03-10  2:20                               ` Con Kolivas
2007-03-10  2:26                                 ` Matt Mackall
2007-03-10  2:53                                   ` Con Kolivas
2007-03-09 21:57                 ` Willy Tarreau
2007-03-09 22:12                   ` Con Kolivas
2007-03-09 22:20                     ` Matt Mackall
2007-03-09 22:31                     ` Willy Tarreau
2007-03-10  1:02                     ` Con Kolivas
2007-03-10  1:10                       ` Matt Mackall
2007-03-10 17:01             ` James Cloos
2007-03-10 23:16               ` Con Kolivas
2007-03-11 12:38                 ` James Cloos
2007-03-11 12:52                   ` Con Kolivas
2007-03-09 21:10           ` Matt Mackall
2007-03-09  8:36     ` Con Kolivas
2007-03-09  9:07       ` Serge Belyshev [this message]
2007-03-09  9:49         ` William Lee Irwin III
2007-03-09 10:36           ` Serge Belyshev
2007-03-09 18:07             ` Mark Lord
2007-03-09 18:24               ` Jeffrey Hundstad
2007-03-09 20:23               ` Con Kolivas
2007-03-10 18:21                 ` Mark Lord
2007-03-10 23:34                   ` Con Kolivas
2007-03-10 23:38                     ` Con Kolivas
2007-03-13 18:21                     ` Mark Lord
2007-03-13 20:26                       ` Con Kolivas
2007-03-13 22:06                         ` Mark Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87slce945h.fsf@depni.sinp.msu.ru \
    --to=belyshev@depni.sinp.msu.ru \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome