public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Badari Pulavarty <pbadari@gmail.com>
To: Mark Lord <lkml@rtr.ca>
Cc: Arjan van de Ven <arjan@infradead.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.xx:  dirty pages never being sync'd to disk?
Date: Mon, 14 Nov 2005 08:56:38 -0800	[thread overview]
Message-ID: <1131987398.24066.7.camel@localhost.localdomain> (raw)
In-Reply-To: <4378B1FB.1060201@rtr.ca>

On Mon, 2005-11-14 at 10:49 -0500, Mark Lord wrote:
> Arjan van de Ven wrote:
> > On Mon, 2005-11-14 at 10:30 -0500, Mark Lord wrote:
> ..
> >>My Notebook computer has 2GB of RAM, and the 2.6.xx kernel seems quite
> >>happy to leave hundreds of MB of dirty unsync'd pages laying around
> ..
> >>/proc/sys/vm/dirty_expire_centisecs = 3000 (30 seconds)
> >>/proc/sys/vm/dirty_writeback_centisecs = 500 (5 seconds)
> ..
> > do you have laptop mode enabled? That changes the behavior bigtime in
> > this regard and makes the kernel behave quite different.
> 
> No.  Laptop-mode mostly just modifies the dirty_expire
> and related settings, and I have them set as shown above.
> But there's also this:
> 
> /proc/sys/vm/laptop_mode = 0
> 
> > also if these are files written to by mmap, the kernel only really sees
> > those as dirty when the mapping gets taken down
> 
> They certainly show up in the counts in /proc/meminfo under "Dirty",
> so I assumed that means the kernel knows they are dirty.
> 
> A simple test I do for this:
> 
> $ mkdir t
> $ cp /usr/src/*.bz2  t    (about 400-500MB worth of kernel tar files)
> 
> In another window, I do this:
> 
> $ while (sleep 1); do echo -n "`date`: "; grep Dirty /proc/meminfo; done
> 
> And then watch the count get large, but take virtually forever
> to count back down to a "safe" value.
> 
> Typing "sync" causes all the Dirty pages to immediately be flushed to disk,
> as expected.
> 
> Here's what the monitoring of /proc/meminfo shows,
> on an otherwise mostly idle system after having done
> the big file copies noted earlier:
> 
> Mon Nov 14 10:40:22 EST 2005: Dirty:          481284 kB
> Mon Nov 14 10:40:23 EST 2005: Dirty:          479680 kB


Interesting. Since you have a very easy to reproduce case -
can you write a program to do posix_fadvise(POSIX_FADV_DONTNEED)
on those files in directory "t" and see what happens ?

Thanks,
Badari


  parent reply	other threads:[~2005-11-14 16:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-14 15:30 2.6.xx: dirty pages never being sync'd to disk? Mark Lord
2005-11-14 15:35 ` Arjan van de Ven
2005-11-14 15:49   ` Mark Lord
2005-11-14 15:54     ` Mark Lord
2005-11-14 16:56     ` Badari Pulavarty [this message]
2005-11-14 17:15       ` Mark Lord
2005-11-14 17:38         ` Mark Lord
2005-11-14 17:44         ` Mark Lord
2005-11-14 17:51           ` Mark Lord

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=1131987398.24066.7.camel@localhost.localdomain \
    --to=pbadari@gmail.com \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@rtr.ca \
    /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