Closed
Bug 499359
Opened 17 years ago
Closed 17 years ago
code alloc should use a freelist so allocation is O(1) on average
Categories
(Tamarin Graveyard :: Baseline JIT (CodegenLIR), defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: edwsmith, Assigned: tharwood)
Details
Attachments
(1 file)
|
8.07 KB,
patch
|
rreitmai
:
review+
edwsmith
:
superreview+
|
Details | Diff | Splinter Review |
current impl walks all the pages on every alloc, which gets expensive when there are lots of pages.
| Assignee | ||
Updated•17 years ago
|
Assignee: nobody → tharwood
| Assignee | ||
Comment 1•17 years ago
|
||
Easily done via freelist; segregated freelists would also be goodness if we have any allocation data.
| Reporter | ||
Comment 2•17 years ago
|
||
this allocator is unique because the client doesn't know how much memory it needs; it can use whatever block size is returned, above a minimum size (which is the parameter to alloc()). so theres reason to be optimistic that a simple any-block-will-do freelist is enough.
Comment 3•17 years ago
|
||
If the client can make a really cheap guess that's in the ball park more often than not then the allocator could conceivably make use of that to find a good block. Maybe that's for version 2 though :-)
| Assignee | ||
Comment 4•17 years ago
|
||
Attachment #389928 -
Flags: superreview?(edwsmith)
Attachment #389928 -
Flags: review?(rreitmai)
| Reporter | ||
Comment 5•17 years ago
|
||
any reason to be concerned with the O(N) traversal to remove a block from the free list when it gets coalesced with a neighbor? at the moment, tamarin-redux doesn't really free code much, so probably not. possible fix would be to make the freelist doubly linked. (doubly more tricky pointer code, but cheap since the back pointer can be overlapped with the data area of a block).
| Assignee | ||
Comment 6•17 years ago
|
||
re: comment #5, I wrote doubly-linked list code and then tore it out. Two reasons:
1. The length of the avail list is much shorter than the length of the master list;
2. This coalescing code was not executed in any of the more-complex testcases I have readily to hand (i.e., utils, esc, various optimizer tests). In fact, thanks for reminding me I need to circle back and check with you and QE to get a testcase, I presume we do have testcases that exercise it...
| Reporter | ||
Comment 7•17 years ago
|
||
(In reply to comment #6)
> re: comment #5, I wrote doubly-linked list code and then tore it out. Two
> reasons:
>
> 1. The length of the avail list is much shorter than the length of the master
> list;
> 2. This coalescing code was not executed in any of the more-complex testcases
> I have readily to hand (i.e., utils, esc, various optimizer tests). In fact,
> thanks for reminding me I need to circle back and check with you and QE to get
> a testcase, I presume we do have testcases that exercise it...
cool. simple is good. the only way to really exersize free() is to make code get unloaded, which can be (is?) convoluted. we might be able to build a self-test harness that runs the 2nd phase of the jit N times.
testing within the (old) thrashy jit-cache code would work too but will take a lot of rebasing to get to a testable state.
| Reporter | ||
Updated•17 years ago
|
Attachment #389928 -
Flags: superreview?(edwsmith) → superreview+
Updated•17 years ago
|
Attachment #389928 -
Flags: review?(rreitmai) → review+
| Reporter | ||
Updated•17 years ago
|
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 8•16 years ago
|
||
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•