Skip to contentSkip to conversation

mm: add show num_poisoned_pages when oom

PATCH Superseded Xishi Qiu 4 participants 5 messages Dec 9, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Xishi Qiu

author
#0 lore raw

PATCH 1/1 mm: add show num_poisoned_pages when oom

Show num_poisoned_pages when oom, it is helpful to find the reason.

---
 lib/show_mem.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
lib/show_mem.c +3 -0
index 5847a49..1cbdcd8 100644
@@ -46,4 +46,7 @@ void show_mem(unsigned int filter)
 	printk("%lu pages in pagetable cache\n",
 		quicklist_total_size());
 #endif
+#ifdef CONFIG_MEMORY_FAILURE
+	printk("%lu pages poisoned\n", atomic_long_read(&num_poisoned_pages));
+#endif
 }
Signature · 7 lines
1.7.1

--
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>
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Xishi Qiu

Show num_poisoned_pages when oom, it is helpful to find the reason.

I would not expect the number of these pages would be too high to matter in real life but having the information cannot be harmful in any way.

Quoted 19 lines
---
 lib/show_mem.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
lib/show_mem.c +3 -0
index 5847a49..1cbdcd8 100644
@@ -46,4 +46,7 @@ void show_mem(unsigned int filter)
 	printk("%lu pages in pagetable cache\n",
 		quicklist_total_size());
 #endif
+#ifdef CONFIG_MEMORY_FAILURE
+	printk("%lu pages poisoned\n", atomic_long_read(&num_poisoned_pages));
+#endif
 }
Signature · 1 line
1.7.1
Signature · 8 lines
Michal Hocko
SUSE Labs

--
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>
Acked-by on v1 1/1
#2 lore raw
In reply to Xishi Qiu
Quoted 3 lines · Xishi Qiu

Show num_poisoned_pages when oom, it is helpful to find the reason.

Although this patch says it's for oom conditions, it will be emitted anytime show_mem() is called which sounds good as well.

--
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>

#3 lore raw
In reply to Xishi Qiu
Quoted 12 lines · Xishi Qiu

Show num_poisoned_pages when oom, it is helpful to find the reason.

---
 lib/show_mem.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
lib/show_mem.c +0 -0
index 5847a49..1cbdcd8 100644

lib/show_mem.c void show_mem(unsigned int filter) · line 52

Quoted 7 lines
lib/show_mem.c +3 -0
@@ -46,4 +46,7 @@ void show_mem(unsigned int filter)
 	printk("%lu pages in pagetable cache\n",
 		quicklist_total_size());
 #endif
+#ifdef CONFIG_MEMORY_FAILURE
+	printk("%lu pages poisoned\n", atomic_long_read(&num_poisoned_pages));
+#endif
 }

I think that just "poisoned" could be confusing because this word seems to be used also in other context (like slab and list_debug handling.) "hwpoisoned" or "hardware corrupted" (which is the same label in /proc/meminfo) looks better to me.

Thanks,
Naoya Horiguchi

--
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>

#4 lore raw
Quoted 16 lines · Naoya Horiguchi
Quoted 16 lines

Show num_poisoned_pages when oom, it is helpful to find the reason.

---
 lib/show_mem.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
lib/show_mem.c +1 -0
index 5847a49..1cbdcd8 100644
@@ -46,4 +46,7 @@ void show_mem(unsigned int filter)
 	printk("%lu pages in pagetable cache\n",
 		quicklist_total_size());
 #endif
+#ifdef CONFIG_MEMORY_FAILURE
Quoted 9 lines

lib/show_mem.c void show_mem(unsigned int filter) · line 52

Quoted 3 lines
lib/show_mem.c +2 -0
+	printk("%lu pages poisoned\n", atomic_long_read(&num_poisoned_pages));
+#endif
 }

I think that just "poisoned" could be confusing because this word seems to be used also in other context (like slab and list_debug handling.) "hwpoisoned" or "hardware corrupted" (which is the same label in /proc/meminfo) looks better to me.

Ah, good point.

--
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>