Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(63)

Issue 12298043: code review 12298043: runtime: disable preemption during software fp routines (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by rsc
Modified:
11 years, 10 months ago
Reviewers:
dave
CC:
golang-dev, dave_cheney.net
Visibility:
Public.

Description

runtime: disable preemption during software fp routines It's okay to preempt at ordinary function calls because compilers arrange that there are no live registers to save on entry to the function call. The software floating point routines are function calls masquerading as individual machine instructions. They are expected to keep all the registers intact. In particular, they are expected not to clobber all the floating point registers. The floating point registers are kept per-M, because they are not live at non-preemptive goroutine scheduling events, and so keeping them per-M reduces the number of 132-byte register blocks we are keeping in memory. Because they are per-M, allowing the goroutine to be rescheduled during software floating point simulation would mean some other goroutine could overwrite the registers or perhaps the goroutine would continue running on a different M entirely. Disallow preemption during the software floating point routines to make sure that a function full of floating point instructions has the same floating point registers throughout its execution.

Patch Set 1 #

Patch Set 2 : diff -r c8da77d7e912 https://code.google.com/p/go #

Patch Set 3 : diff -r c8da77d7e912 https://code.google.com/p/go #

Patch Set 4 : diff -r c8da77d7e912 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -0 lines) Patch
M src/pkg/runtime/vlop_arm.s View 1 2 chunks +23 lines, -0 lines 0 comments Download

Messages

Total messages: 3
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 10 months ago (2013-08-01 23:54:30 UTC) #1
dave_cheney.net
LGTM. Thank you. On Fri, Aug 2, 2013 at 9:54 AM, <rsc@golang.org> wrote: > Reviewers: ...
11 years, 10 months ago (2013-08-02 00:01:27 UTC) #2
rsc
11 years, 10 months ago (2013-08-02 00:07:07 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=1e60fa9306de ***

runtime: disable preemption during software fp routines

It's okay to preempt at ordinary function calls because
compilers arrange that there are no live registers to save
on entry to the function call.

The software floating point routines are function calls
masquerading as individual machine instructions. They are
expected to keep all the registers intact. In particular,
they are expected not to clobber all the floating point
registers.

The floating point registers are kept per-M, because they
are not live at non-preemptive goroutine scheduling events,
and so keeping them per-M reduces the number of 132-byte
register blocks we are keeping in memory.

Because they are per-M, allowing the goroutine to be
rescheduled during software floating point simulation
would mean some other goroutine could overwrite the registers
or perhaps the goroutine would continue running on a different
M entirely.

Disallow preemption during the software floating point
routines to make sure that a function full of floating point
instructions has the same floating point registers throughout
its execution.

R=golang-dev, dave
CC=golang-dev
https://codereview.appspot.com/12298043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b