> Another other way to "fix" the problem is to have the compute-
> intensive process voluntarily relinquish its timeslice at intervals
> which are much shorter than the minimum timeslice (which is
> typically of the order of 200 ms). This reduces the efficiency of the
> compute-intensive task to some extent but does make it coexist
> better. I suppose it would be possible to build this into Prime95; if
> this is done I would like options to be "multimedia friendly" or
> "optimally efficient" - probably the best way to implement would be
> to have the code contain the relevant system calls but to NOOP
> over them if efficiency is demanded.

I've made good experience with throwing a sched_yield() into the MFAC
code. The machines MFAC was running on had a Linux 2.4 kernel which 
gives even niceness 19 process about 10% cpu when another normal 
niceness process is running, which some users complained about.

I wasn't particularly careful where I put the sched_yield(), I think it
was called far more often than neccesary (many times/ms) but the effect 
on performance was not that dramatic - about 5% slowdown. The overhead 
in the scheduler seems to be pretty low.

With that, when another process was running, MFAC worked at about 1/1000
the normal speed, so it must have gotten less than 0.1 % cpu time. Users 
were happy again.

Perhaps the performance loss can be reduced by placing the yield
somewhere in the code where the data currently in cache is finished 
and new data must be read from memory. If another process wants to 
run, at least it'll throw data out of the cache that we dont need 
anymore anyways (let some other job do our dirty flushing).

Alex
_________________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to