Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
seti@home and nice
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
cmay4
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2002
Posts: 109

PostPosted: Mon Mar 31, 2003 9:12 pm    Post subject: seti@home and nice Reply with quote

I thought that if something was niced to 19, then it would essentially idle if other things were using the cpu. This doesn't seem to be the case. Look at the top output:

Code:

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
26633 may       18   0 56156  54M  4048 R    84.3 21.9   0:37 cc1plus
24802 root      19  19 14836  14M   788 R N  13.7  5.7  75:50 setiathome
26618 may       10   0  1152 1152   824 R     1.9  0.4   0:00 top


Normally the cc1plus gets just about all of the cycles (> 98%). Shouldn't setiathome be close to 0%?

Is this just my misunderstanding of nice?
Back to top
View user's profile Send private message
sputnik1969
Guru
Guru


Joined: 08 Aug 2002
Posts: 401
Location: Berlin / Germany

PostPosted: Tue Apr 01, 2003 12:02 am    Post subject: Reply with quote

cc1plus CAN'T use all cycles, because it has sometime to wait for fileoperations and similar. In this moment the scheduler switches to setiathome and it's getting "his" part of the CPU for a while.
_________________
'Cynic' is a word invented by optimists to criticize realists. - Nigel. In the ocean of Night by Gregory Benford
"Zyniker" ist ein Wort das Optimisten erfunden haben um Realisten zu kritisieren. - Nigel. Im Meer der Nacht von Gregory Benford
Back to top
View user's profile Send private message
cmay4
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2002
Posts: 109

PostPosted: Tue Apr 01, 2003 2:32 am    Post subject: Reply with quote

sputnik1969 wrote:
cc1plus CAN'T use all cycles, because it has sometime to wait for fileoperations and similar. In this moment the scheduler switches to setiathome and it's getting "his" part of the CPU for a while.

How about this Python script:
Code:
#!/usr/bin/env python

while 1:
    pass

which produces the same results:
Code:
  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
  925 may       16   0  2144 2144  1576 R    84.1  0.8   1:16 python
24802 root      19  19 15864  15M   788 R N  13.8  6.1 389:38 setiathome

It seems to me that that script should definitely get 100% of the CPU.
Back to top
View user's profile Send private message
sputnik1969
Guru
Guru


Joined: 08 Aug 2002
Posts: 401
Location: Berlin / Germany

PostPosted: Tue Apr 01, 2003 3:29 am    Post subject: Reply with quote

cmay4 wrote:
sputnik1969 wrote:
cc1plus CAN'T use all cycles, because it has sometime to wait for fileoperations and similar. In this moment the scheduler switches to setiathome and it's getting "his" part of the CPU for a while.

How about this Python script:
Code:
#!/usr/bin/env python

while 1:
    pass

which produces the same results:
Code:
  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
  925 may       16   0  2144 2144  1576 R    84.1  0.8   1:16 python
24802 root      19  19 15864  15M   788 R N  13.8  6.1 389:38 setiathome

It seems to me that that script should definitely get 100% of the CPU.


No, it should NOT!
Linux-process-scheduling is based on Round-Robin and gives every process at every turnaround at least one timeslot (Priority 19), two slots with Prio 18, three with prio 17... and so on...
the process gets it's slot as long as he a) don't uses a kernelroutine which causes the process to wait or b) the schedules interrupts it cause it's time(slot) ends.

Try to run your Python-Script with Prio -10 and see what happens ;)

The Setiathome-process uses much less io then "normal" processes, so it will get more CPU then other processes with the same priority.

My opinion is, that the linux-schedule has to be tunend in future, to get "finer" granulation between the processes :) (Not 19 to -20 but -128 to 127 like in good old AMigaOS-Times)
_________________
'Cynic' is a word invented by optimists to criticize realists. - Nigel. In the ocean of Night by Gregory Benford
"Zyniker" ist ein Wort das Optimisten erfunden haben um Realisten zu kritisieren. - Nigel. Im Meer der Nacht von Gregory Benford
Back to top
View user's profile Send private message
cmay4
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2002
Posts: 109

PostPosted: Tue Apr 01, 2003 4:12 am    Post subject: Reply with quote

I'm sure it was my misunderstanding. I was just under the impression that something with that nice value would not (or at least barely) affect other running software. I made a slight modification:
Code:
#!/usr/bin/env python

for i in range(0,100000000):
    pass

And timed it with and without seti@home running.

Without seti@home: 57.348 secs
With seti@home: 60.186 secs

Roughly a 5% difference; not a big deal. If in general we are talking about 5%, then it's not that big a deal.

I'm going to try kernel compiles next...
Back to top
View user's profile Send private message
sputnik1969
Guru
Guru


Joined: 08 Aug 2002
Posts: 401
Location: Berlin / Germany

PostPosted: Tue Apr 01, 2003 4:46 am    Post subject: Reply with quote

cmay4 wrote:

Without seti@home: 57.348 secs
With seti@home: 60.186 secs

Roughly a 5% difference; not a big deal. If in general we are talking about 5%, then it's not that big a deal.

I'm going to try kernel compiles next...


I never tested things like this, the only thing i know is, that i kill seti if i plan to play a 3d-shooter or similar, because you see the difference (small drops in performance are "viewable" )

