linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-mm@kvack.org
Subject: Re: follow_page()
Date: Thu, 11 Nov 2004 12:10:53 +0100	[thread overview]
Message-ID: <1100171453.2646.29.camel@laptop.fenrus.org> (raw)
In-Reply-To: <20041111030634.1d06a7c1.akpm@osdl.org>

> > 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.

so in the race case you get the hit of those 4000 cycles... still optimizes the non-race case 
(so I'd agree that nothing should depend on this function dirtying it; it's a pre-dirty that's an
optimisation)

--
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>

  reply	other threads:[~2004-11-11 11:10 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   ` follow_page() Andrew Morton
2004-11-11 11:10     ` Arjan van de Ven [this message]
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=1100171453.2646.29.camel@laptop.fenrus.org \
    --to=arjan@infradead.org \
    --cc=akpm@osdl.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