linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <cel@monkey.org>
To: Andrea Arcangeli <andrea@suse.de>
Cc: "Stephen C. Tweedie" <sct@redhat.com>,
	Kanoj Sarcar <kanoj@google.engr.sgi.com>,
	torvalds@transmeta.com, linux-mm@kvack.org
Subject: Re: filecache/swapcache questions [RFC] [RFT] [PATCH] kanoj-mm12-2.3.8 Fix swapoff races
Date: Tue, 29 Jun 1999 11:27:05 -0400 (EDT)	[thread overview]
Message-ID: <Pine.BSO.4.10.9906291050090.20262-100000@funky.monkey.org> (raw)
In-Reply-To: <Pine.LNX.4.10.9906290412140.11414-100000@laser.random>

On Tue, 29 Jun 1999, Andrea Arcangeli wrote:
> On Mon, 28 Jun 1999, Chuck Lever wrote:
> >yes, that's exactly what i did.  what i can't figure out is why do the
> >shrink_mmap in both places?  seems like the shrink_mmap in kswapd is
> >overkill if it has just been awoken by try_to_free_pages.
> 
> If you remove the shrink_mmap from kswapd then you'll start swapping all
> the time.

yes, i discovered that rather quickly when i tried it. :)

> shrink_mmap give us the information about the state of
> the VM. So if you run it then you know if you should start swapping or
> not.

but it also "destroys" that state while it's running.  it would be much
nicer, i think, if there was a way to ascertain the state cheaply, then
decide whether to shrink caches or swap, or both.  i think a better
decision could be made this way.  what do you think about separating
shrink_mmap's function into two separate pieces:  maintain state
information, and trim caches?

i've been studying a hard knee that occurs just as the system exhausts
memory and try_to_free_pages is invoked.  performance drops rather
dramatically.  while i was playing around with kswapd, i noticed that when
my system started to swap more during low-memory scenarios, it seemed to
perform better; the knee is "softened".

by switching back and forth between an "all swap all the time" model and
an "all shrink_mmap all the time" model, it was clear to me, at least for
my workload, that shrink_mmap is valuable up to a point, but swapping is
quite effective at increasing available memory because it's heuristic for
choosing a memory-idle process is very good (based on watching subsequent 
swap-in numbers), and there is probably 10-12M of idle crap that can be
flushed if the system gets loaded down, that currently is left in RAM.

in my opinion, the kernel is using shrink_mmap too much and not swapping
enough.  but it isn't clear to me exactly how to rebalance the two, or how
to gather more information in do_try_to_free_pages to make a better
decision about how to get back some memory.

> I suggest you to run some memory hog that rotate 20/30mbyte of data in the
> swap to check iteractive performances.

i have a test that does roughly this -- diff two kernel source trees.

however, it's clear that breaking try_to_free_pages and kswapd into two
separate paths won't provide the locking gain i was after.  however,
unrelated to the above discussion, do_try_to_free_pages may hold onto the
kernel lock for a long time, so finding a safe place for shrink_mmap
and/or swap_out to release it occassionally would help.

	- Chuck Lever
--
corporate:	<chuckl@netscape.com>
personal:	<chucklever@netscape.net> or <cel@monkey.org>