In all other cases, i think a "loss" of cpupower up to 10% is tolerable with my XP1900 ;)
_________________
'Cynic' is a word invented by optimists to criticize realists. - Nigel. In the ocean of Night by Gregory Benford
"Zyniker" ist ein Wort das Optimisten erfunden haben um Realisten zu kritisieren. - Nigel. Im Meer der Nacht von Gregory Benford
Back to top
View user's profile Send private message
cmay4
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2002
Posts: 109

PostPosted: Tue Apr 01, 2003 4:50 am    Post subject: Reply with quote

Kernel compile numbers:

With seti@home: 13min 30sec
Without seri@home: 11min 32sec

Or 14.5% slower with seti@home. 5% is one thing, but that is too much.

Doesn't that seem to be too large a difference?
Back to top
View user's profile Send private message
nempo
Guru
Guru


Joined: 16 Apr 2002
Posts: 360
Location: Linkoping, Sweden

PostPosted: Tue Apr 01, 2003 2:18 pm    Post subject: Reply with quote

Everytime I've had seti@home running I've been unable to run any kind of opengl software, why? well every 2s or so the rendering stops for ½s and then continues, this constantly happens. Seti@home was running at 19 while the opengl ran at the default 0.
_________________
homeobocks wrote:
superjaded wrote:

would Big Brother become a reality?

Yeah . . . it would be just like the tv show. Except somebody would be watching.
Back to top
View user's profile Send private message
sputnik1969
Guru
Guru


Joined: 08 Aug 2002
Posts: 401
Location: Berlin / Germany

PostPosted: Tue Apr 01, 2003 2:46 pm    Post subject: Reply with quote

Everything here are based upon the same problem:

Linux doesn't know "true" idle-processes and the priority-system isn't "fine" enough...
Multiprocessing under Linux works with "timeslices" / slots.
If there are 2 processes running with different priorities (e.g. process Seti Prio 19 and Q3A Prio 0) both processes share the slots, seti gets at least minimal 1 slot of 20 (difference between priority of Seti and Q3A) and Q3A gets the rest... But this single timeslice has the effect, that 1/20 (5%) of the time quake has to wait for seti, even if seti should be idle :(
If priority-system would range from -128 to 127 (like Amiga-OS) and Seti would run with 127 and Q3A with 0, it would get at least 1/128 (<1%)
But then timeslices have to be shorter, or latency will be a really big problem ;)
Also this needs more cputime for the scheduler :(
_________________
'Cynic' is a word invented by optimists to criticize realists. - Nigel. In the ocean of Night by Gregory Benford
"Zyniker" ist ein Wort das Optimisten erfunden haben um Realisten zu kritisieren. - Nigel. Im Meer der Nacht von Gregory Benford
Back to top
View user's profile Send private message
cmay4
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2002
Posts: 109

PostPosted: Tue Apr 01, 2003 4:58 pm    Post subject: Reply with quote

Thanks for the input. I appreciate your help.

I have one question though. I've read about the new scheduler in the 2.5 kernel. Would it make any difference in this situation?
Back to top
View user's profile Send private message
zephyr1256
Apprentice
Apprentice


Joined: 10 Mar 2003
Posts: 170
Location: Kingsport, TN

PostPosted: Tue Apr 01, 2003 8:01 pm    Post subject: Reply with quote

I have to turn Seti off for opengl apps and for one other case(that I've found so far), whenever I use openoffice.org, seti has to be turned off. Often OO won't even display if I switch to the screen that has it if seti is running. :? Nice levels don't help with this, I always use 19, but Seti, unlike most other programs is highly CPU bound. I guess some programs often do system calls but they depend on getting the CPU again sooner than they do with Seti running. Programs like that need to have Seti shut down(or relegated to another processor if you are fortunate to have a MP machine).
Back to top
View user's profile Send private message
sputnik1969
Guru
Guru


Joined: 08 Aug 2002
Posts: 401
Location: Berlin / Germany

PostPosted: Fri Apr 04, 2003 2:41 am    Post subject: Reply with quote

zephyr1256 wrote:
I have to turn Seti off for opengl apps and for one other case(that I've found so far), whenever I use openoffice.org, seti has to be turned off. Often OO won't even display if I switch to the screen that has it if seti is running. :?


Sorry, Dude, I don't know what kind of machine you are running, but my AthlonXP1900+/512MB SD-133 has got no problem with seti and oo...
Sometime oo needs a little more time to update it's display, but i can live with it ;) Also mplayer creates high cpuload with hires-videos (with high postprocessing settings) and i don't habe seen any problems yet.
_________________
'Cynic' is a word invented by optimists to criticize realists. - Nigel. In the ocean of Night by Gregory Benford
"Zyniker" ist ein Wort das Optimisten erfunden haben um Realisten zu kritisieren. - Nigel. Im Meer der Nacht von Gregory Benford
Back to top
View user's profile Send private message
sputnik1969
Guru
Guru


Joined: 08 Aug 2002
Posts: 401
Location: Berlin / Germany

PostPosted: Fri Apr 04, 2003 2:53 am    Post subject: Reply with quote

cmay4 wrote:
Thanks for the input. I appreciate your help.

I have one question though. I've read about the new scheduler in the 2.5 kernel. Would it make any difference in this situation?


I haven't testet the new scheduler and shame on me, i didn't inform myself about internels of the new scheduler yet. but i will do soon...
_________________
'Cynic' is a word invented by optimists to criticize realists. - Nigel. In the ocean of Night by Gregory Benford
"Zyniker" ist ein Wort das Optimisten erfunden haben um Realisten zu kritisieren. - Nigel. Im Meer der Nacht von Gregory Benford
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum