Re: [PATCH] 2/5 VM changes: skip-writepage.patch

Nikita Danilov (Nikita@Namesys.COM)
Wed, 9 Jul 2003 14:41:40 +0400


Andrew Morton writes:
> Nikita Danilov <Nikita@Namesys.COM> wrote:
> >
> > Don't call ->writepage from VM scanner when page is met for the first time
> > during scan.
>
>
> I don't think we need all the code reorganisation. Something like this:

I separated call to ->writepage into special function because of some
other patch that I didn't send yet.

>
>
> include/linux/page-flags.h | 7 +++++++
> mm/page_alloc.c | 1 +
> mm/truncate.c | 2 ++

[...]

> @@ -328,6 +328,8 @@ shrink_list(struct list_head *page_list,
> * See swapfile.c:page_queue_congested().
> */
> if (PageDirty(page)) {
> + if (!TestSetPageSkipped(page))
> + goto keep_locked;
> if (!is_page_cache_freeable(page))
> goto keep_locked;
> if (!mapping)
> @@ -351,6 +353,7 @@ shrink_list(struct list_head *page_list,
> list_move(&page->list, &mapping->locked_pages);
> spin_unlock(&mapping->page_lock);
>
> + ClearPageSkipped(page);

Good idea.

By the way, have you noted that patch changes wbc.nonblocking to be 0,
if called from kswapd or pdflush, what do you think?

> SetPageReclaim(page);
> res = mapping->a_ops->writepage(page, &wbc);
>

Nikita.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/