From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: kosaki.motohiro@jp.fujitsu.com,
LKML <linux-kernel@vger.kernel.org>,
Paul Menage <menage@google.com>,
David Rientjes <rientjes@google.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Rik van Riel <riel@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>, linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH 1/4] oom: move oom_adj to signal_struct
Date: Wed, 5 Aug 2009 11:51:31 +0900 (JST) [thread overview]
Message-ID: <20090805114650.5BA1.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20090805114004.459a7deb.minchan.kim@barrios-desktop>
> On Wed, 5 Aug 2009 11:29:34 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
>
> > Hi
> >
> > > Hi, Kosaki.
> > >
> > > I am so late to invole this thread.
> > > But let me have a question.
> > >
> > > What's advantage of placing oom_adj in singal rather than task ?
> > > I mean task->oom_adj and task->signal->oom_adj ?
> > >
> > > I am sorry if you already discussed it at last threads.
> >
> > Not sorry. that's very good question.
> >
> > I'm trying to explain the detailed intention of commit 2ff05b2b4eac
> > (move oom_adj to mm_struct).
> >
> > In 2.6.30, OOM logic callflow is here.
> >
> > __out_of_memory
> > select_bad_process for each task
> > badness calculate badness of one task
> > oom_kill_process search child
> > oom_kill_task kill target task and mm shared tasks with it
> >
> > example, process-A have two thread, thread-A and thread-B and it
> > have very fat memory.
> > And, each thread have following likes oom property.
> >
> > thread-A: oom_adj = OOM_DISABLE, oom_score = 0
> > thread-B: oom_adj = 0, oom_score = very-high
> >
> > Then, select_bad_process() select thread-B, but oom_kill_task refuse
> > kill the task because thread-A have OOM_DISABLE.
> > __out_of_memory() call select_bad_process() again. but select_bad_process()
> > select the same task. It mean kernel fall in the livelock.
> >
> > The fact is, select_bad_process() must select killable task. otherwise
> > OOM logic go into livelock.
> >
> > Is this enough explanation? thanks.
> >
>
> Thanks for good explanation. :)
>
> It resulted from patch of David which moved task_struct->oom_ajd
> to mm_struct. I understood it.
No. It's very old problem. David's patch fixed it.
It mean per-process oom_adj prevent select_bad_process() return
a task in unkillable process.
unfortunatelly, his patch can't treat vfork case ideally. I hope to
fix it.
> It meant oom_adj was not per-process.
>
> AFAIU, you want to make oom_adj per-process, again.
> And you selected the place with task->singal as per-process.
>
> What I have a question is that why do you select task_struct->signal
> rather than task_struct like old?
>
> What's benefit of using task_struct->signal ?
prior Davied patch (task->oom_adj) might makes livelock.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-08-05 2:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-04 10:25 [PATCH for 2.6.31 0/4] fix oom_adj regression v2 KOSAKI Motohiro
2009-08-04 10:25 ` [PATCH 1/4] oom: move oom_adj to signal_struct KOSAKI Motohiro
2009-08-05 0:45 ` Minchan Kim
2009-08-05 2:29 ` KOSAKI Motohiro
2009-08-05 2:40 ` Minchan Kim
2009-08-05 2:51 ` KOSAKI Motohiro [this message]
2009-08-05 5:55 ` Minchan Kim
2009-08-05 6:03 ` KAMEZAWA Hiroyuki
2009-08-05 6:37 ` Minchan Kim
2009-08-05 6:53 ` KOSAKI Motohiro
2009-08-05 7:20 ` Minchan Kim
2009-08-05 6:55 ` KAMEZAWA Hiroyuki
2009-08-05 6:04 ` KOSAKI Motohiro
2009-08-05 6:29 ` Minchan Kim
2009-08-05 6:47 ` KOSAKI Motohiro
2009-08-06 1:34 ` Oleg Nesterov
2009-08-06 5:16 ` KOSAKI Motohiro
2009-08-04 10:26 ` [PATCH 2/4] oom: make oom_score to per-process value KOSAKI Motohiro
2009-08-04 10:27 ` [PATCH 3/4] oom: oom_kill doesn't kill vfork parent(or child) KOSAKI Motohiro
2009-08-04 10:28 ` [PATCH 4/4] oom: fix oom_adjust_write() input sanity check KOSAKI Motohiro
2009-08-05 23:33 ` Andrew Morton
2009-08-06 5:06 ` KOSAKI Motohiro
2009-08-05 23:39 ` [PATCH for 2.6.31 0/4] fix oom_adj regression v2 Andrew Morton
2009-08-06 5:13 ` KOSAKI Motohiro
2009-08-06 8:07 ` Minchan Kim
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=20090805114650.5BA1.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=menage@google.com \
--cc=minchan.kim@gmail.com \
--cc=oleg@redhat.com \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
--cc=torvalds@linux-foundation.org \
/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