diff options
author | Tom Cherry <tomcherry@google.com> | 2019-09-06 10:52:31 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2019-09-09 09:02:48 -0700 |
commit | 4233ec7f66d54d30109c838d09b358f21e214011 (patch) | |
tree | c72d0322a78fdc005a600bb3ead293067f8b356d /init/ueventd_parser_test.cpp | |
parent | 50e408db2d1bd015f87996f98b0bc21a39402ab0 (diff) |
ueventd: make parallel restorecon functionality optional
5aa6197d5f387579ff04c330001840d6988e825f added the ability to
parallelize restorecon to speed up boot for devices that have not
completely moved to genfscon. This parallel restorecon happens after
the parallel ueventd handling.
This causes a performance regression for devices that have moved to
genfscon, since previously, the restorecon() was done in the main
ueventd thread in parallel with the uevent handlers.
I also tried to run the fully parallelized restorecon in parallel with
the uevent handlers, but that did not make any change to the cold boot
time, likely due to the additional overhead of parallelizing the work.
Bug: 140458170
Test: blueline coldboot time returns to pre-regression time.
Change-Id: I3cd6a869cc9b62792466813d94ad6c69834e854e
Diffstat (limited to 'init/ueventd_parser_test.cpp')
-rw-r--r-- | init/ueventd_parser_test.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/init/ueventd_parser_test.cpp b/init/ueventd_parser_test.cpp index 9c1cedf8b..885e79ddd 100644 --- a/init/ueventd_parser_test.cpp +++ b/init/ueventd_parser_test.cpp @@ -147,6 +147,24 @@ uevent_socket_rcvbuf_size 8M TestUeventdFile(ueventd_file, {{}, {}, {}, {}, false, 8 * 1024 * 1024}); } +TEST(ueventd_parser, EnabledDisabledLines) { + auto ueventd_file = R"( +modalias_handling enabled +parallel_restorecon enabled +modalias_handling disabled +)"; + + TestUeventdFile(ueventd_file, {{}, {}, {}, {}, false, 0, true}); + + auto ueventd_file2 = R"( +parallel_restorecon enabled +modalias_handling enabled +parallel_restorecon disabled +)"; + + TestUeventdFile(ueventd_file2, {{}, {}, {}, {}, true, 0, false}); +} + TEST(ueventd_parser, AllTogether) { auto ueventd_file = R"( @@ -179,6 +197,8 @@ subsystem test_devpath_dirname firmware_directories /more uevent_socket_rcvbuf_size 6M +modalias_handling enabled +parallel_restorecon enabled #ending comment )"; @@ -211,7 +231,7 @@ uevent_socket_rcvbuf_size 6M size_t uevent_socket_rcvbuf_size = 6 * 1024 * 1024; TestUeventdFile(ueventd_file, {subsystems, sysfs_permissions, permissions, firmware_directories, - false, uevent_socket_rcvbuf_size}); + true, uevent_socket_rcvbuf_size, true}); } // All of these lines are ill-formed, so test that there is 0 output. @@ -230,6 +250,13 @@ uevent_socket_rcvbuf_size blah subsystem #no name +modalias_handling +modalias_handling enabled enabled +modalias_handling blah + +parallel_restorecon +parallel_restorecon enabled enabled +parallel_restorecon blah )"; TestUeventdFile(ueventd_file, {}); |