From: Chris Mason <mason@suse.com>
To: Daniel Phillips <phillips@bonn-fries.net>, linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, torvalds@transmeta.com
Subject: Re: [RFC] using writepage to start io
Date: Sun, 05 Aug 2001 19:32:24 -0400 [thread overview]
Message-ID: <276480000.997054344@tiny> (raw)
In-Reply-To: <01080600380103.00294@starship>
On Monday, August 06, 2001 12:38:01 AM +0200 Daniel Phillips
<phillips@bonn-fries.net> wrote:
> On Sunday 05 August 2001 20:34, Chris Mason wrote:
>> I wrote:
>> > Note that the fact that buffers dirtied by ->writepage are ordered
>> > by time-dirtied means that the dirty_buffers list really does have
>> > indirect knowledge of page aging. There may well be benefits to
>> > your approach but I doubt this is one of them.
>>
>> A problem is that under memory pressure, we'll flush a buffer that has
>> been dirty for a long time, even if we are constantly redirtying it
>> and have it more or less pinned. This might not be common enough to
>> cause problems, but it still isn't optimal. Yes, it is a good idea to
>> flush that page at some time, but under memory pressure we want to do
>> the least amount of work that will lead to a freeable page.
>
> But we don't have a choice. The user has set an explicit limit on how
> long a dirty buffer can hang around before being flushed. The
> old-buffer rule trumps the need to allocate new memory. As you noted,
> it doesn't cost a lot because if the system is that heavily loaded
> then the rate of dirty buffer production is naturally throttled.
there are at least 3 reasons to write buffers to disk
1) they are too old
2) the percentage of dirty buffers is too high
3) you need to reclaim them due to memory pressure
There are 3 completely different things; there's no trumping of priorities.
Under memory pressure you write buffers you have a high chance of freeing,
during write throttling you write buffers that won't get dirty again right
away, and when writing old buffers you write the oldest first.
This doesn't mean you can always make the right decision on all 3 cases, or
that making the right decision is worth the effort ;-)
> If you must enter it into the page hash you'd be safer generating a
> random number for the page index. But why not just take what you need
> from add_to_page_cache_locked:
>
Mostly to keep down on the cut n' pasted code in the patch. But I'll try
this out...
-chris
--
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/
next prev parent reply other threads:[~2001-08-05 23:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-05 18:34 Chris Mason
2001-08-05 22:38 ` Daniel Phillips
2001-08-05 23:32 ` Chris Mason [this message]
2001-08-06 5:39 ` Daniel Phillips
2001-08-06 13:24 ` Chris Mason
2001-08-06 16:13 ` Daniel Phillips
2001-08-06 16:51 ` Chris Mason
2001-08-06 19:45 ` Daniel Phillips
2001-08-06 20:12 ` Chris Mason
2001-08-06 21:18 ` Daniel Phillips
2001-08-07 11:02 ` Stephen C. Tweedie
2001-08-07 11:39 ` Ed Tomlinson
2001-08-07 12:07 ` Anton Altaparmakov
2001-08-07 18:36 ` Daniel Phillips
2001-08-07 12:02 ` Anton Altaparmakov
2001-08-07 13:29 ` Daniel Phillips
2001-08-07 13:31 ` Alexander Viro
2001-08-07 15:52 ` Daniel Phillips
2001-08-07 14:23 ` Stephen C. Tweedie
2001-08-07 15:51 ` Daniel Phillips
2001-08-08 14:49 ` Stephen C. Tweedie
2001-08-06 15:13 ` Eric W. Biederman
-- strict thread matches above, loose matches on Subject: below --
2001-08-07 15:19 Chris Mason
[not found] <76740000.996336108@tiny>
2001-07-31 19:07 ` Chris Mason
2001-08-01 1:01 ` Daniel Phillips
2001-08-01 2:05 ` Chris Mason
2001-08-01 14:57 ` Daniel Phillips
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=276480000.997054344@tiny \
--to=mason@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=phillips@bonn-fries.net \
--cc=torvalds@transmeta.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