3 ms·
According to the link, GHC creates 1MiB megablocks, consisting of 4KiB blocks. So, each block would be a page, and a megablock consists of 256 pages. It seems
by crote 6y ago
According to the link, GHC creates 1MiB megablocks, consisting of 4KiB blocks. So, each block would be a page, and a megablock consists of 256 pages.
It seems that the problem with pinning is that a megablock will end up containing only a single block, leaving the space for the other blocks unused. The block can't be moved to another megablock because it is pinned, so it can't free the entire megablock.
My suggestion is to unmap the pages corresponding to the empty space in the megablock. So if a megablock only contains a single block, unmap the 255 empty pages.
- chrisseaton 6y ago> a megablock will end up containing only a single block That's the absolute worst case. Most likely case is many (most?) pages have one or two pinned objects in them. It only takes a small proportion of pages to be wasted like this for it to be a huge problem.