The Linux Scalability project:
	http://www.citi.umich.edu/projects/linux-scalability/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

  reply	other threads:[~1999-06-29 15:27 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-21  5:29 filecache/swapcache questions Kanoj Sarcar
1999-06-21 11:25 ` Stephen C. Tweedie
1999-06-21 16:46   ` Kanoj Sarcar
1999-06-21 16:57     ` Stephen C. Tweedie
1999-06-21 17:36       ` Kanoj Sarcar
1999-06-21 17:49         ` Stephen C. Tweedie
1999-06-21 18:46           ` Kanoj Sarcar
1999-06-21 23:44             ` Kanoj Sarcar
1999-06-24 22:23               ` Andrea Arcangeli
1999-06-24 23:55                 ` Kanoj Sarcar
1999-06-25  0:26                   ` Andrea Arcangeli
1999-06-28  1:48                     ` filecache/swapcache questions [RFC] [RFT] [PATCH] kanoj-mm12-2.3.8 Fix swapoff races Kanoj Sarcar
1999-06-28 10:35                       ` Andrea Arcangeli
1999-06-28 17:11                         ` filecache/swapcache questions [RFC] [RFT] [PATCH] kanoj-mm12-2.3.8 Kanoj Sarcar
1999-06-28 16:32                       ` filecache/swapcache questions [RFC] [RFT] [PATCH] kanoj-mm12-2.3.8 Fix swapoff races Stephen C. Tweedie
1999-06-28 17:25                         ` Kanoj Sarcar
1999-06-28 20:40                           ` Stephen C. Tweedie
1999-06-28 21:11                             ` Kanoj Sarcar
1999-06-28 22:12                               ` Stephen C. Tweedie
1999-06-28 23:43                                 ` Kanoj Sarcar
1999-06-29 11:44                                   ` Stephen C. Tweedie
1999-06-29 22:01                                     ` Kanoj Sarcar
1999-06-30 17:28                                       ` Stephen C. Tweedie
1999-06-30 18:05                                         ` Kanoj Sarcar
1999-06-28 19:39                       ` Chuck Lever
1999-06-28 19:55                         ` filecache/swapcache questions [RFC] [RFT] [PATCH] kanoj-mm12-2.3.8 Kanoj Sarcar
1999-06-28 20:33                           ` Chuck Lever
1999-06-28 20:51                             ` Kanoj Sarcar
1999-06-28 21:32                               ` Chuck Lever
1999-06-28 21:38                                 ` Kanoj Sarcar
1999-06-28 21:50                                   ` Chuck Lever
1999-06-28 22:15                                     ` Kanoj Sarcar
1999-06-29 11:23                                       ` Stephen C. Tweedie
1999-06-29 17:36                                         ` Kanoj Sarcar
1999-06-28 22:22                                   ` Stephen C. Tweedie
1999-06-28 22:21                                 ` Stephen C. Tweedie
1999-06-28 22:57                                   ` Andrea Arcangeli
1999-06-29  2:13                                     ` Chuck Lever
1999-06-29 12:01                                       ` Stephen C. Tweedie
1999-06-29 12:32                                         ` Andrea Arcangeli
1999-06-30 15:59                                           ` Stephen C. Tweedie
1999-06-29  1:00                                   ` Chuck Lever
1999-06-28 22:08                               ` Stephen C. Tweedie
1999-06-28 22:59                                 ` Andrea Arcangeli
1999-06-29  0:53                                 ` Chuck Lever
1999-06-29 11:14                                   ` Stephen C. Tweedie
1999-06-28 22:09                           ` Stephen C. Tweedie
1999-06-28 20:45                         ` filecache/swapcache questions [RFC] [RFT] [PATCH] kanoj-mm12-2.3.8 Fix swapoff races Stephen C. Tweedie
1999-06-28 21:14                           ` Chuck Lever
1999-06-28 21:25                             ` filecache/swapcache questions [RFC] [RFT] [PATCH] kanoj-mm12-2.3.8 Kanoj Sarcar
1999-06-28 22:15                             ` filecache/swapcache questions [RFC] [RFT] [PATCH] kanoj-mm12-2.3.8 Fix swapoff races Stephen C. Tweedie
1999-06-28 22:48                             ` Andrea Arcangeli
1999-06-29  1:29                               ` Chuck Lever
1999-06-29 11:58                                 ` Stephen C. Tweedie
1999-06-29 12:09                                 ` Andrea Arcangeli
1999-06-29 15:27                                   ` Chuck Lever [this message]
1999-06-29 11:55                               ` Stephen C. Tweedie
1999-06-29 20:08                               ` Andrea Arcangeli
1999-06-28 22:36             ` filecache/swapcache questions Stephen C. Tweedie
1999-06-28 23:24               ` Kanoj Sarcar

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.BSO.4.10.9906291050090.20262-100000@funky.monkey.org \
    --to=cel@monkey.org \
    --cc=andrea@suse.de \
    --cc=kanoj@google.engr.sgi.com \
    --cc=linux-mm@kvack.org \
    --cc=sct@redhat.com \
    --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