Fix sync mode in the logging backend
This flushes data out as we go and teaches the kernel that it can drop
it from the cache. This keeps the kernel cache pretty free.
We were only syncing the first page and never flushing... Whops. This
now flushes. Confirmed with strace (And I really don't know how to
write a reliable test for it...)
Change-Id: I939791b41b04bae9bc53857efa585d0cbb318924
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/events/logging/log_backend.cc b/aos/events/logging/log_backend.cc
index a8b7a43..4b170d3 100644
--- a/aos/events/logging/log_backend.cc
+++ b/aos/events/logging/log_backend.cc
@@ -242,8 +242,8 @@
total_write_bytes_ - last_synced_bytes_,
POSIX_FADV_DONTNEED);
- last_synced_bytes_ = total_write_bytes_;
}
+ last_synced_bytes_ = total_write_bytes_;
}
const auto end = aos::monotonic_clock::now();