0024-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From 32839a570568823b3a1128bb1ae6c5fe3e9870af Mon Sep 17 00:00:00 2001
  2. From: popcornmix <popcornmix@gmail.com>
  3. Date: Wed, 18 Dec 2013 22:16:19 +0000
  4. Subject: [PATCH 024/114] config: Enable CONFIG_MEMCG, but leave it disabled
  5. (due to memory cost). Enable with cgroup_enable=memory.
  6. ---
  7. arch/arm/configs/bcmrpi_defconfig | 1 +
  8. kernel/cgroup.c | 23 +++++++++++++++++++++++
  9. mm/memcontrol.c | 1 +
  10. 3 files changed, 25 insertions(+)
  11. --- a/arch/arm/configs/bcmrpi_defconfig
  12. +++ b/arch/arm/configs/bcmrpi_defconfig
  13. @@ -19,6 +19,7 @@ CONFIG_CGROUP_FREEZER=y
  14. CONFIG_CGROUP_DEVICE=y
  15. CONFIG_CGROUP_CPUACCT=y
  16. CONFIG_RESOURCE_COUNTERS=y
  17. +CONFIG_MEMCG=y
  18. CONFIG_BLK_CGROUP=y
  19. CONFIG_NAMESPACES=y
  20. CONFIG_SCHED_AUTOGROUP=y
  21. --- a/kernel/cgroup.c
  22. +++ b/kernel/cgroup.c
  23. @@ -5319,6 +5319,29 @@ static int __init cgroup_disable(char *s
  24. }
  25. __setup("cgroup_disable=", cgroup_disable);
  26. +static int __init cgroup_enable(char *str)
  27. +{
  28. + struct cgroup_subsys *ss;
  29. + char *token;
  30. + int i;
  31. +
  32. + while ((token = strsep(&str, ",")) != NULL) {
  33. + if (!*token)
  34. + continue;
  35. +
  36. + for_each_subsys(ss, i) {
  37. + if (!strcmp(token, ss->name)) {
  38. + ss->disabled = 0;
  39. + printk(KERN_INFO "Enabling %s control group"
  40. + " subsystem\n", ss->name);
  41. + break;
  42. + }
  43. + }
  44. + }
  45. + return 1;
  46. +}
  47. +__setup("cgroup_enable=", cgroup_enable);
  48. +
  49. static int __init cgroup_set_legacy_files_on_dfl(char *str)
  50. {
  51. printk("cgroup: using legacy files on the default hierarchy\n");
  52. --- a/mm/memcontrol.c
  53. +++ b/mm/memcontrol.c
  54. @@ -6208,6 +6208,7 @@ struct cgroup_subsys memory_cgrp_subsys
  55. .bind = mem_cgroup_bind,
  56. .legacy_cftypes = mem_cgroup_files,
  57. .early_init = 0,
  58. + .disabled = 1,
  59. };
  60. #ifdef CONFIG_MEMCG_SWAP