mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
xen: branch for v5.18-rc3
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRTLbB6QfY48x44uB6AXGG7T9hjvgUCYlvMdwAKCRCAXGG7T9hj vueqAQCeJiUt0Adhs7ACqzvTsBc1TGXD44J6AAfwedMgtdgtvAD+LvWXLhTcgiCb DT03AIpI1Z/40QgPYuJ3o4yAZN7eUg4= =dV8F -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
a1901b464e
2 changed files with 23 additions and 64 deletions
|
@ -689,29 +689,34 @@ void xen_free_ballooned_pages(unsigned int nr_pages, struct page **pages)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(xen_free_ballooned_pages);
|
EXPORT_SYMBOL(xen_free_ballooned_pages);
|
||||||
|
|
||||||
#if defined(CONFIG_XEN_PV) && !defined(CONFIG_XEN_UNPOPULATED_ALLOC)
|
static void __init balloon_add_regions(void)
|
||||||
static void __init balloon_add_region(unsigned long start_pfn,
|
|
||||||
unsigned long pages)
|
|
||||||
{
|
{
|
||||||
|
#if defined(CONFIG_XEN_PV)
|
||||||
|
unsigned long start_pfn, pages;
|
||||||
unsigned long pfn, extra_pfn_end;
|
unsigned long pfn, extra_pfn_end;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
/*
|
for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
|
||||||
* If the amount of usable memory has been limited (e.g., with
|
pages = xen_extra_mem[i].n_pfns;
|
||||||
* the 'mem' command line parameter), don't add pages beyond
|
if (!pages)
|
||||||
* this limit.
|
continue;
|
||||||
*/
|
|
||||||
extra_pfn_end = min(max_pfn, start_pfn + pages);
|
|
||||||
|
|
||||||
for (pfn = start_pfn; pfn < extra_pfn_end; pfn++) {
|
start_pfn = xen_extra_mem[i].start_pfn;
|
||||||
/* totalram_pages and totalhigh_pages do not
|
|
||||||
include the boot-time balloon extension, so
|
/*
|
||||||
don't subtract from it. */
|
* If the amount of usable memory has been limited (e.g., with
|
||||||
balloon_append(pfn_to_page(pfn));
|
* the 'mem' command line parameter), don't add pages beyond
|
||||||
|
* this limit.
|
||||||
|
*/
|
||||||
|
extra_pfn_end = min(max_pfn, start_pfn + pages);
|
||||||
|
|
||||||
|
for (pfn = start_pfn; pfn < extra_pfn_end; pfn++)
|
||||||
|
balloon_append(pfn_to_page(pfn));
|
||||||
|
|
||||||
|
balloon_stats.total_pages += extra_pfn_end - start_pfn;
|
||||||
}
|
}
|
||||||
|
|
||||||
balloon_stats.total_pages += extra_pfn_end - start_pfn;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static int __init balloon_init(void)
|
static int __init balloon_init(void)
|
||||||
{
|
{
|
||||||
|
@ -745,20 +750,7 @@ static int __init balloon_init(void)
|
||||||
register_sysctl_table(xen_root);
|
register_sysctl_table(xen_root);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_XEN_PV) && !defined(CONFIG_XEN_UNPOPULATED_ALLOC)
|
balloon_add_regions();
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Initialize the balloon with pages from the extra memory
|
|
||||||
* regions (see arch/x86/xen/setup.c).
|
|
||||||
*/
|
|
||||||
for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++)
|
|
||||||
if (xen_extra_mem[i].n_pfns)
|
|
||||||
balloon_add_region(xen_extra_mem[i].start_pfn,
|
|
||||||
xen_extra_mem[i].n_pfns);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
task = kthread_run(balloon_thread, NULL, "xen-balloon");
|
task = kthread_run(balloon_thread, NULL, "xen-balloon");
|
||||||
if (IS_ERR(task)) {
|
if (IS_ERR(task)) {
|
||||||
|
|
|
@ -230,39 +230,6 @@ void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(xen_free_unpopulated_pages);
|
EXPORT_SYMBOL(xen_free_unpopulated_pages);
|
||||||
|
|
||||||
#ifdef CONFIG_XEN_PV
|
|
||||||
static int __init init(void)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
if (!xen_domain())
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
if (!xen_pv_domain())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Initialize with pages from the extra memory regions (see
|
|
||||||
* arch/x86/xen/setup.c).
|
|
||||||
*/
|
|
||||||
for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {
|
|
||||||
unsigned int j;
|
|
||||||
|
|
||||||
for (j = 0; j < xen_extra_mem[i].n_pfns; j++) {
|
|
||||||
struct page *pg =
|
|
||||||
pfn_to_page(xen_extra_mem[i].start_pfn + j);
|
|
||||||
|
|
||||||
pg->zone_device_data = page_list;
|
|
||||||
page_list = pg;
|
|
||||||
list_count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
subsys_initcall(init);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int __init unpopulated_init(void)
|
static int __init unpopulated_init(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
Loading…
Reference in a new issue