Commit ed8ff7a4 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] use mark_page_accessed() in the write() path

We're currently just setting the referenced bit when modifying pagecache in
write().

Consequently overwritten (and redirtied) pages are remaining on the inactive
list.  The net result is that a lot of dirty pages are reaching the tail of
the LRU in page reclaim and are getting written via the writepage() in there.

But a core design objective is to minimise the amount of IO via that path,
and to maximise the amount of IO via balance_dirty_pages().  Because the
latter has better IO patterns.

This may explain the bad IO patterns which Gerrit talked about at KS.
parent 9f49f9f3
......@@ -1771,10 +1771,8 @@ generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
if (unlikely(copied != bytes))
if (status >= 0)
status = -EFAULT;
if (!PageReferenced(page))
SetPageReferenced(page);
unlock_page(page);
mark_page_accessed(page);
page_cache_release(page);
if (status < 0)
break;
......
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