Re: [PATCH 12/24] HWPOISON: make it possible to unpoison pages

From: Wu Fengguang
Date: Wed Dec 02 2009 - 08:47:15 EST


On Wed, Dec 02, 2009 at 09:15:30PM +0800, Andi Kleen wrote:
> > Note that it may leak pages silently - those who have been removed from
> > LRU cache, but not isolated from page cache/swap cache at hwpoison time.
>
> It would be better if we could detect that somehow and at least warn.

We warned when some page cannot be isolated (but didn't mention it may
lead to memory leak).

We exported the hwpoison counter in /proc/meminfo. The memory leak is
mainly a problem with stress testing, and the test cases can make use
of that counter to do sanity checking.

> > }
> >
> > +static int hwpoison_forget(void *data, u64 val)
> > +{
> > + if (!capable(CAP_SYS_ADMIN))
> > + return -EPERM;
> > +
> > + return forget_memory_failure(val);
> > +}
> > +
> > DEFINE_SIMPLE_ATTRIBUTE(hwpoison_fops, NULL, hwpoison_inject, "%lli\n");
> > +DEFINE_SIMPLE_ATTRIBUTE(unpoison_fops, NULL, hwpoison_forget, "%lli\n");
>
> I'll rename it to unpoison, not forget. I think that's a more clear
> name.

btw, do you feel comfortable with the interface name "renew-pfn"?
(versus "unpoison-pfn")
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/