Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2001 19:23:04 +0100
From:      Cejka Rudolf <cejkar@dcse.fee.vutbr.cz>
To:        freebsd-current@freebsd.org
Subject:   Does task scheduler work correctly? (... nice bug fix)
Message-ID:  <20010201192304.A54677@dcse.fee.vutbr.cz>

next in thread | raw e-mail | index | archive | help

Hi,
  I'm afraid that we have still problems with task scheduler:

Until 1999/11/28, it was known that a process with nice 20 were
capable to steal many CPU cycles from processes without nice.
1999/11/28 came commit
http://www.FreeBSD.org/cgi/getmsg.cgi?fetch=15023+20131+/usr/local/www/db/text/1999/cvs-all/19991205.cvs-all
--
bde         1999/11/28 04:12:15 PST
  ...
  Scheduler fixes equivalent to the ones logged in the following NetBSD
  commit to kern_synch.c:
  ...
  Scheduler bug fixes and reorganization
  * fix the ancient nice(1) bug, where nice +20 processes incorrectly
    steal 10 - 20% of the CPU, (or even more depending on load average)
  ...
  === nice bug ===   Fixing this is the main point of this commit.  We use
  ...
--

These changes was before 4.x, so they are in 4.x and -current
and they solved troubles with stealing CPU cycles.

However, there was next fix
???: http://www.FreeBSD.org/cgi/getmsg.cgi?fetch=63385+66222+/usr/local/www/db/text/2000/cvs-all/20000507.cvs-all =
--
green       2000/04/30 11:33:44 PDT
  ...
  Change the scheduler to actually respect the PUSER barrier.  It's been
  wrong for many years that negative niceness would lower the priority
  ...
  The breakage could (and did) cause lock-ups, basically nothing else
  but the least nice program being able to run in some conditions.  The
  ...
--

This change was made only in -current, so it is missing in 4.x branch.
After this change, processes in -current with nice 20 again steal CPU
cycles from processes without nice. If I run commands
--
nice -0 perl -e 'while(1){}' &
nice -20 perl -e 'while(1){}' &
--
after some time top shows time 11:30 for perl-nice-0 and 4:00 (!!!)
for perl-nice-20. I think that it is even worse than before commit
on 1999/11/28.

After reading commit logs, I understand that:

* Scheduling in -current should not cause locks, but nice is again broken.
* Scheduling in -stable can cause locks (?!?), but nice works perfectly.

I could not believe that my understandings are correct. Please, could
anybody explain to me the real scheduler status?

Thanks.

-- 
Rudolf Cejka   (cejkar@dcse.fee.vutbr.cz;  http://www.fee.vutbr.cz/~cejkar)
Brno University of Technology, Faculty of El. Engineering and Comp. Science
Bozetechova 2, 612 66  Brno, Czech Republic


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010201192304.A54677>