Ticket #1623 (closed bug: fixed)

Opened 6 years ago

Last modified 14 months ago

ghci: 20 wakeups per second

Reported by: igloo Owned by: simonmar
Priority: normal Milestone: 6.8.1
Component: Runtime System Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

From  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=438371 :

According to powertop on my laptop, ghci seems to wake up 20 times per
second looking for input when sitting at the command prompt.  This has
negative impact on battery life, as discussed on the powertop page.

I don't think the change in the HEAD to using timer_create rather than setitimer will have fixed this, but I can't currently run powertop so haven't been able to confirm that.

Change History

Changed 6 years ago by simonmar

  • difficulty changed from Unknown to Easy (1 hr)
  • component changed from Compiler to Runtime System

Yes, the ticker is set to always fire N times a second (default 50). It's not "looking for input", it is used for context switching and profiling. Also this isn't specific to GHCi; all GHC-compiled programs will do this.

We should really turn off the ticker when the system is idle.

Changed 6 years ago by simonmar

  • owner set to simonmar

I'm doing this

Changed 6 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

Fixed:

Mon Sep  3 06:25:23 PDT 2007  Simon Marlow <simonmar@microsoft.com>
  * FIX #1623: disable the timer signal when the system is idle (threaded RTS only)

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.1

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)

Changed 14 months ago by marlowsd@…

commit dd24d6bc37879c6b32a3d5ac4ee765e59e13501c

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Wed Apr 11 10:12:14 2012 +0100

    Disable the timer signal while blocked in select() (#5991)
    
    The threaded RTS had a fix for this a long time ago (#1623) but this
    patch applies a similar fix to the non-threaded RTS.

 rts/posix/Select.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
Note: See TracTickets for help on using tickets.