page-states.c (976e3645923bdd2fe7893aae33fd7a21098bfb28) page-states.c (c9118e6c37bff9ade90b638207a6e0db676ee6a9)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright IBM Corp. 2008
4 *
5 * Guest page hinting for unused pages.
6 *
7 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
8 */

--- 169 unchanged lines hidden (view full) ---

178 set_bit(PG_arch_1, &page[i].flags);
179 }
180 mark_kernel_p4d(pgd, addr, next);
181 } while (pgd++, addr = next, addr != MODULES_END);
182}
183
184void __init cmma_init_nodat(void)
185{
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright IBM Corp. 2008
4 *
5 * Guest page hinting for unused pages.
6 *
7 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
8 */

--- 169 unchanged lines hidden (view full) ---

178 set_bit(PG_arch_1, &page[i].flags);
179 }
180 mark_kernel_p4d(pgd, addr, next);
181 } while (pgd++, addr = next, addr != MODULES_END);
182}
183
184void __init cmma_init_nodat(void)
185{
186 struct memblock_region *reg;
187 struct page *page;
188 unsigned long start, end, ix;
186 struct page *page;
187 unsigned long start, end, ix;
188 int i;
189
190 if (cmma_flag < 2)
191 return;
192 /* Mark pages used in kernel page tables */
193 mark_kernel_pgd();
194
195 /* Set all kernel pages not used for page tables to stable/no-dat */
189
190 if (cmma_flag < 2)
191 return;
192 /* Mark pages used in kernel page tables */
193 mark_kernel_pgd();
194
195 /* Set all kernel pages not used for page tables to stable/no-dat */
196 for_each_memblock(memory, reg) {
197 start = memblock_region_memory_base_pfn(reg);
198 end = memblock_region_memory_end_pfn(reg);
196 for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) {
199 page = pfn_to_page(start);
200 for (ix = start; ix < end; ix++, page++) {
201 if (__test_and_clear_bit(PG_arch_1, &page->flags))
202 continue; /* skip page table pages */
203 if (!list_empty(&page->lru))
204 continue; /* skip free pages */
205 set_page_stable_nodat(page, 0);
206 }

--- 69 unchanged lines hidden ---
197 page = pfn_to_page(start);
198 for (ix = start; ix < end; ix++, page++) {
199 if (__test_and_clear_bit(PG_arch_1, &page->flags))
200 continue; /* skip page table pages */
201 if (!list_empty(&page->lru))
202 continue; /* skip free pages */
203 set_page_stable_nodat(page, 0);
204 }

--- 69 unchanged lines hidden ---