Thread (7 messages) 7 messages, 3 authors, 2021-02-02

Re: [PATCH 2/2] x86/vmemmap: Handle unpopulated sub-pmd ranges

From: David Hildenbrand <hidden>
Date: 2021-02-02 13:31:39
Also in: lkml

quoted hunk ↗ jump to hunk
@@ -1088,10 +1150,10 @@ remove_pud_table(pud_t *pud_start, unsigned long addr, unsigned long end,
  				pages++;
  			} else {
  				/* If here, we are freeing vmemmap pages. */
-				memset((void *)addr, PAGE_INUSE, next - addr);
+				memset((void *)addr, PAGE_UNUSED, next - addr);
  
  				page_addr = page_address(pud_page(*pud));
-				if (!memchr_inv(page_addr, PAGE_INUSE,
+				if (!memchr_inv(page_addr, PAGE_UNUSED,
  						PUD_SIZE)) {
  					free_pagetable(pud_page(*pud),
  						       get_order(PUD_SIZE));
I'm sorry to bother you again, but isn't that dead code as well?

How do we ever end up using 1GB pages for the vmemmap? At least not via 
vmemmap_populate() - so I guess never? There are not many occurrences of 
"PUD_SIZE" in the file after all ...

I think we can simplify that code.

-- 
Thanks,

David / dhildenb

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help