Swap reclaiming
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
Signature · 2 lines
I'm [email protected]. "In my country we have almost anarchy and I don't care." Panos Katsaloulis describing me w.r.t. patents at [email protected]
On Sun, 26 Aug 2001, Pavel Machek wrote:
[snip swap full code]
Quoted 3 lines
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.
When swap fills up, we will start freeing swap space on swapin.
This means that we'll free up space in both fast and slow swap.
Quoted 1 line
I'm not sure what fix should be.
I'm not sure what the problem would be ;)
(but would love a more detailed explanation if you really have found a problem)
regards,
Rik
Signature · 5 lines
IA64: a worthy successor to i860. http://www.surriel.com/ http://distro.conectiva.com/ Send all your spam to [email protected] (spam digging piggy)