linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@ucw.cz>
To: Martin Maletinsky <maletinsky@scs.ch>
Cc: linux-mm@kvack.org, kernelnewbies@nl.linux.org
Subject: Re: Question on set_page_dirty()
Date: Wed, 11 Dec 2002 09:01:02 +0100	[thread overview]
Message-ID: <20021211080102.GG20525@vagabond> (raw)
In-Reply-To: <3DF5BB06.A6F6AFFD@scs.ch>

On Tue, Dec 10, 2002 at 10:59:34AM +0100, Martin Maletinsky wrote:
> Hello,
> 
> Looking at the function set_page_dirty() (in linux 2.4.18-3 - see
> below) I noticed, that it not only sets the pages PG_dirty bit (as the
> SetPageDirty() macro does), but additionnally may link the page onto
> a queue (more precisely the dirty queue of it's 'mapping').

That's the most important bit of it all. All dirty pages must at some
point be cleaned. The list keeps track of which pages need to be
cleaned, so kernel can do it quickly either when it needs to free the
mapping (close the file, terminate process, exec) or when it's just time
to flush some pages (in kflushd).

> What is the meaning of this dirty queue, what is the effect of linking
> a page onto that queue, and when should the set_page_dirty() function
> be used rather than the
> SetPageDirty() macro?

If you use the SetPageDirty macro, then the page is marked dirty, but
kernel can't find it when it should clean it. Thus it eventualy won't
flush the data (it won't call writepage on it).

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
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-12-11  8:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-10  9:59 Martin Maletinsky
2002-12-11  8:01 ` Jan Hudec [this message]
2002-12-12  9:29   ` Ingo Oeser
2002-12-12 12:42     ` Stephen C. Tweedie
2002-12-12 18:20       ` Andrew Morton

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=20021211080102.GG20525@vagabond \
    --to=bulb@ucw.cz \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-mm@kvack.org \
    --cc=maletinsky@scs.ch \
    /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