linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ed Tomlinson <tomlins@cam.org>
To: linux-kernel@vger.kernel.org
Subject: [RFC][PATCH] vm_swap_full
Date: Sun, 4 Nov 2001 10:23:41 -0500	[thread overview]
Message-ID: <20011104152341.A4C289E898@oscar.casa.dyndns.org> (raw)

Hi,

I my opinion, basing the vm_swap_full test on the size of swap is bogus.
If you have a 512M box with 128M of swap its a good idea to always release
aggressively.  If the same box has 2G of swap (has /tmp on tmpfs maybe), it
does not make sense to start the agressive release at 1G.  I suggest the 
following makes more sense.

--- linux/include/linux/swap.h.orig     Sun Nov  4 09:30:14 2001
+++ linux/include/linux/swap.h  Sun Nov  4 09:32:46 2001
@@ -80,8 +80,8 @@

 extern int nr_swap_pages;

-/* Swap 50% full? Release swapcache more aggressively.. */
-#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
+/* Free swap less than inactive pages? Release swapcache more aggressively.. */
+#define vm_swap_full() (nr_swap_pages < nr_inactive_pages)

 extern unsigned int nr_free_pages(void);
 extern unsigned int nr_free_buffer_pages(void);

This starts aggressive swaping when the ammount of space left in swap is
less than the size of the inactive pages.

Comments?
Ed Tomlinson

             reply	other threads:[~2001-11-04 15:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-04 15:23 Ed Tomlinson [this message]
2001-11-04 16:36 ` [RFC][PATCH] vm_swap_full Rik van Riel
2001-11-04 17:04   ` Ed Tomlinson
2001-11-05  2:08   ` Mike Fedyk
2001-11-05  2:58     ` Ed Tomlinson
2001-11-05  3:10       ` Mike Fedyk
2001-11-05  3:15         ` Rik van Riel
2001-11-05 12:37 Ed Tomlinson

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=20011104152341.A4C289E898@oscar.casa.dyndns.org \
    --to=tomlins@cam.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).