lkml.org 
[lkml]   [2013]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: memcg creates an unkillable task in 3.11-rc2
ebiederm@xmission.com (Eric W. Biederman) writes:

Ok. I have been trying for an hour and I have not been able to
reproduce the weird hang with the memcg, and it used to be something I
could reproduce trivially. So it appears the patch below is the fix.

After I sleep I will see if I can turn it into a proper patch.

Eric

> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 00a7a66..5998a57 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1792,16 +1792,6 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
> unsigned int points = 0;
> struct task_struct *chosen = NULL;
>
> - /*
> - * If current has a pending SIGKILL or is exiting, then automatically
> - * select it. The goal is to allow it to allocate so that it may
> - * quickly exit and free its memory.
> - */
> - if (fatal_signal_pending(current) || current->flags & PF_EXITING) {
> - set_thread_flag(TIF_MEMDIE);
> - return;
> - }
> -
> check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL);
> totalpages = mem_cgroup_get_limit(memcg) >> PAGE_SHIFT ? : 1;
> for_each_mem_cgroup_tree(iter, memcg) {
> @@ -2220,7 +2210,15 @@ static bool mem_cgroup_handle_oom(struct mem_cgroup *memcg, gfp_t mask,
> mem_cgroup_oom_notify(memcg);
> spin_unlock(&memcg_oom_lock);
>
> - if (need_to_kill) {
> + /*
> + * If current has a pending SIGKILL or is exiting, then automatically
> + * select it. The goal is to allow it to allocate so that it may
> + * quickly exit and free its memory.
> + */
> + if (fatal_signal_pending(current) || current->flags & PF_EXITING) {
> + set_thread_flag(TIF_MEMDIE);
> + finish_wait(&memcg_oom_waitq, &owait.wait);
> + } else if (need_to_kill) {
> finish_wait(&memcg_oom_waitq, &owait.wait);
> mem_cgroup_out_of_memory(memcg, mask, order);
> } else {


\
 
 \ /
  Last update: 2013-07-30 19:01    [W:0.101 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site