Lines Matching refs:page

8 conceptually divided in page-sized page frames as regions to hold data.
10 * When the processor tries to access data and the data page exists in
11 one of the page frames, the execution continues without any interruptions.
13 * When the processor tries to access the data page that does not exist
14 in any page frames, a page fault occurs. The paging code then brings in
15 the corresponding data page from backing store into physical memory if
16 there is a free page frame. If there is no more free page frames,
17 the eviction algorithm is invoked to select a data page to be paged out,
18 thus freeing up a page frame for new data to be paged in. If this data
19 page has been modified after it is first paged in, the data will be
21 after written back into backing store, the data page is now considered
22 paged out and the corresponding page frame is now free. The paging code
23 then invokes the backing store to page in the data page corresponding to
25 page into the free page frame. Now the data page is in physical memory
30 :c:func:`k_mem_page_in()` can be used to page in data pages
32 minimize number of page faults as these data pages are already in physical
34 used to page out data pages where they are not going to be accessed for
35 a considerable amount of time. This frees up page frames so that the next
36 page in can be executed faster as the paging code does not need to invoke
43 A data page is a page-sized region of data. It may exist in a page frame,
45 up in the CPU's page tables (or equivalent) by virtual address.
50 A page frame is a page-sized physical memory region in RAM. It is a
51 container where a data page may be placed. It is always referred to by
53 addresses. For every page frame, a ``struct k_mem_page_frame`` is instantiated to
54 store metadata. Flags for each page frame:
56 * ``K_MEM_PAGE_FRAME_FREE`` indicates a page frame is unused and on the list of
57 free page frames. When this flag is set, none of the other flags are
60 * ``K_MEM_PAGE_FRAME_PINNED`` indicates a page frame is pinned in memory
63 * ``K_MEM_PAGE_FRAME_RESERVED`` indicates a physical page reserved by hardware
66 * ``K_MEM_PAGE_FRAME_MAPPED`` is set when a physical page is mapped to
69 * ``K_MEM_PAGE_FRAME_BUSY`` indicates a page frame is currently involved in
70 a page-in/out operation.
72 * ``K_MEM_PAGE_FRAME_BACKED`` indicates a page frame has a clean copy
76 The virtual address of a special page provided to the backing store to:
77 * Copy a data page from ``k_MEM_SCRATCH_PAGE`` to the specified location; or,
78 * Copy a data page from the provided location to ``K_MEM_SCRATCH_PAGE``.
79 This is used as an intermediate page for page in/out operations. This
81 However the data page itself may only be mapped as read-only in virtual
82 address space. If this page is provided as-is to backing store,
83 the data page must be re-mapped as read/write which has security
84 implications as the data page is no longer read-only to other parts of
110 * Execution time histogram of backing store doing page-in via
113 * Execution time histogram of backing store doing page-out via
119 The eviction algorithm is used to determine which data page and its
120 corresponding page frame can be paged out to free up a page frame
121 for the next page in operation. There are four functions which are
127 * :c:func:`k_mem_paging_eviction_add()` is called each time a data page becomes
130 * :c:func:`k_mem_paging_eviction_remove()` is called when a data page is no
131 longer eligible for eviction. This may happen if the given data page becomes
135 a data page to evict. A function argument ``dirty`` is written to
136 signal the caller whether the selected data page has been modified
139 the data page back into storage (thus updating its content).
140 The function returns a pointer to the page frame corresponding to
141 the selected data page.
169 Backing store is responsible for paging in/out data page between
170 their corresponding page frames and storage. These are the functions
177 reserve a backing store location so a data page can be paged out.
180 page out operation.
184 then be used for subsequent page out operation.
191 * :c:func:`k_mem_paging_backing_store_page_in()` copies a data page
193 ``location`` token to the page pointed by ``K_MEM_SCRATCH_PAGE``.
195 * :c:func:`k_mem_paging_backing_store_page_out()` copies a data page
200 :c:func:`k_mem_paging_backing_store_page_in()` so that the page frame