Re: Idle priority
Re: Idle priority
- Subject: Re: Idle priority
- From: Mike Mimic <email@hidden>
- Date: Thu, 30 Jul 2009 03:34:10 -0700 (PDT)
Hi!
> If you did all that and shark still showed 60/40 when you
> think your preferred app should have taken more CPU, and you
> verified your app is not stalling naturaly with a CPU
> intensive dummy load for comparison, you should file a bug
> report, including your shark trace.
I do not know if he has done it, but I have done some testing before writing to this mailing list. I have used two programs, named "nice":
int main(int argc, char *argv[]) {
if (setpriority(PRIO_PROCESS, 0, 20) != 0) {
perror("setpriority");
return 1;
}
int j;
for (j = 0; ; j++) {
printf("%d\n", j);
// Busy wait
int i;
for (i = 0; i < 100000000; i++);
}
return 0;
}
(Notice that this program has also IO so it can also block and thus leave even more CPU to higher prioritized processes.)
and "load":
int main(int argc, char *argv[]) {
unsigned int i;
for (i = 0; i < 4000000000U; i++);
}
(Just CPU operations, no IO, no threading, nothing.)
I have been measuring it on a 8 CPU system. I have ran:
for i in {1..8}; do (time ./load &) 2>> log ; done
and measured it 10 times.
Then I ran first 8 "nice" processes and left them running. And then I repeated 10 measurements with "load" program.
for i in {1..8}; do ./nice > /dev/null & done
for i in {1..8}; do (time ./load &) 2>> log.nice ; done
In the first case I got such values:
- user time
- mean: 10.0283
- standard deviation: 0.0008
- real time
- mean: 10.1099
- standard deviation: 0.0731
In the seconds case I got such values:
- user time
- mean: 10.0284
- standard deviation: 0.0005
- real time
- mean: 18.3226
- standard deviation: 0.2548
So instead of 10 seconds dummy program ran 18 seconds because eight processes with the lowest possible priority run at the same time. This is not really "run only while idle" behavior.
Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden