linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Martin Maletinsky <maletinsky@scs.ch>,
	Stephen Tweedie <sct@redhat.com>,
	kernelnewbies@nl.linux.org, linux-mm@kvack.org
Subject: Re: Meaning of the dirty bit
Date: Thu, 10 Oct 2002 04:55:18 -0700	[thread overview]
Message-ID: <20021010115518.GX12432@holomorphy.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0210101209140.1510-100000@localhost.localdomain>

On Thu, Oct 10, 2002 at 12:40:08PM +0100, Hugh Dickins wrote:
> Originally (pre-2.4.4), as you've noticed, there was no write argument
> to follow_page, and map_user_kiobuf made one call to handle_mm_fault
> per page.  Experience with races under memory pressure will have shown
> that to be inadequate, it needed to loop until it could hold down the
> page, with the writable bit in the pte guaranteeing it good to write to.

Could you explain what race occurred?


On Thu, Oct 10, 2002 at 12:40:08PM +0100, Hugh Dickins wrote:
> But why dirty too, you ask?  I think, because writing to page via kiobuf
> happens directly, not via pte, so the pte dirty bit would not be set
> that way; but if it's not set, then the modification to the page may
> be lost later.  Hence map_user_kiobuf used handle_mm_fault to set
> that dirty bit too, and used follow_page to check that it is set.

Some of the mechanics of how the PTE dirty bit relate to the software
notion of a page being dirty are escaping me here. How does follow_page()
enter the equation? The PTE's of other processes cannot be resolved this
way so it does not seem clear to me at all that follow_page() taking an
extra argument can actually get something useful done here.


On Thu, Oct 10, 2002 at 12:40:08PM +0100, Hugh Dickins wrote:
> Except that's racy too, and so mark_dirty_kiobuf() was added to
> SetPageDirty on the pages after kio done, before unmapping the kiobuf.
> mark_dirty_kiobuf appeared in the main kernel tree at the same time
> as the pte_dirty test in follow_page, but I'm guessing the pte_dirty
> test was an earlier failed attempt to solve the problems fixed by
> mark_dirty_kiobuf, which got left in place (and also helped a bit
> if kiobuf users weren't updated to call mark_dirty_kiobuf).
> Apologies in advance if my guesses are wild.

Hrm, I'm going to have to dig up a tree with kiobuf stuff in it, I've
largely ignored that path for various reasons.


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

  reply	other threads:[~2002-10-10 11:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10  7:46 Martin Maletinsky
2002-10-10  8:49 ` Dharmender Rai
2002-10-10  8:57   ` Martin Maletinsky
2002-10-10  9:46     ` Dharmender Rai
2002-10-10 11:40 ` Hugh Dickins
2002-10-10 11:55   ` William Lee Irwin III [this message]
2002-10-10 13:40     ` Hugh Dickins
2002-10-10 12:11   ` Martin Maletinsky
2002-10-10 13:11   ` Dharmender Rai

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=20021010115518.GX12432@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=hugh@veritas.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-mm@kvack.org \
    --cc=maletinsky@scs.ch \
    --cc=sct@redhat.com \
    /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