[ruby-core:32721] Re: [Ruby 1.9-Bug#3919][Open] Ruby in PowerTOP - too many CPU wakeups

From: Mark Somerville <mark@...>
Date: 2010-10-08 09:38:19 UTC
List: ruby-core #32721
On Fri, Oct 08, 2010 at 03:28:26PM +0900, Suraj Kurapati wrote:
> Bug #3919: Ruby in PowerTOP - too many CPU wakeups
> http://redmine.ruby-lang.org/issues/show/3919

This is a duplicate of #3436.

> Ruby causes too many CPU wakeups according to Intel's PowerTOP tool.
> For example, this simple I/O bound program causes 99 wakeups/second
> and accounts for 14% of the CPU wakeups on my system:
> 
>   ruby -e gets
> 
> Please make Ruby more power-efficient!  Thanks for your consideration.

This is caused by the timer thread. It's not easy to remove the timer
thread completely, however in ruby-core:32686 [1] I submitted a patch to
only use the timer thread when it is required to schedule Ruby threads.
With that patch, the timer thread is not used in single-threaded
applications.

Feedback on my approach to this problem would be greatly appreciated,
since this is an important issue for me. The code seems sound, but
perhaps there are some intricacies I've missed. Any thoughts?

1. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/32686

In This Thread