From: Howard Chu Date: Mon, 4 Aug 2014 18:40:24 +0000 (-0700) Subject: More for MIPS X-Git-Tag: OPENLDAP_REL_ENG_2_4_40~54^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=899b23f89dd9f0eeb795d0772c0a8cd046c84ec3;p=openldap More for MIPS Do a cacheflush after writing data pages, separate from meta's cacheflush --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index dddfed1c66..8b560ed32e 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3110,6 +3110,12 @@ mdb_page_flush(MDB_txn *txn, int keep) #endif /* _WIN32 */ } + /* MIPS has cache coherency issues, this is a no-op everywhere else + * Note: for any size >= on-chip cache size, entire on-chip cache is + * flushed. + */ + CACHEFLUSH(env->me_map, txn->mt_next_pgno * env->me_psize, DCACHE); + for (i = keep; ++i <= pagecount; ) { dp = dl[i].mptr; /* This is a page we skipped above */ @@ -3583,7 +3589,7 @@ fail: done: /* MIPS has cache coherency issues, this is a no-op everywhere else */ if (!(env->me_flags & MDB_WRITEMAP)) { - CACHEFLUSH(env->me_map, txn->mt_next_pgno * env->me_psize, DCACHE); + CACHEFLUSH(env->me_map + off, len, DCACHE); } /* Memory ordering issues are irrelevant; since the entire writer * is wrapped by wmutex, all of these changes will become visible