Skip to contentSkip to conversation

use oom_killer_disabled in all oom pathes

PATCH In review Dave Young 3 participants 7 messages Apr 26, 2011

Subsystems (3)
lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 1/1 use oom_killer_disabled in all oom pathes

oom_killer_disable should be a global switch, also fit for oom paths other than __alloc_pages_slowpath

Here add it to mem_cgroup_handle_oom and pagefault_out_of_memory as well.

---
 mm/memcontrol.c |    2 +-
 mm/oom_kill.c   |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
mm/memcontrol.c +1 -1
@@ -1610,7 +1610,7 @@ bool mem_cgroup_handle_oom(struct mem_cg
 	 * under OOM is always welcomed, use TASK_KILLABLE here.
 	 */
 	prepare_to_wait(&memcg_oom_waitq, &owait.wait, TASK_KILLABLE);
-	if (!locked || mem->oom_kill_disable)
+	if (!locked || mem->oom_kill_disable || oom_killer_disabled)
 		need_to_kill = false;
 	if (locked)
 		mem_cgroup_oom_notify(mem);
mm/oom_kill.c +3 -0
@@ -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();

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 4 lines

oom_killer_disable should be a global switch, also fit for oom paths other than __alloc_pages_slowpath

Here add it to mem_cgroup_handle_oom and pagefault_out_of_memory as well.

Can you please explain more? Why should? Now oom_killer_disabled is used only hibernation path. so, Why pagefault and memcg allocation will be happen?

author
#2 lore raw
Quoted 7 lines · KOSAKI Motohiro
Quoted 4 lines

oom_killer_disable should be a global switch, also fit for oom paths other than __alloc_pages_slowpath

Here add it to mem_cgroup_handle_oom and pagefault_out_of_memory as well.

Can you please explain more? Why should? Now oom_killer_disabled is used only hibernation path. so, Why pagefault and memcg allocation will be happen?

Indeed I'm using it in virtio balloon test, oom killer triggered when memory pressure is high.

literally oom_killer_disabled scope should be global, isn't it?

Signature · 2 lines
Regards
dave
#3 lore raw
Quoted 7 lines
Quoted 5 lines · KOSAKI Motohiro
Quoted 4 lines

oom_killer_disable should be a global switch, also fit for oom paths other than __alloc_pages_slowpath

Here add it to mem_cgroup_handle_oom and pagefault_out_of_memory as well.

Quoted 7 lines
Quoted 2 lines

Can you please explain more? Why should? Now oom_killer_disabled is used only hibernation path. so, Why pagefault and memcg allocation will be happen?

Indeed I'm using it in virtio balloon test, oom killer triggered when memory pressure is high.

literally oom_killer_disabled scope should be global, isn't it?

ok. virtio baloon seems fair usage. if you add new usage of oom_killer_disabled into the patch description, I'll ack this one.

thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#4 lore raw
Quoted 10 lines · KOSAKI Motohiro
Quoted 10 lines
Quoted 7 lines · KOSAKI Motohiro
Quoted 4 lines

oom_killer_disable should be a global switch, also fit for oom paths other than __alloc_pages_slowpath

Here add it to mem_cgroup_handle_oom and pagefault_out_of_memory as well.

Can you please explain more? Why should? Now oom_killer_disabled is used only hibernation path. so, Why pagefault and memcg allocation will be happen?

Quoted 7 lines
Quoted 4 lines

Indeed I'm using it in virtio balloon test, oom killer triggered when memory pressure is high.

literally oom_killer_disabled scope should be global, isn't it?

ok. virtio baloon seems fair usage. if you add new usage of oom_killer_disabled into the patch description, I'll ack this one.

Thanks, then I will resend the virtio balloon patch along with this.

Signature · 2 lines
Regards
dave
#5 lore raw
Quoted 15 lines · On Tue, 26 Apr 2011 11:19:22 +0800 Dave Young <[email protected]> wrote:
Quoted 13 lines · KOSAKI Motohiro
Quoted 13 lines
Quoted 7 lines · KOSAKI Motohiro
Quoted 4 lines

oom_killer_disable should be a global switch, also fit for oom paths other than __alloc_pages_slowpath

Here add it to mem_cgroup_handle_oom and pagefault_out_of_memory as well.

Can you please explain more? Why should? Now oom_killer_disabled is used only hibernation path. so, Why pagefault and memcg allocation will be happen?

Indeed I'm using it in virtio balloon test, oom killer triggered when memory pressure is high.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

literally oom_killer_disabled scope should be global, isn't it?

ok. virtio baloon seems fair usage. if you add new usage of oom_killer_disabled into the patch description, I'll ack this one.

Thanks, then I will resend the virtio balloon patch along with this.

Amount of free memory doesn't affect memory cgroup's OOM because it just works against the limit. So, the code for memcg isn't necessary.

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#6 lore raw
Quoted 20 lines · KAMEZAWA Hiroyuki
Quoted 17 lines · On Tue, 26 Apr 2011 11:19:22 +0800 Dave Young <[email protected]> wrote:
Quoted 15 lines · KOSAKI Motohiro
Quoted 14 lines
Quoted 7 lines · KOSAKI Motohiro
Quoted 4 lines

oom_killer_disable should be a global switch, also fit for oom paths other than __alloc_pages_slowpath

Here add it to mem_cgroup_handle_oom and pagefault_out_of_memory as well.

Can you please explain more? Why should? Now oom_killer_disabled is used only hibernation path. so, Why pagefault and memcg allocation will be happen?

Indeed I'm using it in virtio balloon test, oom killer triggered when memory pressure is high.

literally oom_killer_disabled scope should be global, isn't it?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

ok. virtio baloon seems fair usage. if you add new usage of oom_killer_disabled into the patch description, I'll ack this one.

Thanks, then I will resend the virtio balloon patch along with this.

Amount of free memory doesn't affect memory cgroup's OOM because it just works against the limit. So, the code for memcg isn't necessary.

Right, thanks for pointing out this, will remove the memcg part

Quoted 6 lines

Thanks,
-Kame

Signature · 9 lines
Regards
dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>