In message <1053278090EUF.fvw at jareth.var.cx>, Frank v Waveren 
<fvw+freenet at stack.nl> writes
>On Sun, May 18, 2003 at 05:14:33PM +0100, Roger Hayter wrote:
>> With nice -10 there is much more context switching and paging,
>> presumably because threads are not being allowed to finish what they are
>> doing.  In both cases, CPU is "idle" for 40-80% of time. Is there a way
>> of measuring "voluntary" and "involuntary" context switching in Linux? I
>> presume a thread waiting for bandwidth in some way will voluntarily
>> relinquish control of the CPU.
>
>Yes, a process or (kernel) thread that tries to do IO without that
>being possible (buffer full, no data available etc) goes to sleep.
>
>Nice processese do indeed get smaller timeslices, which will hurt
>something as multithreaded as fred a lot. Try running all non-freenet
>processes at a scheduling prio higher than fred (see the schedutils
>package for chrt, a tool to change scheduling class and prio) without
>decreasing it's timeslice, or use kaffe, which does userspace
>threading and thus shouldn't get hurt too much by smaller timeslices.

I wonder what proportion of people are using Fred on a multi-purpose 
Linux machine and need Fred niced by default?  My machine is running 
Freenet and one or two other low-priority servers, and works much better 
without nice -10, as there is nothing I want to have a higher priority. 
Perhaps this is still the best default option, but I just wanted to 
raise the question.

>
>Keep in mind that in that setup freenet won't get a single tick of
>cputime as long as someone else wants it though, so anybody can
>disable freenet on your machine if they can force something to use
>100% CPU, and it can interact badly with things that want to use
>freenet but use 100% cpu while doing so.
>
>Or if you're feeling adventurous you could change the NICE_TO_TICKS
>macro in linux/kernel/sched.c and adjust the scheduling to favour less
>nice tasks a little more, and having it do all slices equally long.
>

-- 
Roger Hayter
_______________________________________________
devl mailing list
devl at freenetproject.org
http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/devl

Reply via email to