Skip to content

regions: refactor for 64-bit region ids, dropping region table #4176

Merged
crusso merged 13 commits intomultiple-stable-memoryfrom
claudio/msm-64-bit-region-id
Aug 23, 2023
Merged

regions: refactor for 64-bit region ids, dropping region table #4176
crusso merged 13 commits intomultiple-stable-memoryfrom
claudio/msm-64-bit-region-id

Conversation

@crusso
Copy link
Copy Markdown
Contributor

@crusso crusso commented Aug 18, 2023

Builds on #3768.

With future GC in mind, use inexhaustible 64-bit region id, and drop dense region table, instead encoding size per block, not region, as partial, block level page counts. Regions can be recovered from the sparse representation in the block table.

Region recovery now does two linear scans of block table to recover region page_count followed by block recovery.

Actually metadata memory overhead from 9 to 6 pages, by removing 12 (8 byte pagecount + 4 reserve) bytes per region entry but adding 7 = (64-bit region id + 1 byte size) bytes per block entry.

@crusso crusso changed the base branch from master to multiple-stable-memory August 18, 2023 23:16
Comment thread test/run-drun/repro.mo Outdated
@crusso crusso marked this pull request as ready for review August 21, 2023 22:28
@crusso crusso changed the title WIP regions: refactor for 64-bit region ids, dropping region table regions: refactor for 64-bit region ids, dropping region table Aug 21, 2023
Comment thread rts/motoko-rts/src/region.rs Outdated
Comment thread rts/motoko-rts/src/region.rs Outdated
Comment thread rts/motoko-rts/src/region.rs Outdated
Comment thread src/codegen/compile.ml
Comment thread rts/motoko-rts/src/region.rs Outdated
Comment thread rts/motoko-rts/src/region.rs
Comment thread rts/motoko-rts/src/region.rs
Copy link
Copy Markdown
Contributor

@luc-blaeser luc-blaeser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good. Not having to recycle region IDs simplifies a lot.

Co-authored-by: Luc Blaeser <112870813+luc-blaeser@users.noreply.github.com>
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Aug 22, 2023

⚠️ The sha of the head commit of this PR conflicts with #4180. Mergify cannot evaluate rules on this PR. ⚠️

Co-authored-by: Luc Blaeser <112870813+luc-blaeser@users.noreply.github.com>
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Aug 22, 2023

⚠️ The sha of the head commit of this PR conflicts with #4180. Mergify cannot evaluate rules on this PR. ⚠️

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Aug 22, 2023

⚠️ The sha of the head commit of this PR conflicts with #4180. Mergify cannot evaluate rules on this PR. ⚠️

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Aug 22, 2023

⚠️ The sha of the head commit of this PR conflicts with #4180. Mergify cannot evaluate rules on this PR. ⚠️

@crusso
Copy link
Copy Markdown
Contributor Author

crusso commented Aug 23, 2023

@luc-blaeser PTAL

Comment thread rts/motoko-rts/src/region.rs
Comment thread rts/motoko-rts/src/region.rs Outdated
Comment thread rts/motoko-rts/src/region.rs Outdated
Copy link
Copy Markdown
Contributor

@luc-blaeser luc-blaeser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Also the recent changes look good.

Co-authored-by: Luc Blaeser <112870813+luc-blaeser@users.noreply.github.com>
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Aug 23, 2023

⚠️ The sha of the head commit of this PR conflicts with #4180. Mergify cannot evaluate rules on this PR. ⚠️

@crusso crusso merged commit 0c2a7ae into multiple-stable-memory Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants