Allan wrote:
Hi,
I am looking to measure how long a thread takes to migrate between cpu's and how often , what I have is below which is checking just one process is this the correct track to be on here?
My aim is to look at a process and look at upping the reboose_interval on some
of our servers.
#!/usr/sbin/dtrace -s
sched:::off-cpu
{
self->cpu = cpu;
self->timestamp=timestamp;
}
sched:::on-cpu /self->cpu != cpu && execname=="mstragent"/
{
printf("%s migrated from cpu %d to cpu %d nsec:%d
\n",execname,self->cpu,cpu,timestamp-self->timestamp);
printf("%s migrated from cpu %d to cpu %d ms:%d
\n",execname,self->cpu,cpu,(timestamp-self->timestamp)/1000000);
self->cpu = 0;
self->timestamp = 0;
}
[snip]
Hi Alan
Your script is not accounting for CPU 0, so you need to set a thread
local flag variable on the off-cpu probe, and predicate the on-cpu on that.
If you're looking at reducing migrations, the nosteal_nsec variable
determines how long a thread should remain in the runq before the
scheduler allows it to be stolen by another CPU. Increasing it might
help you lower migrations.
Rafael
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org