mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-03 18:20:25 +02:00 
			
		
		
		
	hugetlb: add phys addr to struct huge_bootmem_page
This is needed on HIGHMEM systems - we don't always have a virtual address so store the physical address and map it in as needed. [akpm@linux-foundation.org: cleanup] Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									2b37c35e65
								
							
						
					
					
						commit
						ee8f248d26
					
				
					 2 changed files with 12 additions and 1 deletions
				
			
		| 
						 | 
					@ -231,6 +231,9 @@ struct hstate {
 | 
				
			||||||
struct huge_bootmem_page {
 | 
					struct huge_bootmem_page {
 | 
				
			||||||
	struct list_head list;
 | 
						struct list_head list;
 | 
				
			||||||
	struct hstate *hstate;
 | 
						struct hstate *hstate;
 | 
				
			||||||
 | 
					#ifdef CONFIG_HIGHMEM
 | 
				
			||||||
 | 
						phys_addr_t phys;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct page *alloc_huge_page_node(struct hstate *h, int nid);
 | 
					struct page *alloc_huge_page_node(struct hstate *h, int nid);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										10
									
								
								mm/hugetlb.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								mm/hugetlb.c
									
									
									
									
									
								
							| 
						 | 
					@ -1105,8 +1105,16 @@ static void __init gather_bootmem_prealloc(void)
 | 
				
			||||||
	struct huge_bootmem_page *m;
 | 
						struct huge_bootmem_page *m;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry(m, &huge_boot_pages, list) {
 | 
						list_for_each_entry(m, &huge_boot_pages, list) {
 | 
				
			||||||
		struct page *page = virt_to_page(m);
 | 
					 | 
				
			||||||
		struct hstate *h = m->hstate;
 | 
							struct hstate *h = m->hstate;
 | 
				
			||||||
 | 
							struct page *page;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef CONFIG_HIGHMEM
 | 
				
			||||||
 | 
							page = pfn_to_page(m->phys >> PAGE_SHIFT);
 | 
				
			||||||
 | 
							free_bootmem_late((unsigned long)m,
 | 
				
			||||||
 | 
									  sizeof(struct huge_bootmem_page));
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
							page = virt_to_page(m);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		__ClearPageReserved(page);
 | 
							__ClearPageReserved(page);
 | 
				
			||||||
		WARN_ON(page_count(page) != 1);
 | 
							WARN_ON(page_count(page) != 1);
 | 
				
			||||||
		prep_compound_huge_page(page, h->order);
 | 
							prep_compound_huge_page(page, h->order);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue