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-4.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:
"Some fixes and cleanups for running under Xen"

* tag 'for-linus-4.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/balloon: don't online new memory initially
xen/x86: fix cpu hotplug
xen/grant-table: log the lack of grants
xen/x86: Don't BUG on CPU0 offlining

+33 -13
+2 -1
arch/x86/xen/smp_pv.c
··· 19 19 #include <linux/irq_work.h> 20 20 #include <linux/tick.h> 21 21 #include <linux/nmi.h> 22 + #include <linux/cpuhotplug.h> 22 23 23 24 #include <asm/paravirt.h> 24 25 #include <asm/desc.h> ··· 414 413 */ 415 414 tick_nohz_idle_enter(); 416 415 417 - cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); 416 + cpuhp_online_idle(CPUHP_AP_ONLINE_IDLE); 418 417 } 419 418 420 419 #else /* !CONFIG_HOTPLUG_CPU */
-1
arch/x86/xen/time.c
··· 309 309 void xen_teardown_timer(int cpu) 310 310 { 311 311 struct clock_event_device *evt; 312 - BUG_ON(cpu == 0); 313 312 evt = &per_cpu(xen_clock_events, cpu).evt; 314 313 315 314 if (evt->irq >= 0) {
+3
drivers/xen/balloon.c
··· 780 780 } 781 781 #endif 782 782 783 + /* Init the xen-balloon driver. */ 784 + xen_balloon_init(); 785 + 783 786 return 0; 784 787 } 785 788 subsys_initcall(balloon_init);
+8 -1
drivers/xen/grant-table.c
··· 42 42 #include <linux/delay.h> 43 43 #include <linux/hardirq.h> 44 44 #include <linux/workqueue.h> 45 + #include <linux/ratelimit.h> 45 46 46 47 #include <xen/xen.h> 47 48 #include <xen/interface/xen.h> ··· 1073 1072 cur = nr_grant_frames; 1074 1073 extra = ((req_entries + (grefs_per_grant_frame-1)) / 1075 1074 grefs_per_grant_frame); 1076 - if (cur + extra > gnttab_max_grant_frames()) 1075 + if (cur + extra > gnttab_max_grant_frames()) { 1076 + pr_warn_ratelimited("xen/grant-table: max_grant_frames reached" 1077 + " cur=%u extra=%u limit=%u" 1078 + " gnttab_free_count=%u req_entries=%u\n", 1079 + cur, extra, gnttab_max_grant_frames(), 1080 + gnttab_free_count, req_entries); 1077 1081 return -ENOSPC; 1082 + } 1078 1083 1079 1084 rc = gnttab_map(cur, cur + extra - 1); 1080 1085 if (rc == 0)
+12 -10
drivers/xen/xen-balloon.c
··· 59 59 { 60 60 unsigned long long new_target; 61 61 int err; 62 + static bool watch_fired; 63 + static long target_diff; 62 64 63 65 err = xenbus_scanf(XBT_NIL, "memory", "target", "%llu", &new_target); 64 66 if (err != 1) { ··· 71 69 /* The given memory/target value is in KiB, so it needs converting to 72 70 * pages. PAGE_SHIFT converts bytes to pages, hence PAGE_SHIFT - 10. 73 71 */ 74 - balloon_set_new_target(new_target >> (PAGE_SHIFT - 10)); 72 + new_target >>= PAGE_SHIFT - 10; 73 + if (watch_fired) { 74 + balloon_set_new_target(new_target - target_diff); 75 + return; 76 + } 77 + 78 + watch_fired = true; 79 + target_diff = new_target - balloon_stats.target_pages; 75 80 } 76 81 static struct xenbus_watch target_watch = { 77 82 .node = "memory/target", ··· 103 94 .notifier_call = balloon_init_watcher, 104 95 }; 105 96 106 - static int __init balloon_init(void) 97 + void xen_balloon_init(void) 107 98 { 108 - if (!xen_domain()) 109 - return -ENODEV; 110 - 111 - pr_info("Initialising balloon driver\n"); 112 - 113 99 register_balloon(&balloon_dev); 114 100 115 101 register_xen_selfballooning(&balloon_dev); 116 102 117 103 register_xenstore_notifier(&xenstore_notifier); 118 - 119 - return 0; 120 104 } 121 - subsys_initcall(balloon_init); 105 + EXPORT_SYMBOL_GPL(xen_balloon_init); 122 106 123 107 #define BALLOON_SHOW(name, format, args...) \ 124 108 static ssize_t show_##name(struct device *dev, \
+8
include/xen/balloon.h
··· 35 35 return -ENOSYS; 36 36 } 37 37 #endif 38 + 39 + #ifdef CONFIG_XEN_BALLOON 40 + void xen_balloon_init(void); 41 + #else 42 + static inline void xen_balloon_init(void) 43 + { 44 + } 45 + #endif