Re: High CPU usage of scheduler?

From: Dave Johansen
Date: Fri Apr 27 2012 - 11:23:51 EST


On Thu, Apr 26, 2012 at 8:10 PM, Yong Zhang <yong.zhang0@xxxxxxxxx> wrote:
>
> On Thu, Apr 26, 2012 at 03:08:51PM -0700, Dave Johansen wrote:
> > I am looking into moving an application from RHEL 5 to RHEL 6 and I
> > noticed an unexpected increase in CPU usage. A little digging has led
> > me to believe that the scheduler may be the culprit.
> >
> > I created the attached test_select_work.c file to test this out. I
> > compiled it with the following command on RHEL 5:
> >
> > cc test_select_work.c -O2 -DSLEEP_TYPE=0 -Wall -Wextra -lm -lpthread
> > -o test_select_work
>
> Hmm...Do both RHEL 5 and RHEL 6 have high resolution timer enabled?
>
> If not, could you please try to boot the one which enable high resolution
> timer with 'highres=off' to see if things change?

Yes, RHEL 6 has CONFIG_HIGH_RES_TIMERS=y. I rebooted and used the
'highres=off' in grub and got the following results:

./test_select_work 1000 10000 300 4
time_per_iteration: min: 3130.1 us avg: 3152.2 us max: 3162.2 us
stddev: 15.0 us
./test_select_work 1000 10000 300 8
time_per_iteration: min: 4314.6 us avg: 4407.9 us max: 4496.3 us
stddev: 60.6 us
./test_select_work 1000 10000 300 40
time_per_iteration: min: 8901.7 us avg: 9056.5 us max: 9121.3 us
stddev: 57.5 us

Any other info that might be helpful?

Thanks,
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/