Bug 2341 - optimize locks for read-mostly variables
Summary: optimize locks for read-mostly variables
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: David Smith
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-15 17:20 UTC by Frank Ch. Eigler
Modified: 2007-03-30 16:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2006-02-15 17:20:11 UTC
This is a good task for someone who wants to dip a toe into the translator
optimizer.  They focus on the emit_locks/emit_unlocks functions in translate.cxx.

- elide all global variable lock/unlock operations from begin/end probes

- in translate_pass(), compute another varuse_collecting_visitor instance, over
all probes except begin/end probes; put it into a new c_unparser field
- within emit_locks/unlocks, elide a read lock that would be taken for a global,
if it turns out that it is not written to in any normal probe.  That is, if that
newly computed semi-global varuse_collecting_visitor instance does *not* note a
global as written-to, then we don't have to lock it here to read it safely.
Comment 1 Frank Ch. Eigler 2006-08-03 17:39:46 UTC
http://sourceware.org/ml/systemtap/2006-q3/msg00217.html
Comment 2 David Smith 2007-03-28 21:12:29 UTC
Changes to elide all global variable lock/unlock operations from begin/end
probes has been checked in.
Comment 3 David Smith 2007-03-30 17:10:52 UTC
The following has been implemented and checked in:

- in translate_pass(), compute another varuse_collecting_visitor instance, over
all probes except begin/end probes; put it into a new c_unparser field
- within emit_locks/unlocks, elide a read lock that would be taken for a global,
if it turns out that it is not written to in any normal probe.  That is, if that
newly computed semi-global varuse_collecting_visitor instance does *not* note a
global as written-to, then we don't have to lock it here to read it safely.