Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-5.18-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixlet from Juergen Gross:
"A single cleanup patch for the Xen balloon driver"

* tag 'for-linus-5.18-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/balloon: don't use PV mode extra memory for zone device allocations

+23 -64
+23 -31
drivers/xen/balloon.c
··· 689 689 } 690 690 EXPORT_SYMBOL(xen_free_ballooned_pages); 691 691 692 - #if defined(CONFIG_XEN_PV) && !defined(CONFIG_XEN_UNPOPULATED_ALLOC) 693 - static void __init balloon_add_region(unsigned long start_pfn, 694 - unsigned long pages) 692 + static void __init balloon_add_regions(void) 695 693 { 694 + #if defined(CONFIG_XEN_PV) 695 + unsigned long start_pfn, pages; 696 696 unsigned long pfn, extra_pfn_end; 697 + unsigned int i; 697 698 698 - /* 699 - * If the amount of usable memory has been limited (e.g., with 700 - * the 'mem' command line parameter), don't add pages beyond 701 - * this limit. 702 - */ 703 - extra_pfn_end = min(max_pfn, start_pfn + pages); 699 + for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) { 700 + pages = xen_extra_mem[i].n_pfns; 701 + if (!pages) 702 + continue; 704 703 705 - for (pfn = start_pfn; pfn < extra_pfn_end; pfn++) { 706 - /* totalram_pages and totalhigh_pages do not 707 - include the boot-time balloon extension, so 708 - don't subtract from it. */ 709 - balloon_append(pfn_to_page(pfn)); 704 + start_pfn = xen_extra_mem[i].start_pfn; 705 + 706 + /* 707 + * If the amount of usable memory has been limited (e.g., with 708 + * the 'mem' command line parameter), don't add pages beyond 709 + * this limit. 710 + */ 711 + extra_pfn_end = min(max_pfn, start_pfn + pages); 712 + 713 + for (pfn = start_pfn; pfn < extra_pfn_end; pfn++) 714 + balloon_append(pfn_to_page(pfn)); 715 + 716 + balloon_stats.total_pages += extra_pfn_end - start_pfn; 710 717 } 711 - 712 - balloon_stats.total_pages += extra_pfn_end - start_pfn; 713 - } 714 718 #endif 719 + } 715 720 716 721 static int __init balloon_init(void) 717 722 { ··· 750 745 register_sysctl_table(xen_root); 751 746 #endif 752 747 753 - #if defined(CONFIG_XEN_PV) && !defined(CONFIG_XEN_UNPOPULATED_ALLOC) 754 - { 755 - int i; 756 - 757 - /* 758 - * Initialize the balloon with pages from the extra memory 759 - * regions (see arch/x86/xen/setup.c). 760 - */ 761 - for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) 762 - if (xen_extra_mem[i].n_pfns) 763 - balloon_add_region(xen_extra_mem[i].start_pfn, 764 - xen_extra_mem[i].n_pfns); 765 - } 766 - #endif 748 + balloon_add_regions(); 767 749 768 750 task = kthread_run(balloon_thread, NULL, "xen-balloon"); 769 751 if (IS_ERR(task)) {
-33
drivers/xen/unpopulated-alloc.c
··· 230 230 } 231 231 EXPORT_SYMBOL(xen_free_unpopulated_pages); 232 232 233 - #ifdef CONFIG_XEN_PV 234 - static int __init init(void) 235 - { 236 - unsigned int i; 237 - 238 - if (!xen_domain()) 239 - return -ENODEV; 240 - 241 - if (!xen_pv_domain()) 242 - return 0; 243 - 244 - /* 245 - * Initialize with pages from the extra memory regions (see 246 - * arch/x86/xen/setup.c). 247 - */ 248 - for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) { 249 - unsigned int j; 250 - 251 - for (j = 0; j < xen_extra_mem[i].n_pfns; j++) { 252 - struct page *pg = 253 - pfn_to_page(xen_extra_mem[i].start_pfn + j); 254 - 255 - pg->zone_device_data = page_list; 256 - page_list = pg; 257 - list_count++; 258 - } 259 - } 260 - 261 - return 0; 262 - } 263 - subsys_initcall(init); 264 - #endif 265 - 266 233 static int __init unpopulated_init(void) 267 234 { 268 235 int ret;