struct address_space { struct inode struct radix_tree_root unsigned int struct prio_tree_root struct list_head unsigned long pgoff_t struct address_space_operations *a_ops; /* unsigned long flags; /*

struct backing_dev_info *backing_dev_info; struct list_head private_list; /*

struct address_space *assoc_mapping; /* } _attribute_((aligned(sizeof(long))));

owner: inode, block_device */ radix tree of all pages */

i_mmap_writable;/* count VM_SHARED mappings */

/* tree of private and shared mappings */

i_mmap_nonlinear;/*list VM_NONLINEAR mappings */


/* number of total pages */ writeback_index;/* writeback starts here */ methods */

error bits/gfp mask */ /* device readahead, etc ditto */ ditto */

□ The link with the areas managed by an address space is established by means of a pointer to an inode instance (of type struct inode) to specify the backing store and a root radix tree (page_tree) with a list of all physical memory pages in the address space.

□ The total number of cached pages is held in the nrpages counter variable.

□ address_space_operations is a pointer to a structure that contains a list of function pointers to specific operations for handling address spaces. Its definition is discussed below.

□ i_mmap is the root element of a tree that holds all normal memory mappings of the inode (normal in the sense that they were not created using the nonlinear mapping mechanism). The task of the tree is to support finding all memory regions that include at least one page in a given interval, and the auxiliary macro vma_prio_tree_foreach is provided for this purpose. Recall that the purpose of the tree is discussed in Section 4.4.3. The details of tree implementation are of no relevance to us at the moment — it is sufficient to know that all pages of the mapping can be found on the tree and that the structure can be manipulated easily.

□ Two further elements are concerned with the management of memory mappings: i_mmap_writeable counts all mappings created with a set VM_SHARED attribute so that they can be shared by several users at the same time. i_mmap_nonlinear is used to set up a list of all pages included in nonlinear mappings (reminder: nonlinear mappings are generated by skillful manipulation of the page tables under the control of the remap_file_pages system call).

□ backing_dev_info is a pointer to a further structure that holds information on the associated backing store.

Backing store is the name used for the peripheral device that serves as a "backbone" for the information present in the address space. It is typically a block device:

Continue reading here: Info

Was this article helpful?

0 0