Re: [PATCH] [13/16] HWPOISON: The high level memory error handlerin the VM v3

From: Wu Fengguang
Date: Tue Jun 02 2009 - 10:11:03 EST


On Tue, Jun 02, 2009 at 10:08:30PM +0800, Andi Kleen wrote:
> > > > We could probably call truncate_complete_page(), but then
> > > > we would also need to duplicate most of the checking outside
> > > > the function anyways and there wouldn't be any possibility
> > > > to share the clean/dirty variants. If you insist I can
> > > > do it, but I think it would be significantly worse code
> > > > than before and I'm reluctant to do that.
> > >
> > > I can write you the patch for that too if you like.
> >
> > I have already posted one on truncate_complete_page(). Not the way you want it?
>
> Sorry I must have missed it (too much mail I guess). Can you repost please?

OK, here it is, a more simplified one.

---
mm/memory-failure.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)

--- sound-2.6.orig/mm/memory-failure.c
+++ sound-2.6/mm/memory-failure.c
@@ -324,23 +324,16 @@ static int me_free(struct page *p)
*/
static int me_pagecache_clean(struct page *p)
{
+ if (page_mapping(p))
+ truncate_complete_page(p->mapping, p);
+
if (!isolate_lru_page(p))
page_cache_release(p);

- if (page_has_private(p))
- do_invalidatepage(p, 0);
if (page_has_private(p) && !try_to_release_page(p, GFP_NOIO))
Dprintk(KERN_ERR "MCE %#lx: failed to release buffers\n",
page_to_pfn(p));

- /*
- * remove_from_page_cache assumes (mapping && !mapped)
- */
- if (page_mapping(p) && !page_mapped(p)) {
- remove_from_page_cache(p);
- page_cache_release(p);
- }
-
return RECOVERED;
}

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