Discussion:
[PATCH] Prezeroing V8
(too old to reply)
Pavel Machek
2005-03-25 01:52:41 UTC
Permalink
Hi!
- Drop clear_pages and the approach to zero pages of higher order
first
- Zero a percentage of pages from all orders to avoid fragmentation
Adds management of ZEROED and NOT_ZEROED pages and a background daemon
called scrubd. /proc/sys/vm/scrubd_load, /proc/sys/vm_scrubd_start and
/proc/sys/vm_scrubd_stop control the scrub daemon. See Documentation/vm/
scrubd.txt
In an SMP environment the scrub daemon is typically running on the most
idle cpu. Thus a single threaded application running
on one cpu may have the other cpu zeroing pages for it etc. The scrub
daemon is hardly noticable and usually finishes zeroing quickly since
most processors are optimized for linear memory filling.
Patch against 2.6.11.3-bk3
+unsigned int sysctl_scrub_start = 100; /* Min percentage of zeroed free pages per zone (~10% default) */
+unsigned int sysctl_scrub_stop = 300; /* Max percentage of zeroed free pages per zone (~30% default) */
+unsigned int sysctl_scrub_load = 1; /* Do not run scrubd if load > */
Perhaps that variable should be called sysctl_scrub*d*_load?

....
+ while (avenrun[0] >= ((unsigned long)sysctl_scrub_load << FSHIFT))
+ schedule_timeout(30*HZ);
+
+ for (i = 0; i < pgdat->nr_zones; i++)
+ zero_zone(pgdat->node_zones +i);
tabs vs. spaces alert, but more importantly....
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.11/Documentation/vm/scrubd.txt 2005-03-17 12:57:41.000000000 -0800
@@ -0,0 +1,59 @@
+The SCRUB Daemon
+----------------
+
+The scrub daemon zeroes memory so that later requests for zeroed memory can
+be satisifed without having to zero memory in a hot code path. The operations
+
+/proc/sys/vm/scrubd_load default value 1
+
+ Scrubd is woken up if the system load is lower than this setting and
+ the numer of unzeroed free pages drops below scrub_start*10 percent.
+ The default setting of 1 insures that there will be no performance
+ degradation in single user mode. In an SMP system a cpu is frequently
+ idle despite the load being high. A setting of 9 or 99 may
+ be useful then.
I don't think 1 guarantees no performance degradation. After all, it
is average load and scrubd might run at just the wrong times. Perhaps
it should default to 0?

Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Jan Engelhardt
2005-03-25 12:31:37 UTC
Permalink
Post by Pavel Machek
I don't think 1 guarantees no performance degradation. After all, it
is average load and scrubd might run at just the wrong times. Perhaps
it should default to 0?
My load never gets below 1.00, because I run BOINC. This is the only app, so
scrubbing could be done nonetheless (around the memory area which boinc uses).

Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Christoph Lameter
2005-03-29 01:55:14 UTC
Permalink
Post by Pavel Machek
+unsigned int sysctl_scrub_start = 100; /* Min percentage of zeroed free pages per zone (~10% default) */
+unsigned int sysctl_scrub_stop = 300; /* Max percentage of zeroed free pages per zone (~30% default) */
+unsigned int sysctl_scrub_load = 1; /* Do not run scrubd if load > */
Perhaps that variable should be called sysctl_scrub*d*_load?
Hmm. Ok they are all now _scrubd_ instead..
Post by Pavel Machek
+ Scrubd is woken up if the system load is lower than this setting and
+ the numer of unzeroed free pages drops below scrub_start*10 percent.
+ The default setting of 1 insures that there will be no performance
+ degradation in single user mode. In an SMP system a cpu is frequently
+ idle despite the load being high. A setting of 9 or 99 may
+ be useful then.
I don't think 1 guarantees no performance degradation. After all, it
is average load and scrubd might run at just the wrong times. Perhaps
it should default to 0?
Correct. Changed the wording. Not sure about setting it to zero since its
an experimental feature set to off by default. If one enables scrubd then
the presumably something should be happening.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Loading...