Lines Matching refs:page

81    of pages.  Each page can allocate objects of a single size only;
84 (`order'), and satisfied from the appropriate page.
86 Each page is recorded in a page-entry, which also maintains an
87 in-use bitmap of object positions on the page. This allows the
89 touching the page itself.
91 Each page-entry also has a context depth, which is used to track
102 Empty pages (of all orders) are kept on a single page cache list,
122 /* A two-level tree is used to look up the page-entry for a given
134 The bottommost HOST_PAGE_SIZE_BITS are ignored, since page-entry
135 pages are aligned on system page boundaries. The next most
155 /* The number of objects per allocation page, for objects on a page of
162 /* The size of an object on a page of the indicated ORDER. */
168 within the page which is evenly divisible by the object size Z. */
238 /* The Ith entry is the number of objects on a page or order I. */
242 /* The Ith entry is the size of an object on a page of order I. */
257 /* A page_entry records the status of an allocation page. This
261 /* The next page-entry with objects of the same size, or NULL if
262 this is the last page-entry. */
265 /* The previous page-entry with objects of the same size, or NULL if
266 this is the first page-entry. The PREV pointer exists solely to
271 of the host system page size.) */
275 char *page;
278 /* Back pointer to the page group this page came from. */
282 /* This is the index in the by_depth varray where this page table
286 /* Context depth of this page. */
289 /* The number of free objects remaining on this page. */
293 next allocation from this page. */
296 /* The lg of size of objects allocated from this page. */
300 Nth bit is one if the Nth object on this page is allocated. This
310 /* A linked list of all extant page groups. */
326 /* On 32-bit hosts, we use a two level page table, as pictured above. */
331 /* On 64-bit hosts, we use the same two level page tables plus a linked
346 /* The Nth element in this array is a page with objects of size 2^N.
348 head of the list. NULL if there are no page-entries for this
352 /* The Nth element in this array is the last page with objects of
353 size 2^N. NULL if there are no page-entries for this object
360 /* The system's page size. */
467 on a page-entry. */
472 allocation routines. The first page is used, the rest go onto the
484 /* Initial guess as to how many page table entries we might need. */
585 /* Traverse the page table and find the entry for a page.
611 /* Set the page table entry for a page. */
647 /* Prints the page-entry for object size ORDER, for debugging. */
675 char *page = mmap (pref, size, PROT_READ | PROT_WRITE,
679 char *page = mmap (pref, size, PROT_READ | PROT_WRITE,
683 if (page == (char *) MAP_FAILED)
695 VALGRIND_DISCARD (VALGRIND_MAKE_NOACCESS (page, size));
697 return page;
701 /* Compute the index for this page into the page group. */
704 page_group_index (char *allocation, char *page)
706 return (size_t) (page - allocation) >> G.lg_pagesize;
709 /* Set and clear the in_use bit for this page in the page group. */
712 set_page_group_in_use (page_group *group, char *page)
714 group->in_use |= 1 << page_group_index (group->allocation, page);
718 clear_page_group_in_use (page_group *group, char *page)
720 group->in_use &= ~(1 << page_group_index (group->allocation, page));
724 /* Allocate a new page for allocating objects of size 2^ORDER,
732 char *page;
749 page = NULL;
758 /* Recycle the allocated memory from this page ... */
760 page = p->page;
766 /* ... and, if possible, the page entry itself. */
778 /* We want just one page. Allocate a bunch of them and put the
784 page = alloc_anon (NULL, G.pagesize * GGC_QUIRE_SIZE);
793 e->page = page + (i << G.lg_pagesize);
801 page = alloc_anon (NULL, entry_size);
820 page = (char *) (((size_t) allocation + G.pagesize - 1) & -G.pagesize);
821 head_slop = page - allocation;
832 group = (page_group *)page - 1;
836 to waste a page anyway. */
859 for (a = enda - G.pagesize; a != page; a -= G.pagesize)
864 e->page = a;
878 entry->page = page;
888 set_page_group_in_use (group, page);
896 set_page_table_entry (page, entry);
900 "Allocating page at %p, object size=%lu, data %p-%p\n",
901 (void *) entry, (unsigned long) OBJECT_SIZE (order), page,
902 page + entry_size - 1);
927 /* For a page that is no longer needed, put it on the free page list. */
934 "Deallocating page at %p, data %p-%p\n", (void *) entry,
935 entry->page, entry->page + entry->bytes - 1);
937 /* Mark the page as inaccessible. Discard the handle to avoid handle
939 VALGRIND_DISCARD (VALGRIND_MAKE_NOACCESS (entry->page, entry->bytes));
941 set_page_table_entry (entry->page, NULL);
944 clear_page_group_in_use (entry->group, entry->page);
952 /* We cannot free a page from a context deeper than the current
969 /* Release the free page cache to the system. */
984 start = p->page;
990 while (p && p->page == start + len)
1008 /* Remove all pages from free page groups from the list. */
1019 /* Remove all free page groups, and release the storage. */
1106 /* If there is no page for this object size, or all pages in this
1107 context are full, allocate a new page. */
1123 ENTRY (G.pages[order]) to point to our new page entry. */
1129 /* Put new pages at the head of the page list. By definition the
1136 /* For a new page, we know the word and bit positions (in the
1179 /* Keep a running total of the number of free objects. If this page
1181 next page isn't full. If the next page is full, all subsequent
1190 /* We are moving ENTRY to the end of the page table list.
1191 The new page at the head of the list will have NULL in
1203 result = entry->page + object_offset;
1285 /* Look up the page on which the object is alloced. If the object
1290 /* Calculate the index of the object on the page; this is its bit
1292 bit = OFFSET_TO_BIT (((const char *) p) - entry->page, entry->order);
1321 /* Look up the page on which the object is alloced. If the object
1326 /* Calculate the index of the object on the page; this is its bit
1328 bit = OFFSET_TO_BIT (((const char *) p) - entry->page, entry->order);
1387 bit_offset = OFFSET_TO_BIT (((const char *) p) - pe->page, order);
1396 /* If the page is completely full, then it's supposed to
1398 object from a page that was full, we need to move the
1399 page to the head of the list.
1487 believe, is an unaligned page allocation, which would cause us to
1501 /* We have a good page, might as well hold onto it... */
1504 e->page = p;
1523 /* Initialize the objects-per-page and inverse tables. */
1626 /* The data should be page-aligned. */
1627 gcc_assert (!((size_t) p->page & (G.pagesize - 1)));
1661 /* The last page-entry to consider, regardless of entries
1684 /* Add all live objects on this page to the count of
1695 /* Remove the page if it's empty. */
1698 /* If P was the first page in the list, then NEXT
1699 becomes the new first page in the list, otherwise
1717 /* If the page is full, move it to the end. */
1745 /* If we've fallen through to here, it's a page in the
1747 page must precede pages at lesser context depth in the
1817 char *object = p->page + i * size;
1850 bit = OFFSET_TO_BIT ((char *)f->object - pe->page, pe->order);
1978 out how much memory the page table is using. */
2025 fprintf (stderr, "Total Overhead page size %7d: %10lld\n",
2027 fprintf (stderr, "Total Allocated page size %7d: %10lld\n",
2264 /* Allocate the appropriate page-table entries for the pages read from
2286 entry->page = offs;
2300 for (pte = entry->page;
2301 pte < entry->page + entry->bytes;
2313 to the front of the varrays, as the PCH page tables are at
2318 /* Now, we update the various data structures that speed page table