mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	David Rientjes <rientjes@google.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] oom: kill the insufficient and no longer needed PT_TRACE_EXIT check
Date: Tue, 2 Dec 2014 10:35:30 +0100	[thread overview]
Message-ID: <20141202093530.GC27014@dhcp22.suse.cz> (raw)
In-Reply-To: <20141127230408.GA25100@redhat.com>

On Fri 28-11-14 00:04:08, Oleg Nesterov wrote:
> After the previous patch we can remove the PT_TRACE_EXIT check in
> oom_scan_process_thread(), it was added to handle the case when the
> coredumping was "frozen" by ptrace, but it doesn't really work. If
> nothing else, we would need to check all threads which could share
> the same ->mm to make it more or less correct.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

I still do not see why we do not need task->ptrace & PT_TRACE_EXIT check
here. I do understand that the check on group_leader doesn't make much
sense. ptrace_event would block until the tracer let the task run again
which may be never AFAICS.

It is really sad how subtle and racy are all these checks :/

> ---
>  mm/oom_kill.c |   11 +++--------
>  1 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index 7af33b5..a2a4036 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -287,14 +287,9 @@ enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
>  	if (oom_task_origin(task))
>  		return OOM_SCAN_SELECT;
>  
> -	if (task_will_free_mem(task) && !force_kill) {
> -		/*
> -		 * If this task is not being ptraced on exit, then wait for it
> -		 * to finish before killing some other task unnecessarily.
> -		 */
> -		if (!(task->group_leader->ptrace & PT_TRACE_EXIT))
> -			return OOM_SCAN_ABORT;
> -	}
> +	if (task_will_free_mem(task) && !force_kill)
> +		return OOM_SCAN_ABORT;
> +
>  	return OOM_SCAN_OK;
>  }
>  
> -- 
> 1.5.5.1
> 

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2014-12-02  9:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27 23:03 [PATCH 0/2] oom && coredump Oleg Nesterov
2014-11-27 23:04 ` [PATCH 1/2] oom: don't assume that a coredumping thread will exit soon Oleg Nesterov
2014-12-02  9:19   ` Michal Hocko
2014-12-02 17:50     ` Oleg Nesterov
2014-12-02 18:31       ` Michal Hocko
2014-12-02 19:16         ` Oleg Nesterov
2014-12-03 13:07           ` Michal Hocko
2014-11-27 23:04 ` [PATCH 2/2] oom: kill the insufficient and no longer needed PT_TRACE_EXIT check Oleg Nesterov
2014-12-02  9:35   ` Michal Hocko [this message]
2014-12-02 18:05     ` Oleg Nesterov
2014-12-02 18:23       ` Michal Hocko
2014-11-28 19:28 ` [PATCH 0/2] oom && coredump Oleg Nesterov
2014-12-03 19:50 ` [PATCH v2 0/1] oom: don't assume that a coredumping thread will exit soon Oleg Nesterov
2014-12-03 19:50   ` [PATCH v2 1/1] " Oleg Nesterov
2014-12-03 21:58     ` Andrew Morton
2014-12-04 14:34     ` Michal Hocko
2014-12-05 23:46     ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141202093530.GC27014@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=rientjes@google.com \
    --cc=rjw@rjwysocki.net \
    --cc=tj@kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome