The goal is to optimize the way the PageTracker updates huge pages, by acting only on the head page rather than updating all the 4k pages from the huge page range.
When a huge page is mapped into a TVM, we can manage only the head page through the block/unblock lifecycle. When the TVM gets destroyed, we need all the pages to be back to a proper state, which is why we force the subpages to be the same state as the head page.
We also need to handle the case where a page range is shared differently. In that case, we can't assume two TVMs share the page at the same granularity, which is why we can't manipulate only the head page, but instead we must update all the subpages.
Last thing, we must handle a page demotion in a special way, by updating all the subpages states, given the demotion happened while the PageTracker was operating only on the head page of the huge page.
The goal is to optimize the way the PageTracker updates huge pages, by acting only on the head page rather than updating all the 4k pages from the huge page range.
When a huge page is mapped into a TVM, we can manage only the head page through the block/unblock lifecycle. When the TVM gets destroyed, we need all the pages to be back to a proper state, which is why we force the subpages to be the same state as the head page.
We also need to handle the case where a page range is shared differently. In that case, we can't assume two TVMs share the page at the same granularity, which is why we can't manipulate only the head page, but instead we must update all the subpages.
Last thing, we must handle a page demotion in a special way, by updating all the subpages states, given the demotion happened while the PageTracker was operating only on the head page of the huge page.