Operations on Regions
The kernel provides various functions to manipulate the regions of a process. Creating and deleting regions (and finding a suitable memory location for a new region) are standard operations needed when setting up or removing a mapping. The kernel is also responsible for performing optimizations when managing the data structures, as shown in Figure 4-10.
□ When a new region is added immediately before or after an existing region (and therefore also between two existing regions), the kernel merges the data structures involved into a single structure — but, of course, only if the access permissions for all the regions involved are identical and contiguous data are mapped from the same backing store.
□ If a deletion is made at the start or end of a region, the existing data structure must be truncated accordingly.
□ If a region between two other regions is deleted, the existing data structure is reduced in size, and a new data structure is created for the resultant new region.
A further important standard operation is the search for a region associated with a specific virtual address in userspace. Before explaining the optimizations mentioned above, let's discuss the helper function used to do this.
Continue reading here: Associating Virtual Addresses with a Region
Was this article helpful?