diff options
author | Wei Wang <wvw@google.com> | 2019-04-01 08:51:18 -0700 |
---|---|---|
committer | Wei Wang <wvw@google.com> | 2019-04-01 09:29:38 -0700 |
commit | a1dced2b52f1fc124ec54f93aee39c2280f0bb56 (patch) | |
tree | 841502f1660adff34d7e2e397e23ccfe546fc0e4 /cppreopts/cppreopts.sh | |
parent | 41cb9915b20d3029cd195a6a9b3152eabf4daeea (diff) | |
download | extras-a1dced2b52f1fc124ec54f93aee39c2280f0bb56.tar.gz |
Use fsync instead of sync during first boot
1) fsync the specific copied file instead of sync whole file system
2) boost prio/ioprio for CFQ since cpppreopt is on critical path
3) change to foreground group
Before CL:
03-29 21:49:31.450 1 1 I init : Service 'cppreopts' (pid 1662) exited with status 0 waiting took 55.175999 seconds
03-29 21:49:31.808 1440 1440 I PackageManager: cppreopts took 55591 ms
After CL:
04-01 15:47:43.841 1 1 I init : Service 'cppreopts' (pid 1871) exited with status 0 waiting took 2.007000 seconds
04-01 15:47:45.343 1549 1549 I PackageManager: cppreopts took 3709 ms
Bug: 129542240
Test: boot
Change-Id: Ia9bacabe798764084790b077abc80ae60401f9c1
Diffstat (limited to 'cppreopts/cppreopts.sh')
-rwxr-xr-x[-rw-r--r--] | cppreopts/cppreopts.sh | 3 |
1 files changed, 2 insertions, 1 deletions
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 |