Address Spaces

Not only have caches progressed from a buffer orientation to a page orientation during the course of Linux development, but also the way in which cached data are linked with their sources has been replaced with a more general schema as compared to previous Linux versions. Whereas in the early days of Linux and other Unix derivatives, inodes were the only objects that acted as the starting point for obtaining data from cache contents, the kernel now uses much more general address spaces that establish the link between cached data and the objects and devices required to obtain the data. Although file contents still account for much of the data in caches, the interfaces are so generalized that the caches are also able to hold data from other sources in order to speed access.

How do address spaces fit into the structures of the page cache? They implement a translation mechanism between two units:

1. Pages in main memory are allocated to each address space. The contents of these pages can be manipulated by user processes or by the kernel itself using a variety of methods.

These data represent the contents of the cache.

2. The backing store specifies the sources from which the address space pages are filled. Address spaces relate to the virtual address space of the processor and are a mapping of the segment managed by the processor in virtual memory and the corresponding positions on a source device (using a block device).

If a position in virtual memory that is not associated with a physical page in memory is accessed, the kernel can refer to the address space structure to discover from where the data must be read.

To support data transfer, each address space provides a set of operations (in the form of function pointers) to permit interaction between the two sides of address space — for instance, to read a page from a block device or filesystem, or to write back a modified page. The following section takes a close look at the data structures used before examining the implementation of address space operations.

Address spaces are one of the most crucial data structures in the kernel. Their management has evolved to one of the central issues faced by the kernel. Numerous subsystems (filesystems, swapping, synchronization, caching) are centered around the concept of an address space. They can therefore be regarded as one of the fundamental abstraction mechanisms of the kernel, and range in importance among the traditional abstractions like processes and files.

Continue reading here: Info

Was this article helpful?

0 0