All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@conectiva.com.br>
To: Andrew Morton <akpm@zip.com.au>
Cc: William Lee Irwin III <wli@holomorphy.com>,
	Dave McCracken <dmccr@us.ibm.com>,
	Linux Memory Management <linux-mm@kvack.org>
Subject: Re: [PATCH] Optimize out pte_chain take three
Date: Thu, 11 Jul 2002 20:18:25 -0300 (BRT)	[thread overview]
Message-ID: <Pine.LNX.4.44L.0207112011150.14432-100000@imladris.surriel.com> (raw)
In-Reply-To: <3D2E08DE.3C0D619@zip.com.au>

On Thu, 11 Jul 2002, Andrew Morton wrote:

> > generic_file_write() calls deactivate_page() if it crosses
> > the page boundary (ie. if it is done writing this page)
>
> Ah, OK.  I tried lots of those sorts of things.  But fact is
> that moving the unwanted pages to the far of the inactive list
> just isn't effective: pagecache which will be used at some time
> in the future always ends up getting evicted.

There's no way around that, unless you know your application
workload well enough to be able to predict the future.


> But yes, at some point you do need to stop carving away at the
> clean pagecache and wait on writeback completion.  Not sure
> how to balance that.

Keeping all the pages on the same LRU would be a start.
There's no reason you couldn't start (or even finish)
writeout of the dirty pages before they reach the end
of the LRU.  If a page is still dirty when it reaches
the end of the LRU it can be moved aside onto a laundry
list, from where it gets freed after IO completes.

As soon as you start putting dirty pages on a different
LRU list we'll almost certainly lose the ability to
balance things.


> Suppose you're running a massive `dd of=foo'.  Some innocent
> task tries to allocate a page and hits a dirty one.  It
> sleeps in get_request_wait().  dd is sleeping there too.
> Now 32 requests complete and both tasks get woken.  The innocent
> page allocator starts running again.  And `dd' immediately jams
> another 32 requests into the queue.  It's very unfair.

Fixing this unfairness when the queue is "almost full"
is probably a useful thing to do.


> > Keeping them on the LRU _does_ make sense since we know
> > when we want to evict these pages.  Putting them aside
> > on a laundry list might make sense though, provided that
> > they are immediately made a candidate for replacement
> > after IO completion.
>
> Yes, well that's basically what we do now, if you're referring
> to PageWriteback (used to be PageLocked) pages.  We just shove
> them onto the far end of the LRU and hope they don't come back
> until IO completes.

Which is wrong, not only because these pages have reached the
end of the LRU and want to get replaced, but also because we
just don't want to go through the trouble of scanning them
again.

This would be a good place to catch these pages and put them
on a separate list from which they go to the free list once
IO completes.


> > > > ...
> > > > If the throttling is wrong, I propose we fix the trottling.
> > >
> > > How?  (Without adding more list scanning)
> >
> > For one, we shouldn't let every process go into
> > try_to_free_pages() and check for itself if the
> > pages really aren't freeable.
>
> mm.  Well we do want processes to go in and reclaim their own
> pages normally, to avoid a context switch (I guess.  No numbers
> to back this up).

Falling from __alloc_pages into the pageout path shouldn't be
part of the fast path.  If it is we have bigger problems...


> But I think killing batch_requests may make all this rather better.

Probably.

regards,

Rik
-- 
Bravely reimplemented by the knights who say "NIH".

http://www.surriel.com/		http://distro.conectiva.com/

--
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-07-11 23:18 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-09 19:04 [PATCH] Optimize out pte_chain take two Dave McCracken
2002-07-10  0:21 ` Andrew Morton
2002-07-10 14:33   ` [PATCH] Optimize out pte_chain take three Dave McCracken
2002-07-10 15:18     ` Rik van Riel
2002-07-10 17:32       ` William Lee Irwin III
2002-07-10 20:01         ` Andrew Morton
2002-07-10 20:14           ` Rik van Riel
2002-07-10 20:28             ` Andrew Morton
2002-07-10 20:38               ` Rik van Riel
2002-07-13 13:42                 ` Daniel Phillips
2002-07-10 20:33             ` Martin J. Bligh
2002-07-10 22:22           ` William Lee Irwin III
2002-07-11  0:39             ` Andrew Morton
2002-07-11  0:47               ` Rik van Riel
2002-07-11  1:27                 ` Andrew Morton
2002-07-13 14:10                 ` Daniel Phillips
2002-07-11  1:51               ` William Lee Irwin III
2002-07-11  2:28                 ` William Lee Irwin III
2002-07-11 19:54                 ` Andrew Morton
2002-07-11 20:05                   ` Rik van Riel
2002-07-11 20:42                     ` Andrew Morton
2002-07-11 20:54                       ` Rik van Riel
2002-07-11 21:16                         ` Andrew Morton
2002-07-11 21:41                           ` Rik van Riel
2002-07-11 22:38                             ` Andrew Morton
2002-07-11 23:18                               ` Rik van Riel [this message]
2002-07-12 18:27                                 ` Paul Larson
2002-07-12 19:06                                   ` Andrew Morton
2002-07-12 19:28                                 ` Andrew Morton
2002-07-13 15:08                               ` Daniel Phillips
2002-07-11 22:54                   ` William Lee Irwin III
2002-07-13 14:52                   ` Daniel Phillips
2002-07-13 14:08               ` Daniel Phillips
2002-07-13 14:20               ` Daniel Phillips
2002-07-13 14:45             ` Daniel Phillips
2002-07-13 13:22           ` Daniel Phillips
2002-07-13 13:30             ` William Lee Irwin III
2002-07-13 13:55               ` Daniel Phillips
2002-07-13 13:41           ` 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=Pine.LNX.4.44L.0207112011150.14432-100000@imladris.surriel.com \
    --to=riel@conectiva.com.br \
    --cc=akpm@zip.com.au \
    --cc=dmccr@us.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=wli@holomorphy.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.