Closed
Bug 520080
Opened 15 years ago
Closed 13 years ago
mmap/munmap alignment when pagesize!=4k
Categories
(Tamarin Graveyard :: Garbage Collection (mmGC), defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
Future
People
(Reporter: chris, Unassigned)
References
Details
Attachments
(2 files, 1 obsolete file)
1.57 KB,
patch
|
Details | Diff | Splinter Review | |
1.89 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.14) Gecko/2009090217 Ubuntu/9.04 (jaunty) Firefox/3.0.14
Build Identifier:
The mmap/munmap system call with MAP_FIXED requires that the address be page aligned.
On a system with 16K pages I've observed that MMgcPortUnix.cpp:VMPI_decommitMemory attempts to munmap/mmap a 4k aligned page given to it by GCHeap::Decommit. The call fails which leads to an assertion failure in GCHeap::Decommit
Reproducible: Always
Steps to Reproduce:
I have only tested this on a MIPS system with 16K pages. Running any of the
sunspider performance tests (eg /performance/sunspider/date-format-tofte.abc) cause VMPI_decommitMemory to be called with a 4k aligned page.
Reporter | ||
Comment 1•15 years ago
|
||
This is a workaround for the problem I see. If the munmap fails, the address will still be valid so there is no need mmap it again. This patch also clears the area to zero to mimic the effect of munmap/mmap, but I don't know if anything else relies on this.
A better fix would be to persuade the higher level code to decommit memory in pagesize chunks.
Updated•15 years ago
|
Assignee: nobody → lhansen
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → flash10.1
Comment 2•15 years ago
|
||
Closely related to bug #513716.
Comment 3•15 years ago
|
||
(In reply to comment #1)
> A better fix would be to persuade the higher level code to decommit memory in
> pagesize chunks.
Agree. However, the higher level conflates management of committed memory with management of kBlockSize (4K) blocks, and fixing that may take some work.
Comment 4•15 years ago
|
||
(In reply to comment #3)
> Agree. However, the higher level conflates management of committed memory with
> management of kBlockSize (4K) blocks, and fixing that may take some work.
Specifically, it looks like we can easily fix this problem if we don't care about internal fragmentation in the memory returned from GCHeap (just make sure to alloc in appropriate multiples of 4K pages, and also split blocks in correct multiples of 4K pages), but on average for a 16K page size system we'll be wasting 8KB per allocation in the worst case - probably far too much in practice, and I suspect the common case is not much better. The fix for that appears to be decoupling the management of 4K blocks from the underlying VM blocks.
Updated•15 years ago
|
Priority: -- → P2
Comment 5•15 years ago
|
||
See also bug #513906.
Updated•15 years ago
|
Flags: flashplayer-triage+
Reporter | ||
Comment 6•15 years ago
|
||
These seem like useful assertions to highlight potential problems
Reporter | ||
Comment 7•15 years ago
|
||
Beefed up the workaround to deal with recent changes
This allows Tamarin to run on systems with 16K pages
Attachment #404144 -
Attachment is obsolete: true
Comment 8•15 years ago
|
||
(In reply to comment #7)
> Created an attachment (id=405742) [details]
> Update: Workaround for munmap alignment
>
> Beefed up the workaround to deal with recent changes
> This allows Tamarin to run on systems with 16K pages
I don't see how this can be right, unless you make assumptions about the order of requests from the GCHeap layer. It seems pretty arbitrary whether some memory will be decommitted at all (ie decommit is not reliable), and it seems like there's a hazard that you'll be touching uncommitted memory in the Commit operation.
For the time being the best option for MIPS may be to simply disable virtual memory. Since that option is available I will demote this bug to a P3 and remove the block it holds on the MIPS code landing.
Updated•15 years ago
|
Priority: P3 → P4
Updated•14 years ago
|
Priority: P4 → P2
Updated•14 years ago
|
Priority: P2 → P4
Updated•14 years ago
|
Priority: P4 → --
Target Milestone: Q3 11 - Serrano → Future
Marking as Resolved/WONTFIX. If this becomes necessary, let's discuss and reopen.
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: flashplayer-qrb+
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•