Subject: Re: [sup-devel] really high wakeup count in powertop

From: Chris Mason <[email-masked]>
Date: Wed, 10 Nov 2010 09:41:30 -0500

Excerpts from Chris Mason's message of 2010-11-09 19:40:58 -0500:
> Hi everyone,
> 
> I'm new to sup and really like the interface and the features.  But, I
> popped up powertop while it was running and sup accounts for a constant 100
> wakeups/second, much more than the one or two wakeups/sec from our old
> friend mutt.
> 
> I haven't done much ruby but can make my way through most things.  If
> someone could point me at the polling function most likely to cause the
> wakeups I can work out a patch.
> 
> I'm running git from this Monday, so pretty recent.  Ruby 1.9.1

(This got dumped into the moderator approval queue, so I'm resending,
this time with more details)

strace showed we were hammering on futexes, and a little digging made it
clear sup isn't to blame.  The ruby timer thread is polling for
signals (or something) every 10ms:

http://redmine.ruby-lang.org/issues/show/3436

I patched up ruby to poll every 500ms and things seem to work.  Not sure
why the ruby developers didn't just change the timeout, but chances are
good they have a real reason.  I'll post to that bug.

-chris
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: William Morgan <[email-masked]>
Date: Wed, 10 Nov 2010 13:35:41 -0500

Reformatted excerpts from Chris Mason's message of 2010-11-10:
> I patched up ruby to poll every 500ms and things seem to work.  Not
> sure why the ruby developers didn't just change the timeout, but
> chances are good they have a real reason.

Yeah, the last time someone investigated this, they decided it was a
Ruby issue as well. Keep us informed if that patch gets applied. You
could also try 1.9.2 for kicks.
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Chris Mason <[email-masked]>
Date: Tue, 09 Nov 2010 19:40:58 -0500

Hi everyone,

Thanks!

-chris

---

From: Gaute Hope <[email-masked]>
Date: Wed, 10 Nov 2010 17:13:48 +0100

> good they have a real reason.  I'll post to that bug.

Also noticed sup in powertop; so there's nothing to do on the Sup side ?

- gaute

---

From: Chris Mason <[email-masked]>
Date: Wed, 10 Nov 2010 15:18:58 -0500

> could also try 1.9.2 for kicks.

The 500ms patch apparently isn't good because it limits how often ruby
can switch between threads.  This seems strange to me, because the
kernel should be scheduling the threads, so I'll ask again.

At any rate, it did trigger some discussion and doesn't seem to be fixed
yet in any ruby version.

(For sup uses, 500ms works just fine, and that's my only ruby app).

-chris