summaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c52
1 files changed, 21 insertions, 31 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 67c30eb993f0..5a544c6c0717 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -184,9 +184,8 @@ static int kill_proc(struct task_struct *t, unsigned long addr, int trapno,
184 struct siginfo si; 184 struct siginfo si;
185 int ret; 185 int ret;
186 186
187 printk(KERN_ERR 187 pr_err("MCE %#lx: Killing %s:%d due to hardware memory corruption\n",
188 "MCE %#lx: Killing %s:%d due to hardware memory corruption\n", 188 pfn, t->comm, t->pid);
189 pfn, t->comm, t->pid);
190 si.si_signo = SIGBUS; 189 si.si_signo = SIGBUS;
191 si.si_errno = 0; 190 si.si_errno = 0;
192 si.si_addr = (void *)addr; 191 si.si_addr = (void *)addr;
@@ -209,8 +208,8 @@ static int kill_proc(struct task_struct *t, unsigned long addr, int trapno,
209 ret = send_sig_info(SIGBUS, &si, t); /* synchronous? */ 208 ret = send_sig_info(SIGBUS, &si, t); /* synchronous? */
210 } 209 }
211 if (ret < 0) 210 if (ret < 0)
212 printk(KERN_INFO "MCE: Error sending signal to %s:%d: %d\n", 211 pr_info("MCE: Error sending signal to %s:%d: %d\n",
213 t->comm, t->pid, ret); 212 t->comm, t->pid, ret);
214 return ret; 213 return ret;
215} 214}
216 215
@@ -290,8 +289,7 @@ static void add_to_kill(struct task_struct *tsk, struct page *p,
290 } else { 289 } else {
291 tk = kmalloc(sizeof(struct to_kill), GFP_ATOMIC); 290 tk = kmalloc(sizeof(struct to_kill), GFP_ATOMIC);
292 if (!tk) { 291 if (!tk) {
293 printk(KERN_ERR 292 pr_err("MCE: Out of memory while machine check handling\n");
294 "MCE: Out of memory while machine check handling\n");
295 return; 293 return;
296 } 294 }
297 } 295 }
@@ -336,9 +334,8 @@ static void kill_procs(struct list_head *to_kill, int forcekill, int trapno,
336 * signal and then access the memory. Just kill it. 334 * signal and then access the memory. Just kill it.
337 */ 335 */
338 if (fail || tk->addr_valid == 0) { 336 if (fail || tk->addr_valid == 0) {
339 printk(KERN_ERR 337 pr_err("MCE %#lx: forcibly killing %s:%d because of failure to unmap corrupted page\n",
340 "MCE %#lx: forcibly killing %s:%d because of failure to unmap corrupted page\n", 338 pfn, tk->tsk->comm, tk->tsk->pid);
341 pfn, tk->tsk->comm, tk->tsk->pid);
342 force_sig(SIGKILL, tk->tsk); 339 force_sig(SIGKILL, tk->tsk);
343 } 340 }
344 341
@@ -350,9 +347,8 @@ static void kill_procs(struct list_head *to_kill, int forcekill, int trapno,
350 */ 347 */
351 else if (kill_proc(tk->tsk, tk->addr, trapno, 348 else if (kill_proc(tk->tsk, tk->addr, trapno,
352 pfn, page, flags) < 0) 349 pfn, page, flags) < 0)
353 printk(KERN_ERR 350 pr_err("MCE %#lx: Cannot send advisory machine check signal to %s:%d\n",
354 "MCE %#lx: Cannot send advisory machine check signal to %s:%d\n", 351 pfn, tk->tsk->comm, tk->tsk->pid);
355 pfn, tk->tsk->comm, tk->tsk->pid);
356 } 352 }
357 put_task_struct(tk->tsk); 353 put_task_struct(tk->tsk);
358 kfree(tk); 354 kfree(tk);
@@ -563,7 +559,7 @@ static int me_kernel(struct page *p, unsigned long pfn)
563 */ 559 */
564static int me_unknown(struct page *p, unsigned long pfn) 560static int me_unknown(struct page *p, unsigned long pfn)
565{ 561{
566 printk(KERN_ERR "MCE %#lx: Unknown page state\n", pfn); 562 pr_err("MCE %#lx: Unknown page state\n", pfn);
567 return MF_FAILED; 563 return MF_FAILED;
568} 564}
569 565
@@ -608,8 +604,8 @@ static int me_pagecache_clean(struct page *p, unsigned long pfn)
608 if (mapping->a_ops->error_remove_page) { 604 if (mapping->a_ops->error_remove_page) {
609 err = mapping->a_ops->error_remove_page(mapping, p); 605 err = mapping->a_ops->error_remove_page(mapping, p);
610 if (err != 0) { 606 if (err != 0) {
611 printk(KERN_INFO "MCE %#lx: Failed to punch page: %d\n", 607 pr_info("MCE %#lx: Failed to punch page: %d\n",
612 pfn, err); 608 pfn, err);
613 } else if (page_has_private(p) && 609 } else if (page_has_private(p) &&
614 !try_to_release_page(p, GFP_NOIO)) { 610 !try_to_release_page(p, GFP_NOIO)) {
615 pr_info("MCE %#lx: failed to release buffers\n", pfn); 611 pr_info("MCE %#lx: failed to release buffers\n", pfn);
@@ -624,8 +620,7 @@ static int me_pagecache_clean(struct page *p, unsigned long pfn)
624 if (invalidate_inode_page(p)) 620 if (invalidate_inode_page(p))
625 ret = MF_RECOVERED; 621 ret = MF_RECOVERED;
626 else 622 else
627 printk(KERN_INFO "MCE %#lx: Failed to invalidate\n", 623 pr_info("MCE %#lx: Failed to invalidate\n", pfn);
628 pfn);
629 } 624 }
630 return ret; 625 return ret;
631} 626}
@@ -854,8 +849,7 @@ static int page_action(struct page_state *ps, struct page *p,
854 if (ps->action == me_swapcache_dirty && result == MF_DELAYED) 849 if (ps->action == me_swapcache_dirty && result == MF_DELAYED)
855 count--; 850 count--;
856 if (count != 0) { 851 if (count != 0) {
857 printk(KERN_ERR 852 pr_err("MCE %#lx: %s still referenced by %d users\n",
858 "MCE %#lx: %s still referenced by %d users\n",
859 pfn, action_page_types[ps->type], count); 853 pfn, action_page_types[ps->type], count);
860 result = MF_FAILED; 854 result = MF_FAILED;
861 } 855 }
@@ -934,8 +928,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
934 } 928 }
935 929
936 if (PageSwapCache(p)) { 930 if (PageSwapCache(p)) {
937 printk(KERN_ERR 931 pr_err("MCE %#lx: keeping poisoned page in swap cache\n", pfn);
938 "MCE %#lx: keeping poisoned page in swap cache\n", pfn);
939 ttu |= TTU_IGNORE_HWPOISON; 932 ttu |= TTU_IGNORE_HWPOISON;
940 } 933 }
941 934
@@ -953,8 +946,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
953 } else { 946 } else {
954 kill = 0; 947 kill = 0;
955 ttu |= TTU_IGNORE_HWPOISON; 948 ttu |= TTU_IGNORE_HWPOISON;
956 printk(KERN_INFO 949 pr_info("MCE %#lx: corrupted page was clean: dropped without side effects\n",
957 "MCE %#lx: corrupted page was clean: dropped without side effects\n",
958 pfn); 950 pfn);
959 } 951 }
960 } 952 }
@@ -972,8 +964,8 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
972 964
973 ret = try_to_unmap(hpage, ttu); 965 ret = try_to_unmap(hpage, ttu);
974 if (ret != SWAP_SUCCESS) 966 if (ret != SWAP_SUCCESS)
975 printk(KERN_ERR "MCE %#lx: failed to unmap page (mapcount=%d)\n", 967 pr_err("MCE %#lx: failed to unmap page (mapcount=%d)\n",
976 pfn, page_mapcount(hpage)); 968 pfn, page_mapcount(hpage));
977 969
978 /* 970 /*
979 * Now that the dirty bit has been propagated to the 971 * Now that the dirty bit has been propagated to the
@@ -1040,16 +1032,14 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
1040 panic("Memory failure from trap %d on page %lx", trapno, pfn); 1032 panic("Memory failure from trap %d on page %lx", trapno, pfn);
1041 1033
1042 if (!pfn_valid(pfn)) { 1034 if (!pfn_valid(pfn)) {
1043 printk(KERN_ERR 1035 pr_err("MCE %#lx: memory outside kernel control\n", pfn);
1044 "MCE %#lx: memory outside kernel control\n",
1045 pfn);
1046 return -ENXIO; 1036 return -ENXIO;
1047 } 1037 }
1048 1038
1049 p = pfn_to_page(pfn); 1039 p = pfn_to_page(pfn);
1050 orig_head = hpage = compound_head(p); 1040 orig_head = hpage = compound_head(p);
1051 if (TestSetPageHWPoison(p)) { 1041 if (TestSetPageHWPoison(p)) {
1052 printk(KERN_ERR "MCE %#lx: already hardware poisoned\n", pfn); 1042 pr_err("MCE %#lx: already hardware poisoned\n", pfn);
1053 return 0; 1043 return 0;
1054 } 1044 }
1055 1045
@@ -1180,7 +1170,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
1180 * unpoison always clear PG_hwpoison inside page lock 1170 * unpoison always clear PG_hwpoison inside page lock
1181 */ 1171 */
1182 if (!PageHWPoison(p)) { 1172 if (!PageHWPoison(p)) {
1183 printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn); 1173 pr_err("MCE %#lx: just unpoisoned\n", pfn);
1184 num_poisoned_pages_sub(nr_pages); 1174 num_poisoned_pages_sub(nr_pages);
1185 unlock_page(hpage); 1175 unlock_page(hpage);
1186 put_hwpoison_page(hpage); 1176 put_hwpoison_page(hpage);