From: Andrew Morton <akpm@osdl.org>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-mm@kvack.org
Subject: Re: follow_page()
Date: Thu, 11 Nov 2004 03:06:34 -0800 [thread overview]
Message-ID: <20041111030634.1d06a7c1.akpm@osdl.org> (raw)
In-Reply-To: <1100170570.2646.27.camel@laptop.fenrus.org>
Arjan van de Ven <arjan@infradead.org> wrote:
>
> On Thu, 2004-11-11 at 02:40 -0800, Andrew Morton wrote:
> > Can anyone think of a sane reason why this thing is marking the page dirty?
> >
> > I mean, we're supposed to mark the page dirty _after_ modifying its
> > contents.
>
> most likely it's because the intent to write to it is given.
> It's cheaper for the OS to mark a pagetable dirty than it's for the CPU
> to do so (example, on a Pentium 4 it can easily take the cpu 2000 to
> 4000 cycles to flip the dirty bit on the PTE). So if you KNOW you're
> going to write to it (and thus the intent parameter) you can save a big
> chunk of those cycles.
But it's racy. writeback can write-and-clean the page before we've
modified its contents. Whether the page contents are altered via disk DMA
or a memset or whatever, we can lose the data. Except callers are
correctly dirtying the page after modifying it anyway.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2004-11-11 11:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-11 10:40 follow_page() Andrew Morton
2004-11-11 10:56 ` follow_page() Arjan van de Ven
2004-11-11 11:06 ` Andrew Morton [this message]
2004-11-11 11:10 ` follow_page() Arjan van de Ven
2004-11-11 11:58 ` follow_page() Nick Piggin
2004-11-11 12:11 ` follow_page() Andrew Morton
2004-11-11 12:20 ` follow_page() Nick Piggin
2004-11-11 12:16 ` follow_page() Arjan van de Ven
2004-11-11 12:27 ` follow_page() Nick Piggin
2004-11-11 12:46 ` follow_page() Arjan van de Ven
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=20041111030634.1d06a7c1.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=linux-mm@kvack.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