From: Andrew Morton <akpm@zip.com.au>
To: lkml <linux-kernel@vger.kernel.org>
Subject: aa-150-read_write_tweaks
Date: Tue, 19 Mar 2002 20:00:48 -0800 [thread overview]
Message-ID: <3C980970.A542A4D@zip.com.au> (raw)
- Don't do flush_page_to_ram() on the page fault-in path. That's
handled in mm/memory.c, and filemap.c doesn't need to do it.
- In generic_file_write(), only set the page's Referenced bit once,
when the write touches the start of the page. This is a
microoptimisation. Seemingly a buggy one too - lseek exists...
=====================================
--- 2.4.19-pre3/mm/filemap.c~aa-150-read_write_tweaks Tue Mar 19 19:49:02 2002
+++ 2.4.19-pre3-akpm/mm/filemap.c Tue Mar 19 19:49:02 2002
@@ -1968,7 +1968,6 @@ success:
* and possibly copy it over to another page..
*/
mark_page_accessed(page);
- flush_page_to_ram(page);
return page;
no_cached_page:
@@ -3089,8 +3088,15 @@ generic_file_write(struct file *file,con
}
unlock:
kunmap(page);
+
+ /*
+ * Mark the page accessed if we wrote the
+ * beginning or we just did an lseek.
+ */
+ if (!offset || !file->f_reada)
+ SetPageReferenced(page);
+
/* Mark it unlocked again and drop the page.. */
- SetPageReferenced(page);
UnlockPage(page);
page_cache_release(page);
-
reply other threads:[~2002-03-20 4:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C980970.A542A4D@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox