Commit 6b0cd00b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'hwpoison-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6

* 'hwpoison-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6:
  HWPOISON: Stop shrinking at right page count
  HWPOISON: Report correct address granuality for AO huge page errors
  HWPOISON: Copy si_addr_lsb to user
  page-types.c: fix name of unpoison interface
parents c8d86d8a 47f43e7e
...@@ -478,7 +478,7 @@ static void prepare_hwpoison_fd(void) ...@@ -478,7 +478,7 @@ static void prepare_hwpoison_fd(void)
} }
if (opt_unpoison && !hwpoison_forget_fd) { if (opt_unpoison && !hwpoison_forget_fd) {
sprintf(buf, "%s/renew-pfn", hwpoison_debug_fs); sprintf(buf, "%s/unpoison-pfn", hwpoison_debug_fs);
hwpoison_forget_fd = checked_open(buf, O_WRONLY); hwpoison_forget_fd = checked_open(buf, O_WRONLY);
} }
} }
......
...@@ -2214,6 +2214,14 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) ...@@ -2214,6 +2214,14 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from)
err |= __put_user(from->si_addr, &to->si_addr); err |= __put_user(from->si_addr, &to->si_addr);
#ifdef __ARCH_SI_TRAPNO #ifdef __ARCH_SI_TRAPNO
err |= __put_user(from->si_trapno, &to->si_trapno); err |= __put_user(from->si_trapno, &to->si_trapno);
#endif
#ifdef BUS_MCEERR_AO
/*
* Other callers might not initialize the si_lsb field,
* so check explicitely for the right codes here.
*/
if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)
err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb);
#endif #endif
break; break;
case __SI_CHLD: case __SI_CHLD:
......
...@@ -183,7 +183,7 @@ EXPORT_SYMBOL_GPL(hwpoison_filter); ...@@ -183,7 +183,7 @@ EXPORT_SYMBOL_GPL(hwpoison_filter);
* signal. * signal.
*/ */
static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno, static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno,
unsigned long pfn) unsigned long pfn, struct page *page)
{ {
struct siginfo si; struct siginfo si;
int ret; int ret;
...@@ -198,7 +198,7 @@ static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno, ...@@ -198,7 +198,7 @@ static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno,
#ifdef __ARCH_SI_TRAPNO #ifdef __ARCH_SI_TRAPNO
si.si_trapno = trapno; si.si_trapno = trapno;
#endif #endif
si.si_addr_lsb = PAGE_SHIFT; si.si_addr_lsb = compound_order(compound_head(page)) + PAGE_SHIFT;
/* /*
* Don't use force here, it's convenient if the signal * Don't use force here, it's convenient if the signal
* can be temporarily blocked. * can be temporarily blocked.
...@@ -235,7 +235,7 @@ void shake_page(struct page *p, int access) ...@@ -235,7 +235,7 @@ void shake_page(struct page *p, int access)
int nr; int nr;
do { do {
nr = shrink_slab(1000, GFP_KERNEL, 1000); nr = shrink_slab(1000, GFP_KERNEL, 1000);
if (page_count(p) == 0) if (page_count(p) == 1)
break; break;
} while (nr > 10); } while (nr > 10);
} }
...@@ -327,7 +327,7 @@ static void add_to_kill(struct task_struct *tsk, struct page *p, ...@@ -327,7 +327,7 @@ static void add_to_kill(struct task_struct *tsk, struct page *p,
* wrong earlier. * wrong earlier.
*/ */
static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno, static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno,
int fail, unsigned long pfn) int fail, struct page *page, unsigned long pfn)
{ {
struct to_kill *tk, *next; struct to_kill *tk, *next;
...@@ -352,7 +352,7 @@ static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno, ...@@ -352,7 +352,7 @@ static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno,
* process anyways. * process anyways.
*/ */
else if (kill_proc_ao(tk->tsk, tk->addr, trapno, else if (kill_proc_ao(tk->tsk, tk->addr, trapno,
pfn) < 0) pfn, page) < 0)
printk(KERN_ERR printk(KERN_ERR
"MCE %#lx: Cannot send advisory machine check signal to %s:%d\n", "MCE %#lx: Cannot send advisory machine check signal to %s:%d\n",
pfn, tk->tsk->comm, tk->tsk->pid); pfn, tk->tsk->comm, tk->tsk->pid);
...@@ -928,7 +928,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn, ...@@ -928,7 +928,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
* any accesses to the poisoned memory. * any accesses to the poisoned memory.
*/ */
kill_procs_ao(&tokill, !!PageDirty(hpage), trapno, kill_procs_ao(&tokill, !!PageDirty(hpage), trapno,
ret != SWAP_SUCCESS, pfn); ret != SWAP_SUCCESS, p, pfn);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment