2011-04-26 05:21:03

by Dave Young

[permalink] [raw]
Subject: [PATCH 2/2] use oom_killer_disabled in page fault oom path

Currently oom_killer_disabled is only used in __alloc_pages_slowpath,
For page fault oom case it is not considered. One use case is
virtio balloon driver, when memory pressure is high, virtio ballooning
will cause oom killing due to such as page fault oom.

Thus add oom_killer_disabled checking in pagefault_out_of_memory.

Signed-off-by: Dave Young <[email protected]>
---
mm/oom_kill.c | 3 +++
1 file changed, 3 insertions(+)

--- linux-2.6.orig/mm/oom_kill.c 2011-04-26 11:32:21.446452686 +0800
+++ linux-2.6/mm/oom_kill.c 2011-04-26 11:33:05.426452586 +0800
@@ -747,6 +747,9 @@ out:
*/
void pagefault_out_of_memory(void)
{
+ if (oom_killer_disabled)
+ return;
+
if (try_set_system_oom()) {
out_of_memory(NULL, 0, 0, NULL);
clear_system_oom();


2011-04-26 05:26:25

by Kamezawa Hiroyuki

[permalink] [raw]
Subject: Re: [PATCH 2/2] use oom_killer_disabled in page fault oom path

On Tue, 26 Apr 2011 13:31:50 +0800
Dave Young <[email protected]> wrote:

> Currently oom_killer_disabled is only used in __alloc_pages_slowpath,
> For page fault oom case it is not considered. One use case is
> virtio balloon driver, when memory pressure is high, virtio ballooning
> will cause oom killing due to such as page fault oom.
>
> Thus add oom_killer_disabled checking in pagefault_out_of_memory.
>
> Signed-off-by: Dave Young <[email protected]>

Reviewed-by: KAMEZAWA Hiroyuki <[email protected]>

2011-04-26 05:51:09

by KOSAKI Motohiro

[permalink] [raw]
Subject: Re: [PATCH 2/2] use oom_killer_disabled in page fault oom path

> Currently oom_killer_disabled is only used in __alloc_pages_slowpath,
> For page fault oom case it is not considered. One use case is
> virtio balloon driver, when memory pressure is high, virtio ballooning
> will cause oom killing due to such as page fault oom.
>
> Thus add oom_killer_disabled checking in pagefault_out_of_memory.
>
> Signed-off-by: Dave Young <[email protected]>

Thank you.
Reviewed-by: KOSAKI Motohiro <[email protected]>


2011-04-26 08:07:38

by Minchan Kim

[permalink] [raw]
Subject: Re: [PATCH 2/2] use oom_killer_disabled in page fault oom path

On Tue, Apr 26, 2011 at 2:31 PM, Dave Young <[email protected]> wrote:
> Currently oom_killer_disabled is only used in __alloc_pages_slowpath,
> For page fault oom case it is not considered. One use case is
> virtio balloon driver, when memory pressure is high, virtio ballooning
> will cause oom killing due to such as page fault oom.

Other mm guys already accepted but sorry I can't understand your point
since I am not familiar with virtio.

Now oom_killer_disabled is used by only hibernation and hibernation
freezes processes so page fault shouldn't happen.

Now are you using oom_killer_disabled in virtio?
Could you elaborate use case ?

Thanks.
--
Kind regards,
Minchan Kim

2011-04-26 08:21:55

by Minchan Kim

[permalink] [raw]
Subject: Re: [PATCH 2/2] use oom_killer_disabled in page fault oom path

On Tue, Apr 26, 2011 at 5:07 PM, Minchan Kim <[email protected]> wrote:
> On Tue, Apr 26, 2011 at 2:31 PM, Dave Young <[email protected]> wrote:
>> Currently oom_killer_disabled is only used in __alloc_pages_slowpath,
>> For page fault oom case it is not considered. One use case is
>> virtio balloon driver, when memory pressure is high, virtio ballooning
>> will cause oom killing due to such as page fault oom.
>
> Other mm guys already accepted but sorry I can't understand your point
> since I am not familiar with virtio.
>
> Now oom_killer_disabled is used by only hibernation and hibernation
> freezes processes so page fault shouldn't happen.
>
> Now are you using oom_killer_disabled in virtio?
> Could you elaborate use case ?

Sorry, I lost your [1/2] in my mail box.
I will see it in marc linux-mm

--
Kind regards,
Minchan Kim