Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1423705
| Path | csiph.com!goblin2!goblin1!goblin.stu.neva.ru!border1.nntp.ams1.giganews.com!nntp.giganews.com!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Michal Hocko <mhocko@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 09/10] mm, oom_reaper: do not attempt to reap a task more than twice |
| Date | Thu, 16 Jun 2016 08:30:06 +0200 |
| Message-ID | <rKyYu-4LB-21@gated-at.bofh.it> (permalink) |
| References | <rI6MV-5RF-3@gated-at.bofh.it> <rI6MV-5RF-7@gated-at.bofh.it> <rKkiK-3Lp-9@gated-at.bofh.it> |
| X-Original-To | Oleg Nesterov <oleg@redhat.com> |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9yQHJk+/dd6HOJEYBbPgAjjYCF/dvsmlpTN0vZNeafA=; b=TX22qqYdQlZaBmUdzJ3hukZpHuZWnNz1veloadH7QHHdTlzSN115uwQDvnskX4xiam uzW6SHm73flInDFzvsYfiMbfUVokUH44uh19Zscq5H0ogMXmANGpzOLsdhrlgWrU3PL6 p8XYZi3C2zB+w2brLR8ZBYrrgb/0oqF42M7SHDRuqoTCbN38AyPWYJFMqevQXcaD5zxm Sb4q/dSrkc3qhYIe3m9dKwSfyyqCM20Dz8hQS1OmPxAQ0uWSqzS7++bn1FojeyACNr3v wUl3AgW5cc5DPtu3ER7OgIveZlTK+suyrVDyqBx5yeTS4EpEiUcYXMg092YqTo9dNuj8 h6pQ== |
| X-Gm-Message-State | ALyK8tIdRsRNrDrvQyWlrNvM5lshbNdHfOfWgJuH/uMare/58C0N3+kbX4L0DLWbxW++4Q== |
| X-Received | by 10.194.157.162 with SMTP id wn2mr2387675wjb.103.1466058495853; Wed, 15 Jun 2016 23:28:15 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.6.0 (2016-04-01) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 38 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-mm@kvack.org, Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>, David Rientjes <rientjes@google.com>, Vladimir Davydov <vdavydov@parallels.com>, Andrew Morton <akpm@linux-foundation.org>, LKML <linux-kernel@vger.kernel.org> |
| X-Original-Date | Thu, 16 Jun 2016 08:28:14 +0200 |
| X-Original-Message-ID | <20160616062814.GB30768@dhcp22.suse.cz> |
| X-Original-References | <1465473137-22531-1-git-send-email-mhocko@kernel.org> <1465473137-22531-10-git-send-email-mhocko@kernel.org> <20160615144835.GB7944@redhat.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1423705 |
Show key headers only | View raw
On Wed 15-06-16 16:48:35, Oleg Nesterov wrote:
> On 06/09, Michal Hocko wrote:
> >
> > @@ -556,8 +556,27 @@ static void oom_reap_task(struct task_struct *tsk)
> > schedule_timeout_idle(HZ/10);
> >
> > if (attempts > MAX_OOM_REAP_RETRIES) {
> > + struct task_struct *p;
> > +
> > pr_info("oom_reaper: unable to reap pid:%d (%s)\n",
> > task_pid_nr(tsk), tsk->comm);
> > +
> > + /*
> > + * If we've already tried to reap this task in the past and
> > + * failed it probably doesn't make much sense to try yet again
> > + * so hide the mm from the oom killer so that it can move on
> > + * to another task with a different mm struct.
> > + */
> > + p = find_lock_task_mm(tsk);
> > + if (p) {
> > + if (test_and_set_bit(MMF_OOM_NOT_REAPABLE, &p->mm->flags)) {
> > + pr_info("oom_reaper: giving up pid:%d (%s)\n",
> > + task_pid_nr(tsk), tsk->comm);
> > + set_bit(MMF_OOM_REAPED, &p->mm->flags);
>
> But why do we need MMF_OOM_NOT_REAPABLE? We set MMF_OOM_REAPED, oom_reap_task()
> should not see this task again, at least too often.
We set MMF_OOM_REAPED only when actually reaping something in
__oom_reap_task. We might have failed the mmap_sem read lock. The
purpose of this patch is to not encounter such a task for ever and do
not back off too easily. I guess we could set the flag unconditionally
after the first failure and can do that eventually when running out of
MMF flags but thiw way it looks like an easy trade off to me.
--
Michal Hocko
SUSE Labs
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH 09/10] mm, oom_reaper: do not attempt to reap a task more than twice Oleg Nesterov <oleg@redhat.com> - 2016-06-15 16:50 +0200 Re: [PATCH 09/10] mm, oom_reaper: do not attempt to reap a task more than twice Michal Hocko <mhocko@kernel.org> - 2016-06-16 08:30 +0200
csiph-web