mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-23 07:12:12 -07:00
Improving design document with references and separating ideas from current implementation.
Copied from Perforce Change: 190214 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
b8c51be19d
commit
b720a44d65
2 changed files with 31 additions and 9 deletions
|
|
@ -675,7 +675,7 @@
|
|||
* TODO: These settings were determined by trial and error, but should
|
||||
* be based on measurement of the protection overhead on each
|
||||
* platform. We know it's extremely different between OS X and
|
||||
* Windows, for example.
|
||||
* Windows, for example. See design.mps.write-barrier.improv.by-os.
|
||||
*
|
||||
* TODO: Consider basing the count on the amount of time that has
|
||||
* passed in the mutator rather than the number of scans.
|
||||
|
|
|
|||
|
|
@ -39,12 +39,9 @@ logical AND operation.
|
|||
Write barrier deferral
|
||||
----------------------
|
||||
|
||||
.deferral: The overheads hardware barriers varies widely between
|
||||
operating systems. On Windows it is very cheap to change memory
|
||||
protection and to handle protecion faults. On OS X it is very
|
||||
expensive. The balance between barriers and scanning work is
|
||||
different. There is no point in spending 1000 CPU units raising a
|
||||
write barrier to avoid 10 CPU units of scanning cost.
|
||||
.deferral: Both scanning and the write barrier cost CPU time, and
|
||||
these must be balanced. There is no point spending 1000 CPU units
|
||||
raising a write barrier to avoid 10 CPU units of scanning cost.
|
||||
|
||||
The MPS balances these costs with write barrier deferral. The write
|
||||
barrier is not immediately raised when a segment is scanned. Instead,
|
||||
|
|
@ -60,13 +57,38 @@ three events:
|
|||
|
||||
3. a barrier hit (``WB_DEFER_HIT``)
|
||||
|
||||
See also job003975.
|
||||
|
||||
Improvements
|
||||
------------
|
||||
|
||||
.improv.by-os: The overheads hardware barriers varies widely between
|
||||
operating systems. On Windows it is very cheap to change memory
|
||||
protection and to handle protecion faults. On OS X it is very
|
||||
expensive. The balance between barriers and scanning work is
|
||||
different. We should measure the relative costs and tune the deferral
|
||||
for each separately.
|
||||
|
||||
.improv.balance: Hardware costs of write barriers vary by OS, but
|
||||
scanning costs vary depending on many factors including client code.
|
||||
The MPS could dynamically measure these costs, perhaps using fast
|
||||
cycle counters such as RDTSC, and use this to dynamically balance the
|
||||
write barrier deferral.
|
||||
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
.. [job003975] "Poor performance due to imbalance between protection
|
||||
and scanning costs"; Richard Brooksby; Ravenbrook
|
||||
Limited; 2016-03-11;
|
||||
<http://www.ravenbrook.com/project/mps/issue/job003975>.
|
||||
|
||||
|
||||
Document History
|
||||
----------------
|
||||
|
||||
- 2016-03-19 RB_ Created.
|
||||
- 2016-03-19 RB_ Created during preparation of
|
||||
branch/2016-03-13/defer-write-barrier for [job003975]_.
|
||||
|
||||
.. _RB: http://www.ravenbrook.com/consultants/rb/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue