Project

General

Profile

Feature #9345

[PATCH] signal.c: avoid repeated disable/enable interrupt

Added by normalperson (Eric Wong) over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
[ruby-core:59480]

Description

We only install system-level signal handlers during init (before any
threads or user code is running), so there's no need to repeatedly
enable/disable the interrupts at that time. We also do not change
system-level sig handlers once user-level code is running.

This saves about 20 syscalls at startup and makes the executable
smaller:

text data bss dec hex filename
before: 2716694 24350 154680 2895724 2c2f6c ruby
after: 2716150 24350 154680 2895180 2c2d4c ruby

$ git pull git://bogomips.org/ruby.git sig-intr-init

The following changes since commit 834ea58a9b2eb698c760681c14a599a8941377ac:

  • 2014-01-03 (2014-01-02 15:10:19 +0000)

are available in the git repository at:

git://bogomips.org/ruby.git sig-intr-init

for you to fetch changes up to 9cc5aeb1a6a1cde504e899a5e3d59a0b4398c8cc:

signal.c: avoid repeated disable/enable interrupt (2014-01-02 22:22:58 +0000)


Eric Wong (1):
signal.c: avoid repeated disable/enable interrupt

signal.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)


Files

Updated by normalperson (Eric Wong) over 5 years ago

Updated patch against r48129:
http://80x24.org/spew/m/feature-9345-v2%40dcvr.txt

Will commit in a few days unless there are objections.

#2

Updated by Anonymous over 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r48178.


signal.c: avoid repeated disable/enable interrupt

We only install system-level signal handlers during init (before any
threads or user code is running), so there's no need to repeatedly
enable/disable the interrupts at that time. We also do not change
system-level sig handlers once user-level code is running.

This saves about 20 syscalls at startup and makes the executable
smaller (numbers from 32-bit x86):

    text       data     bss     dec     hex filename

before: 2815726 12100 30552 2858378 2b9d8a ruby
after: 2815022 12100 30552 2857674 2b9aca ruby

  • signal.c (install_sighandler): remove rb_disable_interrupt and rb_enable_interrupt calls (init_sigchld): ditto (Init_signal): disable and enable interrupt once around all install_sighandler and init_sigchld to reduce syscalls at start [Feature #9345] [ruby-core:59480]

Also available in: Atom PDF