Re: [PATCH] mm: vmscan: try to free orphaned page
From: Andrew Morton
Date: Mon Dec 12 2011 - 18:12:18 EST
On Mon, 12 Dec 2011 20:24:39 +0800
Hillf Danton <dhillf@xxxxxxxxx> wrote:
> If the orphaned page has no buffer attached at the moment, we clean it up by
> hand, then it has the chance to progress the freeing trip.
>
> Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
> ---
>
> --- a/mm/vmscan.c Sun Dec 4 13:10:08 2011
> +++ b/mm/vmscan.c Mon Dec 12 20:12:44 2011
> @@ -487,12 +487,10 @@ static pageout_t pageout(struct page *pa
> * Some data journaling orphaned pages can have
> * page->mapping == NULL while being dirty with clean buffers.
> */
> - if (page_has_private(page)) {
> - if (try_to_free_buffers(page)) {
> - ClearPageDirty(page);
> - printk("%s: orphaned page\n", __func__);
> - return PAGE_CLEAN;
> - }
> + if (!page_has_private(page) || try_to_free_buffers(page)) {
> + ClearPageDirty(page);
> + printk(KERN_INFO "%s: orphaned page\n", __func__);
> + return PAGE_CLEAN;
> }
> return PAGE_KEEP;
> }
So if we find a dirty pagecache page with nothing at ->private, you're
suggesting that we simply mark it clean and free it.
afacit it would be a bug for a page to be in that state.
What prompted this patch? I assume you've not encountered pages in
this state in your testing because if you had, that printk wouldn't
still be in there!
A brief bit of googling indicates that nobody has seen the "pageout:
orphaned page" warning for five years.
--
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/