Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127598
b: refs/heads/master
c: 7f4d454
h: refs/heads/master
v: v3
  • Loading branch information
Daisuke Nishimura authored and Linus Torvalds committed Jan 8, 2009
1 parent 92cb4c5 commit d8316fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a5e924f5f8abf97944e625d74967cc9452cfbce8
refs/heads/master: 7f4d454dee2e0bdd21bafd413d1c53e443a26540
5 changes: 5 additions & 0 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static int really_do_swap_account __initdata = 1; /* for remember boot option*/
#define do_swap_account (0)
#endif

static DEFINE_MUTEX(memcg_tasklist); /* can be hold under cgroup_mutex */

/*
* Statistics for memory cgroup.
Expand Down Expand Up @@ -827,7 +828,9 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,

if (!nr_retries--) {
if (oom) {
mutex_lock(&memcg_tasklist);
mem_cgroup_out_of_memory(mem_over_limit, gfp_mask);
mutex_unlock(&memcg_tasklist);
mem_over_limit->last_oom_jiffies = jiffies;
}
goto nomem;
Expand Down Expand Up @@ -2211,10 +2214,12 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
struct cgroup *old_cont,
struct task_struct *p)
{
mutex_lock(&memcg_tasklist);
/*
* FIXME: It's better to move charges of this process from old
* memcg to new memcg. But it's just on TODO-List now.
*/
mutex_unlock(&memcg_tasklist);
}

struct cgroup_subsys mem_cgroup_subsys = {
Expand Down
2 changes: 0 additions & 2 deletions trunk/mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask)
unsigned long points = 0;
struct task_struct *p;

cgroup_lock();
read_lock(&tasklist_lock);
retry:
p = select_bad_process(&points, mem);
Expand All @@ -444,7 +443,6 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask)
goto retry;
out:
read_unlock(&tasklist_lock);
cgroup_unlock();
}
#endif

Expand Down

0 comments on commit d8316fa

Please sign in to comment.