mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Swap reclaiming
@ 2001-08-26 17:01 Pavel Machek
  2001-08-26 19:00 ` Rik van Riel
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2001-08-26 17:01 UTC (permalink / raw)
  To: kernel list

Hi!

Browsing through 2.4.8 patch, I found this:

+/*
+ * When swap space gets filled up, we will set this flag.
+ * This will make do_swap_page(), in the page fault path,
+ * free swap entries on swapin so we'll reclaim swap space
+ * in order to be able to swap something out.
+ *
+ * At the moment we start reclaiming when swap usage goes
+ * over 80% of swap space.
+ *
+ * XXX: Random numbers, fixme.
+ */
+#define SWAP_FULL_PCT 80
+int vm_swap_full (void)
+{
+       int swap_used = total_swap_pages - nr_swap_pages;
+
+       return swap_used * 100 > total_swap_pages * SWAP_FULL_PCT;
+}
+

Hmm... This kind-of defeats purposes on swap priorities: with this,
you are going to fill slow swap even through there is lots of fast
swap that could be reclaimed.

I'm not sure what fix should be.
								Pavel
-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-26 19:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-26 17:01 Swap reclaiming Pavel Machek
2001-08-26 19:00 ` Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®