mm/vmstat: add oom_kill counter
Subsystems (3)
PATCH 1/1 mm/vmstat: add oom_kill counter
Show count of global oom killer invocations in /proc/vmstat
--- include/linux/vm_event_item.h | 1 + mm/oom_kill.c | 1 + mm/vmstat.c | 1 + 3 files changed, 3 insertions(+)
include/linux/vm_event_item.h +1 -0
@@ -41,6 +41,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,KSWAPD_LOW_WMARK_HIT_QUICKLY ,KSWAPD_HIGH_WMARK_HIT_QUICKLY ,PAGEOUTRUN ,PGROTATED ,DROP_PAGECACHE ,DROP_SLAB , +OOM_KILL , #ifdef CONFIG_NUMA_BALANCINGNUMA_PTE_UPDATES , NUMA_HUGE_PTE_UPDATES,
mm/oom_kill.c +1 -0
@@ -883,6 +883,7 @@ static void oom_kill_process(struct oom_control *oc, const char *message)*/ do_send_sig_info (SIGKILL ,SEND_SIG_FORCED , victim, true);mark_oom_victim (victim); +count_vm_event (OOM_KILL ); pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", task_pid_nr(victim), victim->comm, K(victim->mm->total_vm), K(get_mm_counter(victim->mm, MM_ANONPAGES)),
mm/vmstat.c +1 -0
@@ -1018,6 +1018,7 @@ const char * const vmstat_text[] = {"drop_pagecache" ,"drop_slab" , +"oom_kill" , #ifdef CONFIG_NUMA_BALANCING "numa_pte_updates",
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 1 line · Konstantin Khlebnikov
Show count of global oom killer invocations in
/proc/vmstat
Oops, this actually counts memcg kills too. Will redo.
Quoted 38 lines
Signed-off-by Konstantin Khlebnikov <[email protected]>--- include/linux/vm_event_item.h | 1 + mm/oom_kill.c | 1 + mm/vmstat.c | 1 + 3 files changed, 3 insertions(+)include/linux/vm_event_item.h +1
-0@@ -41,6 +41,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,KSWAPD_LOW_WMARK_HIT_QUICKLY ,KSWAPD_HIGH_WMARK_HIT_QUICKLY ,PAGEOUTRUN ,PGROTATED ,DROP_PAGECACHE ,DROP_SLAB , +OOM_KILL , #ifdef CONFIG_NUMA_BALANCINGNUMA_PTE_UPDATES , NUMA_HUGE_PTE_UPDATES,mm/oom_kill.c +1
-0@@ -883,6 +883,7 @@ static void oom_kill_process(struct oom_control *oc, const char *message)*/ do_send_sig_info (SIGKILL ,SEND_SIG_FORCED , victim, true);mark_oom_victim (victim); +count_vm_event (OOM_KILL ); pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", task_pid_nr(victim), victim->comm, K(victim->mm->total_vm), K(get_mm_counter(victim->mm, MM_ANONPAGES)),mm/vmstat.c +0
-0
mm/vmstat.c const char * const vmstat_text[] = { · line 1024
Quoted 7 lines
mm/vmstat.c +1
-0@@ -1018,6 +1018,7 @@ const char * const vmstat_text[] = {"drop_pagecache" ,"drop_slab" , +"oom_kill" , #ifdef CONFIG_NUMA_BALANCING "numa_pte_updates",
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 1 line · Konstantin Khlebnikov
Show count of global oom killer invocations in
/proc/vmstat
Maybe some more rationale why is that useful?
Vlastimil
Quoted 45 lines
Signed-off-by Konstantin Khlebnikov <[email protected]>--- include/linux/vm_event_item.h | 1 + mm/oom_kill.c | 1 + mm/vmstat.c | 1 + 3 files changed, 3 insertions(+)include/linux/vm_event_item.h +1
-0@@ -41,6 +41,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,KSWAPD_LOW_WMARK_HIT_QUICKLY ,KSWAPD_HIGH_WMARK_HIT_QUICKLY ,PAGEOUTRUN ,PGROTATED ,DROP_PAGECACHE ,DROP_SLAB , +OOM_KILL , #ifdef CONFIG_NUMA_BALANCINGNUMA_PTE_UPDATES , NUMA_HUGE_PTE_UPDATES,mm/oom_kill.c +1
-0@@ -883,6 +883,7 @@ static void oom_kill_process(struct oom_control *oc, const char *message)*/ do_send_sig_info (SIGKILL ,SEND_SIG_FORCED , victim, true);mark_oom_victim (victim); +count_vm_event (OOM_KILL ); pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", task_pid_nr(victim), victim->comm, K(victim->mm->total_vm), K(get_mm_counter(victim->mm, MM_ANONPAGES)),mm/vmstat.c +1
-1@@ -1018,6 +1018,7 @@ const char * const vmstat_text[] = {"drop_pagecache" ,"drop_slab" , +"oom_kill" , #ifdef CONFIG_NUMA_BALANCING "numa_pte_updates", --
Quoted 5 lines
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · Vlastimil Babka
Quoted 1 line · Konstantin Khlebnikov
Show count of global oom killer invocations in
/proc/vmstatMaybe some more rationale why is that useful?
Currently the only way to detect oom kill is grepping kernel logs. This counter makes such monitoring much easier.
Quoted 47 lines
Vlastimil
Quoted 44 lines
Signed-off-by Konstantin Khlebnikov <[email protected]>--- include/linux/vm_event_item.h | 1 + mm/oom_kill.c | 1 + mm/vmstat.c | 1 + 3 files changed, 3 insertions(+)include/linux/vm_event_item.h +1
-0@@ -41,6 +41,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,KSWAPD_LOW_WMARK_HIT_QUICKLY ,KSWAPD_HIGH_WMARK_HIT_QUICKLY ,PAGEOUTRUN ,PGROTATED ,DROP_PAGECACHE ,DROP_SLAB , +OOM_KILL , #ifdef CONFIG_NUMA_BALANCINGNUMA_PTE_UPDATES , NUMA_HUGE_PTE_UPDATES,mm/oom_kill.c +1
-0@@ -883,6 +883,7 @@ static void oom_kill_process(struct oom_control *oc, const char *message)*/ do_send_sig_info (SIGKILL ,SEND_SIG_FORCED , victim, true);mark_oom_victim (victim); +count_vm_event (OOM_KILL ); pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", task_pid_nr(victim), victim->comm, K(victim->mm->total_vm), K(get_mm_counter(victim->mm, MM_ANONPAGES)),mm/vmstat.c +1
-0@@ -1018,6 +1018,7 @@ const char * const vmstat_text[] = {"drop_pagecache" ,"drop_slab" , +"oom_kill" , #ifdef CONFIG_NUMA_BALANCING "numa_pte_updates",
Quoted 7 lines
Quoted 6 lines
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>