linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: "Juan J. Quintela" <quintela@fi.udc.es>
Cc: linux-mm@kvack.org
Subject: Re: Estrange behaviour of pre9-1
Date: Mon, 15 May 2000 17:34:13 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.10.10005151724430.819-100000@penguin.transmeta.com> (raw)
In-Reply-To: <yttu2fzxs4y.fsf@vexeta.dc.fi.udc.es>


On 16 May 2000, Juan J. Quintela wrote:
> 
> I was discussing with Rik an scheme similar to that. I have found that
> appears that we are trying very hard to get pages without doing any
> writing. I think that we need to _wait_ for the pages if we are really
> low on memory.

That is indeed what my shink_mmap() suggested change does (ie make
"sync_page_buffers()" wait for old locked buffers). 

That, together with each "try_to_free_page()" only trying to free a fairly
small number pf pages, should make it behave fine. I think one of the
reasons Rik's patch had bad performance was that when it started swapping
out, the "free_before_allocate" trap caused it to swap out _a lot_ by
trapping everybody else into freeing stuff too. Even when it might not
have been strictly necessary.

Btw, if you're testing the "wait for locked buffers" case, you should also
remove the "run_task(&tq_disk)" from do_try_to_free_pages(). That
artificially throttles disk performance regardless of whether it is needed
or not. The "wait for locked buffers" version of the code will
automatically cause the tq_disk queue to be emptied when it actually turns
out that yes, we really need to start the thing going. Which is exactly
what we want.


?		  Just now, for pathological examples like mmap002 that
> dirty a lot of memory very fast, I am observing that we made the page
> cache grow until it occupies all the RAM. That is OK when the RAM is
> empty.  But in that moment, if all the pages are dirty, we call
> shrink_mmap, and it will start the async write of all the pages (in
> this case, all our memory).

Yes. This is what kflushd is there for, and this is what "balance_dirty()"
is supposed to avoid. It may not work (and memory mappings are the worst
case, because the system doesn't _know_ that they are dirty until at the
point where it starts looking at the page tables - which is when it's too
late).

In order to truly make this behave more smoothly, we should trap the thing
when it creates a dirty page, which is quite hard the way things are set
up now. Certainly not 2.4.x code.

[ Incidentally, the thing that mmap002 tests is quite rare, so I don't
  think we have to have perfect behaviour, we just shouldn't kill
   processes the way we do now ]

		Linus

--
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.eu.org/Linux-MM/

  reply	other threads:[~2000-05-16  0:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-15 22:56 Juan J. Quintela
2000-05-15 23:59 ` Linus Torvalds
2000-05-16  0:20   ` Juan J. Quintela
2000-05-16  0:34     ` Linus Torvalds [this message]
2000-05-16  0:54       ` Juan J. Quintela
2000-05-16  1:15         ` Rik van Riel
2000-05-16 13:53         ` Linus Torvalds
2000-05-16 14:20           ` Juan J. Quintela
2000-05-16 16:37           ` Roger Larsson
2000-05-16  0:55     ` Rik van Riel
2000-05-16 14:03       ` Linus Torvalds
2000-05-16  1:03   ` Rik van Riel

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.10.10005151724430.819-100000@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=linux-mm@kvack.org \
    --cc=quintela@fi.udc.es \
    /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