summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-04-03 03:15:11 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-04-03 03:15:11 +0000
commit74caef711cc98ae33e5771d1e487e358b30572ef (patch)
tree3b09d67a6ba0768884c56d17713c86822f2b405a
parent6b7abfdcf9e6d86f8b875940d4a361154d516e70 (diff)
parent64816c63ca494f48f662e0c8e3d7364da71d0f67 (diff)
downloadextras-74caef711cc98ae33e5771d1e487e358b30572ef.tar.gz
Snap for 5430508 from 64816c63ca494f48f662e0c8e3d7364da71d0f67 to qt-release
Change-Id: I9f32d3b3956cf440df799c7d72db592f56fc6b09
-rw-r--r--checkpoint_gc/checkpoint_gc.sh3
-rw-r--r--cppreopts/cppreopts.rc3
-rwxr-xr-x[-rw-r--r--]cppreopts/cppreopts.sh3
3 files changed, 7 insertions, 2 deletions
diff --git a/checkpoint_gc/checkpoint_gc.sh b/checkpoint_gc/checkpoint_gc.sh
index d5f7ab40..93785804 100644
--- a/checkpoint_gc/checkpoint_gc.sh
+++ b/checkpoint_gc/checkpoint_gc.sh
@@ -44,7 +44,6 @@ DIRTY_SEGMENTS=${DIRTY_SEGMENTS_START}
TODO_SEGMENTS=$((${DIRTY_SEGMENTS_START}-${DIRTY_SEGMENTS_THRESHOLD}))
echo $DIRTY_SEGMENTS_START
while [ ${DIRTY_SEGMENTS} -gt ${DIRTY_SEGMENTS_THRESHOLD} ]; do
- echo $DIRTY_SEGMENTS
PROGRESS=`echo "(${DIRTY_SEGMENTS_START}-${DIRTY_SEGMENTS})/${TODO_SEGMENTS}"|bc -l`
if [[ $PROGRESS == -* ]]; then
PROGRESS=0
@@ -52,6 +51,8 @@ while [ ${DIRTY_SEGMENTS} -gt ${DIRTY_SEGMENTS_THRESHOLD} ]; do
print -u${STATUS_FD} "global_progress ${PROGRESS}"
read DIRTY_SEGMENTS < /sys/fs/f2fs/${NAME}/dirty_segments
sleep ${SLEEP}
+ # In case someone turns it off behind our back
+ echo 1 > /sys/fs/f2fs/${NAME}/gc_urgent
done
log -pi -t checkpoint_gc Turning off GC for ${NAME}
diff --git a/cppreopts/cppreopts.rc b/cppreopts/cppreopts.rc
index 812b4ce8..60bd66ca 100644
--- a/cppreopts/cppreopts.rc
+++ b/cppreopts/cppreopts.rc
@@ -16,6 +16,9 @@ service cppreopts /system/bin/cppreopts.sh /postinstall
oneshot
disabled
user root
+ priority -20
+ ioprio rt 0
+ writepid /dev/cpuset/foreground/tasks
capabilities
# Post install is above Treble VINTF, because it runs some utilities from
diff --git a/cppreopts/cppreopts.sh b/cppreopts/cppreopts.sh
index a3545e17..3416e675 100644..100755
--- a/cppreopts/cppreopts.sh
+++ b/cppreopts/cppreopts.sh
@@ -28,11 +28,12 @@ function do_copy() {
log -p w -t cppreopts "Unable to copy file ${source_file} to ${temp_dest_name}!"
else
log -p i -t cppreopts "Copied file from ${source_file} to ${temp_dest_name}"
- sync
+ fsync ${temp_dest_name}
if ! mv ${temp_dest_name} ${dest_name} ; then
log -p w -t cppreopts "Unable to rename temporary file from ${temp_dest_name} to ${dest_name}"
rm ${temp_dest_name} || log -p w -t cppreopts "Unable to remove temporary file ${temp_dest_name}"
else
+ fsync ${dest_name}
log -p i -t cppreopts "Renamed temporary file from ${temp_dest_name} to ${dest_name}"
fi
fi