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 'stable/for-linus-3.10-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Pull Xen fixes from Konrad Rzeszutek Wilk:
- Regression fix in xen privcmd fixing a memory leak.
- Add Documentation for tmem driver.
- Simplify and remove code in the tmem driver.
- Cleanups.

* tag 'stable/for-linus-3.10-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen: Fixed assignment error in if statement
xen/xenbus: Fixed over 80 character limit issue
xen/xenbus: Fixed indentation error in switch case
xen/tmem: Don't use self[ballooning|shrinking] if frontswap is off.
xen/tmem: Remove the usage of '[no|]selfballoon' and use 'tmem.selfballooning' bool instead.
xen/tmem: Remove the usage of 'noselfshrink' and use 'tmem.selfshrink' bool instead.
xen/tmem: Remove the boot options and fold them in the tmem.X parameters.
xen/tmem: s/disable_// and change the logic.
xen/tmem: Fix compile warning.
xen/tmem: Split out the different module/boot options.
xen/tmem: Move all of the boot and module parameters to the top of the file.
xen/tmem: Cleanup. Remove the parts that say temporary.
xen/privcmd: fix condition in privcmd_close()

+82 -106
+21
Documentation/kernel-parameters.txt
··· 3005 3005 Force threading of all interrupt handlers except those 3006 3006 marked explicitly IRQF_NO_THREAD. 3007 3007 3008 + tmem [KNL,XEN] 3009 + Enable the Transcendent memory driver if built-in. 3010 + 3011 + tmem.cleancache=0|1 [KNL, XEN] 3012 + Default is on (1). Disable the usage of the cleancache 3013 + API to send anonymous pages to the hypervisor. 3014 + 3015 + tmem.frontswap=0|1 [KNL, XEN] 3016 + Default is on (1). Disable the usage of the frontswap 3017 + API to send swap pages to the hypervisor. If disabled 3018 + the selfballooning and selfshrinking are force disabled. 3019 + 3020 + tmem.selfballooning=0|1 [KNL, XEN] 3021 + Default is on (1). Disable the driving of swap pages 3022 + to the hypervisor. 3023 + 3024 + tmem.selfshrinking=0|1 [KNL, XEN] 3025 + Default is on (1). Partial swapoff that immediately 3026 + transfers pages from Xen hypervisor back to the 3027 + kernel based on different criteria. 3028 + 3008 3029 topology= [S390] 3009 3030 Format: {off | on} 3010 3031 Specify if the kernel should make use of the cpu
+3 -4
drivers/xen/Kconfig
··· 19 19 by the current usage of anonymous memory ("committed AS") and 20 20 controlled by various sysfs-settable parameters. Configuring 21 21 FRONTSWAP is highly recommended; if it is not configured, self- 22 - ballooning is disabled by default but can be enabled with the 23 - 'selfballooning' kernel boot parameter. If FRONTSWAP is configured, 22 + ballooning is disabled by default. If FRONTSWAP is configured, 24 23 frontswap-selfshrinking is enabled by default but can be disabled 25 - with the 'noselfshrink' kernel boot parameter; and self-ballooning 26 - is enabled by default but can be disabled with the 'noselfballooning' 24 + with the 'tmem.selfshrink=0' kernel boot parameter; and self-ballooning 25 + is enabled by default but can be disabled with the 'tmem.selfballooning=0' 27 26 kernel boot parameter. Note that systems without a sufficiently 28 27 large swap device should not enable self-ballooning. 29 28
+2 -1
drivers/xen/balloon.c
··· 407 407 nr_pages = ARRAY_SIZE(frame_list); 408 408 409 409 for (i = 0; i < nr_pages; i++) { 410 - if ((page = alloc_page(gfp)) == NULL) { 410 + page = alloc_page(gfp); 411 + if (page == NULL) { 411 412 nr_pages = i; 412 413 state = BP_EAGAIN; 413 414 break;
+1 -1
drivers/xen/privcmd.c
··· 504 504 struct page **pages = vma->vm_private_data; 505 505 int numpgs = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 506 506 507 - if (!xen_feature(XENFEAT_auto_translated_physmap || !numpgs || !pages)) 507 + if (!xen_feature(XENFEAT_auto_translated_physmap) || !numpgs || !pages) 508 508 return; 509 509 510 510 xen_unmap_domain_mfn_range(vma, numpgs, pages);
+39 -48
drivers/xen/tmem.c
··· 11 11 #include <linux/init.h> 12 12 #include <linux/pagemap.h> 13 13 #include <linux/cleancache.h> 14 - 15 - /* temporary ifdef until include/linux/frontswap.h is upstream */ 16 - #ifdef CONFIG_FRONTSWAP 17 14 #include <linux/frontswap.h> 18 - #endif 19 15 20 16 #include <xen/xen.h> 21 17 #include <xen/interface/xen.h> ··· 19 23 #include <asm/xen/page.h> 20 24 #include <asm/xen/hypervisor.h> 21 25 #include <xen/tmem.h> 26 + 27 + #ifndef CONFIG_XEN_TMEM_MODULE 28 + bool __read_mostly tmem_enabled = false; 29 + 30 + static int __init enable_tmem(char *s) 31 + { 32 + tmem_enabled = true; 33 + return 1; 34 + } 35 + __setup("tmem", enable_tmem); 36 + #endif 37 + 38 + #ifdef CONFIG_CLEANCACHE 39 + static bool cleancache __read_mostly = true; 40 + module_param(cleancache, bool, S_IRUGO); 41 + static bool selfballooning __read_mostly = true; 42 + module_param(selfballooning, bool, S_IRUGO); 43 + #endif /* CONFIG_CLEANCACHE */ 44 + 45 + #ifdef CONFIG_FRONTSWAP 46 + static bool frontswap __read_mostly = true; 47 + module_param(frontswap, bool, S_IRUGO); 48 + #endif /* CONFIG_FRONTSWAP */ 49 + 50 + #ifdef CONFIG_XEN_SELFBALLOONING 51 + static bool selfshrinking __read_mostly = true; 52 + module_param(selfshrinking, bool, S_IRUGO); 53 + #endif /* CONFIG_XEN_SELFBALLOONING */ 22 54 23 55 #define TMEM_CONTROL 0 24 56 #define TMEM_NEW_POOL 1 ··· 153 129 return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0); 154 130 } 155 131 156 - #ifndef CONFIG_XEN_TMEM_MODULE 157 - bool __read_mostly tmem_enabled = false; 158 - 159 - static int __init enable_tmem(char *s) 160 - { 161 - tmem_enabled = true; 162 - return 1; 163 - } 164 - __setup("tmem", enable_tmem); 165 - #endif 166 132 167 133 #ifdef CONFIG_CLEANCACHE 168 134 static int xen_tmem_destroy_pool(u32 pool_id) ··· 243 229 shared_uuid.uuid_hi = *(u64 *)(&uuid[8]); 244 230 return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize); 245 231 } 246 - 247 - static bool disable_cleancache __read_mostly; 248 - static bool disable_selfballooning __read_mostly; 249 - #ifdef CONFIG_XEN_TMEM_MODULE 250 - module_param(disable_cleancache, bool, S_IRUGO); 251 - module_param(disable_selfballooning, bool, S_IRUGO); 252 - #else 253 - static int __init no_cleancache(char *s) 254 - { 255 - disable_cleancache = true; 256 - return 1; 257 - } 258 - __setup("nocleancache", no_cleancache); 259 - #endif 260 232 261 233 static struct cleancache_ops tmem_cleancache_ops = { 262 234 .put_page = tmem_cleancache_put_page, ··· 361 361 xen_tmem_new_pool(private, TMEM_POOL_PERSIST, PAGE_SIZE); 362 362 } 363 363 364 - static bool disable_frontswap __read_mostly; 365 - static bool disable_frontswap_selfshrinking __read_mostly; 366 - #ifdef CONFIG_XEN_TMEM_MODULE 367 - module_param(disable_frontswap, bool, S_IRUGO); 368 - module_param(disable_frontswap_selfshrinking, bool, S_IRUGO); 369 - #else 370 - static int __init no_frontswap(char *s) 371 - { 372 - disable_frontswap = true; 373 - return 1; 374 - } 375 - __setup("nofrontswap", no_frontswap); 376 - #endif 377 - 378 364 static struct frontswap_ops tmem_frontswap_ops = { 379 365 .store = tmem_frontswap_store, 380 366 .load = tmem_frontswap_load, ··· 368 382 .invalidate_area = tmem_frontswap_flush_area, 369 383 .init = tmem_frontswap_init 370 384 }; 371 - #else /* CONFIG_FRONTSWAP */ 372 - #define disable_frontswap_selfshrinking 1 373 385 #endif 374 386 375 387 static int xen_tmem_init(void) ··· 375 391 if (!xen_domain()) 376 392 return 0; 377 393 #ifdef CONFIG_FRONTSWAP 378 - if (tmem_enabled && !disable_frontswap) { 394 + if (tmem_enabled && frontswap) { 379 395 char *s = ""; 380 396 struct frontswap_ops *old_ops = 381 397 frontswap_register_ops(&tmem_frontswap_ops); ··· 392 408 #endif 393 409 #ifdef CONFIG_CLEANCACHE 394 410 BUG_ON(sizeof(struct cleancache_filekey) != sizeof(struct tmem_oid)); 395 - if (tmem_enabled && !disable_cleancache) { 411 + if (tmem_enabled && cleancache) { 396 412 char *s = ""; 397 413 struct cleancache_ops *old_ops = 398 414 cleancache_register_ops(&tmem_cleancache_ops); ··· 403 419 } 404 420 #endif 405 421 #ifdef CONFIG_XEN_SELFBALLOONING 406 - xen_selfballoon_init(!disable_selfballooning, 407 - !disable_frontswap_selfshrinking); 422 + /* 423 + * There is no point of driving pages to the swap system if they 424 + * aren't going anywhere in tmem universe. 425 + */ 426 + if (!frontswap) { 427 + selfshrinking = false; 428 + selfballooning = false; 429 + } 430 + xen_selfballoon_init(selfballooning, selfshrinking); 408 431 #endif 409 432 return 0; 410 433 }
+6 -41
drivers/xen/xen-selfballoon.c
··· 53 53 * System configuration note: Selfballooning should not be enabled on 54 54 * systems without a sufficiently large swap device configured; for best 55 55 * results, it is recommended that total swap be increased by the size 56 - * of the guest memory. Also, while technically not required to be 57 - * configured, it is highly recommended that frontswap also be configured 58 - * and enabled when selfballooning is running. So, selfballooning 59 - * is disabled by default if frontswap is not configured and can only 60 - * be enabled with the "selfballooning" kernel boot option; similarly 61 - * selfballooning is enabled by default if frontswap is configured and 62 - * can be disabled with the "noselfballooning" kernel boot option. Finally, 63 - * when frontswap is configured, frontswap-selfshrinking can be disabled 64 - * with the "noselfshrink" kernel boot option. 56 + * of the guest memory. Note, that selfballooning should be disabled by default 57 + * if frontswap is not configured. Similarly selfballooning should be enabled 58 + * by default if frontswap is configured and can be disabled with the 59 + * "tmem.selfballooning=0" kernel boot option. Finally, when frontswap is 60 + * configured, frontswap-selfshrinking can be disabled with the 61 + * "tmem.selfshrink=0" kernel boot option. 65 62 * 66 63 * Selfballooning is disallowed in domain0 and force-disabled. 67 64 * ··· 117 120 /* Enable/disable with sysfs. */ 118 121 static bool frontswap_selfshrinking __read_mostly; 119 122 120 - /* Enable/disable with kernel boot option. */ 121 - static bool use_frontswap_selfshrink = true; 122 - 123 123 /* 124 124 * The default values for the following parameters were deemed reasonable 125 125 * by experimentation, may be workload-dependent, and can all be ··· 170 176 frontswap_shrink(tgt_frontswap_pages); 171 177 } 172 178 173 - static int __init xen_nofrontswap_selfshrink_setup(char *s) 174 - { 175 - use_frontswap_selfshrink = false; 176 - return 1; 177 - } 178 - 179 - __setup("noselfshrink", xen_nofrontswap_selfshrink_setup); 180 - 181 - /* Disable with kernel boot option. */ 182 - static bool use_selfballooning = true; 183 - 184 - static int __init xen_noselfballooning_setup(char *s) 185 - { 186 - use_selfballooning = false; 187 - return 1; 188 - } 189 - 190 - __setup("noselfballooning", xen_noselfballooning_setup); 191 - #else /* !CONFIG_FRONTSWAP */ 192 - /* Enable with kernel boot option. */ 193 - static bool use_selfballooning; 194 - 195 - static int __init xen_selfballooning_setup(char *s) 196 - { 197 - use_selfballooning = true; 198 - return 1; 199 - } 200 - 201 - __setup("selfballooning", xen_selfballooning_setup); 202 179 #endif /* CONFIG_FRONTSWAP */ 203 180 204 181 #define MB2PAGES(mb) ((mb) << (20 - PAGE_SHIFT))
+10 -11
drivers/xen/xenbus/xenbus_dev_backend.c
··· 70 70 return err; 71 71 } 72 72 73 - static long xenbus_backend_ioctl(struct file *file, unsigned int cmd, unsigned long data) 73 + static long xenbus_backend_ioctl(struct file *file, unsigned int cmd, 74 + unsigned long data) 74 75 { 75 76 if (!capable(CAP_SYS_ADMIN)) 76 77 return -EPERM; 77 78 78 79 switch (cmd) { 79 - case IOCTL_XENBUS_BACKEND_EVTCHN: 80 - if (xen_store_evtchn > 0) 81 - return xen_store_evtchn; 82 - return -ENODEV; 83 - 84 - case IOCTL_XENBUS_BACKEND_SETUP: 85 - return xenbus_alloc(data); 86 - 87 - default: 88 - return -ENOTTY; 80 + case IOCTL_XENBUS_BACKEND_EVTCHN: 81 + if (xen_store_evtchn > 0) 82 + return xen_store_evtchn; 83 + return -ENODEV; 84 + case IOCTL_XENBUS_BACKEND_SETUP: 85 + return xenbus_alloc(data); 86 + default: 87 + return -ENOTTY; 89 88 } 90 89 } 91 90