Changeset: 4faed73ce142 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4faed73ce142
Modified Files:
        gdk/gdk_bbp.c
Branch: Jul2015
Log Message:

Unload BATs as soon as the physical reference is zero and the BAT clean.
The idea is, the O/S will keep any used pages in memory until the
memory is needed again, and if we need the BAT again before that, we
get to reuse those memory pages without the O/S having to reread from
disk.
This depends on the fact that indexes (imprints and hashes) are merely
unloaded, not destroyed, when the BAT gets unloaded, and reloaded when
operations need those indexes again.
This should fix bug 3835.


diffs (17 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -2327,8 +2327,11 @@ decref(bat i, int logical, int releaseSh
        }
 
        /* we destroy transients asap and unload persistent bats only
-        * if they have been made cold */
-       if (BBP_refs(i) > 0 || (BBP_lrefs(i) > 0 && BBP_lastused(i) != 0)) {
+        * if they have been made cold or are not dirty */
+       if (BBP_refs(i) > 0 ||
+           (BBP_lrefs(i) > 0 &&
+            BBP_lastused(i) != 0 &&
+            (b == NULL || BATdirty(b) || !(BBP_status(i) & BBPPERSISTENT)))) {
                /* bat cannot be swapped out. renew its last usage
                 * stamp for the BBP LRU policy */
                int sec = BBPLASTUSED(BBPstamp());
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to