aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-01-12 05:01:12 -0500
committerThomas Gleixner <tglx@linutronix.de>2016-01-12 05:01:12 -0500
commit1f16f116b01c110db20ab808562c8b8bc3ee3d6e (patch)
tree44db563f64cf5f8d62af8f99a61e2b248c44ea3a /mm/memcontrol.c
parent03724ac3d48f8f0e3caf1d30fa134f8fd96c94e2 (diff)
parentf9eccf24615672896dc13251410c3f2f33a14f95 (diff)
Merge branches 'clockevents/4.4-fixes' and 'clockevents/4.5-fixes' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull in fixes from Daniel Lezcano: - Fix the vt8500 timer leading to a system lock up when dealing with too small delta (Roman Volkov) - Select the CLKSRC_MMIO when the fsl_ftm_timer is enabled with COMPILE_TEST (Daniel Lezcano) - Prevent to compile timers using the 'iomem' API when the architecture has not HAS_IOMEM set (Richard Weinberger)
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 9acfb165eb52..e234c21a5e6c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2128,7 +2128,7 @@ done_restock:
2128 */ 2128 */
2129 do { 2129 do {
2130 if (page_counter_read(&memcg->memory) > memcg->high) { 2130 if (page_counter_read(&memcg->memory) > memcg->high) {
2131 current->memcg_nr_pages_over_high += nr_pages; 2131 current->memcg_nr_pages_over_high += batch;
2132 set_notify_resume(current); 2132 set_notify_resume(current);
2133 break; 2133 break;
2134 } 2134 }
@@ -4779,23 +4779,18 @@ static void mem_cgroup_clear_mc(void)
4779 spin_unlock(&mc.lock); 4779 spin_unlock(&mc.lock);
4780} 4780}
4781 4781
4782static int mem_cgroup_can_attach(struct cgroup_subsys_state *css, 4782static int mem_cgroup_can_attach(struct cgroup_taskset *tset)
4783 struct cgroup_taskset *tset)
4784{ 4783{
4785 struct mem_cgroup *memcg = mem_cgroup_from_css(css); 4784 struct cgroup_subsys_state *css;
4785 struct mem_cgroup *memcg;
4786 struct mem_cgroup *from; 4786 struct mem_cgroup *from;
4787 struct task_struct *leader, *p; 4787 struct task_struct *leader, *p;
4788 struct mm_struct *mm; 4788 struct mm_struct *mm;
4789 unsigned long move_flags; 4789 unsigned long move_flags;
4790 int ret = 0; 4790 int ret = 0;
4791 4791
4792 /* 4792 /* charge immigration isn't supported on the default hierarchy */
4793 * We are now commited to this value whatever it is. Changes in this 4793 if (cgroup_subsys_on_dfl(memory_cgrp_subsys))
4794 * tunable will only affect upcoming migrations, not the current one.
4795 * So we need to save it, and keep it going.
4796 */
4797 move_flags = READ_ONCE(memcg->move_charge_at_immigrate);
4798 if (!move_flags)
4799 return 0; 4794 return 0;
4800 4795
4801 /* 4796 /*
@@ -4805,13 +4800,23 @@ static int mem_cgroup_can_attach(struct cgroup_subsys_state *css,
4805 * multiple. 4800 * multiple.
4806 */ 4801 */
4807 p = NULL; 4802 p = NULL;
4808 cgroup_taskset_for_each_leader(leader, tset) { 4803 cgroup_taskset_for_each_leader(leader, css, tset) {
4809 WARN_ON_ONCE(p); 4804 WARN_ON_ONCE(p);
4810 p = leader; 4805 p = leader;
4806 memcg = mem_cgroup_from_css(css);
4811 } 4807 }
4812 if (!p) 4808 if (!p)
4813 return 0; 4809 return 0;
4814 4810
4811 /*
4812 * We are now commited to this value whatever it is. Changes in this
4813 * tunable will only affect upcoming migrations, not the current one.
4814 * So we need to save it, and keep it going.
4815 */
4816 move_flags = READ_ONCE(memcg->move_charge_at_immigrate);
4817 if (!move_flags)
4818 return 0;
4819
4815 from = mem_cgroup_from_task(p); 4820 from = mem_cgroup_from_task(p);
4816 4821
4817 VM_BUG_ON(from == memcg); 4822 VM_BUG_ON(from == memcg);
@@ -4842,8 +4847,7 @@ static int mem_cgroup_can_attach(struct cgroup_subsys_state *css,
4842 return ret; 4847 return ret;
4843} 4848}
4844 4849
4845static void mem_cgroup_cancel_attach(struct cgroup_subsys_state *css, 4850static void mem_cgroup_cancel_attach(struct cgroup_taskset *tset)
4846 struct cgroup_taskset *tset)
4847{ 4851{
4848 if (mc.to) 4852 if (mc.to)
4849 mem_cgroup_clear_mc(); 4853 mem_cgroup_clear_mc();
@@ -4985,10 +4989,10 @@ retry:
4985 atomic_dec(&mc.from->moving_account); 4989 atomic_dec(&mc.from->moving_account);
4986} 4990}
4987 4991
4988static void mem_cgroup_move_task(struct cgroup_subsys_state *css, 4992static void mem_cgroup_move_task(struct cgroup_taskset *tset)
4989 struct cgroup_taskset *tset)
4990{ 4993{
4991 struct task_struct *p = cgroup_taskset_first(tset); 4994 struct cgroup_subsys_state *css;
4995 struct task_struct *p = cgroup_taskset_first(tset, &css);
4992 struct mm_struct *mm = get_task_mm(p); 4996 struct mm_struct *mm = get_task_mm(p);
4993 4997
4994 if (mm) { 4998 if (mm) {
@@ -5000,17 +5004,14 @@ static void mem_cgroup_move_task(struct cgroup_subsys_state *css,
5000 mem_cgroup_clear_mc(); 5004 mem_cgroup_clear_mc();
5001} 5005}
5002#else /* !CONFIG_MMU */ 5006#else /* !CONFIG_MMU */
5003static int mem_cgroup_can_attach(struct cgroup_subsys_state *css, 5007static int mem_cgroup_can_attach(struct cgroup_taskset *tset)
5004 struct cgroup_taskset *tset)
5005{ 5008{
5006 return 0; 5009 return 0;
5007} 5010}
5008static void mem_cgroup_cancel_attach(struct cgroup_subsys_state *css, 5011static void mem_cgroup_cancel_attach(struct cgroup_taskset *tset)
5009 struct cgroup_taskset *tset)
5010{ 5012{
5011} 5013}
5012static void mem_cgroup_move_task(struct cgroup_subsys_state *css, 5014static void mem_cgroup_move_task(struct cgroup_taskset *tset)
5013 struct cgroup_taskset *tset)
5014{ 5015{
5015} 5016}
5016#endif 5017#endif
@@ -5511,11 +5512,11 @@ void mem_cgroup_uncharge_list(struct list_head *page_list)
5511 * mem_cgroup_replace_page - migrate a charge to another page 5512 * mem_cgroup_replace_page - migrate a charge to another page
5512 * @oldpage: currently charged page 5513 * @oldpage: currently charged page
5513 * @newpage: page to transfer the charge to 5514 * @newpage: page to transfer the charge to
5514 * @lrucare: either or both pages might be on the LRU already
5515 * 5515 *
5516 * Migrate the charge from @oldpage to @newpage. 5516 * Migrate the charge from @oldpage to @newpage.
5517 * 5517 *
5518 * Both pages must be locked, @newpage->mapping must be set up. 5518 * Both pages must be locked, @newpage->mapping must be set up.
5519 * Either or both pages might be on the LRU already.
5519 */ 5520 */
5520void mem_cgroup_replace_page(struct page *oldpage, struct page *newpage) 5521void mem_cgroup_replace_page(struct page *oldpage, struct page *newpage)
5521{ 5522{