projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vm_is_stack: use for_each_thread() rather then buggy while_each_thread()
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
mm
/
memcontrol.c
diff --git
a/mm/memcontrol.c
b/mm/memcontrol.c
index
53385cd
..
9b35da2
100644
(file)
--- a/
mm/memcontrol.c
+++ b/
mm/memcontrol.c
@@
-1127,8
+1127,8
@@
skip_node:
* skipping css reference should be safe.
*/
if (next_css) {
* skipping css reference should be safe.
*/
if (next_css) {
- if ((next_css
->flags & CSS_ONLINE) &&
-
(next_css == &root->css ||
css_tryget(next_css)))
+ if ((next_css
== &root->css) ||
+
((next_css->flags & CSS_ONLINE) &&
css_tryget(next_css)))
return mem_cgroup_from_css(next_css);
prev_css = next_css;
return mem_cgroup_from_css(next_css);
prev_css = next_css;
@@
-1687,7
+1687,7
@@
void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
* protects memcg_name and makes sure that parallel ooms do not
* interleave
*/
* protects memcg_name and makes sure that parallel ooms do not
* interleave
*/
- static DEFINE_
SPINLOCK
(oom_info_lock);
+ static DEFINE_
MUTEX
(oom_info_lock);
struct cgroup *task_cgrp;
struct cgroup *mem_cgrp;
static char memcg_name[PATH_MAX];
struct cgroup *task_cgrp;
struct cgroup *mem_cgrp;
static char memcg_name[PATH_MAX];
@@
-1698,7
+1698,7
@@
void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
if (!p)
return;
if (!p)
return;
-
spin
_lock(&oom_info_lock);
+
mutex
_lock(&oom_info_lock);
rcu_read_lock();
mem_cgrp = memcg->css.cgroup;
rcu_read_lock();
mem_cgrp = memcg->css.cgroup;
@@
-1767,7
+1767,7
@@
done:
pr_cont("\n");
}
pr_cont("\n");
}
-
spin
_unlock(&oom_info_lock);
+
mutex
_unlock(&oom_info_lock);
}
/*
}
/*
@@
-5670,8
+5670,12
@@
static int mem_cgroup_oom_notify_cb(struct mem_cgroup *memcg)
{
struct mem_cgroup_eventfd_list *ev;
{
struct mem_cgroup_eventfd_list *ev;
+ spin_lock(&memcg_oom_lock);
+
list_for_each_entry(ev, &memcg->oom_notify, list)
eventfd_signal(ev->eventfd, 1);
list_for_each_entry(ev, &memcg->oom_notify, list)
eventfd_signal(ev->eventfd, 1);
+
+ spin_unlock(&memcg_oom_lock);
return 0;
}
return 0;
}
@@
-6595,6
+6599,7
@@
static void mem_cgroup_css_offline(struct cgroup_subsys_state *css)
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
struct mem_cgroup_event *event, *tmp;
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
struct mem_cgroup_event *event, *tmp;
+ struct cgroup_subsys_state *iter;
/*
* Unregister events and notify userspace.
/*
* Unregister events and notify userspace.
@@
-6611,7
+6616,14
@@
static void mem_cgroup_css_offline(struct cgroup_subsys_state *css)
kmem_cgroup_css_offline(memcg);
mem_cgroup_invalidate_reclaim_iterators(memcg);
kmem_cgroup_css_offline(memcg);
mem_cgroup_invalidate_reclaim_iterators(memcg);
- mem_cgroup_reparent_charges(memcg);
+
+ /*
+ * This requires that offlining is serialized. Right now that is
+ * guaranteed because css_killed_work_fn() holds the cgroup_mutex.
+ */
+ css_for_each_descendant_post(iter, css)
+ mem_cgroup_reparent_charges(mem_cgroup_from_css(iter));
+
mem_cgroup_destroy_all_caches(memcg);
vmpressure_cleanup(&memcg->vmpressure);
}
mem_cgroup_destroy_all_caches(memcg);
vmpressure_cleanup(&memcg->vmpressure);
}