]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu: Add a hook to allow it to renice
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 5 Sep 2020 14:06:07 +0000 (15:06 +0100)
committerSteve Sakoman <steve@sakoman.com>
Tue, 8 Sep 2020 14:31:19 +0000 (04:31 -1000)
We have an issue where qemu is being starved of resources on our autobuilders.
We can't raise its priority without special capacilties, therefore add a hook
which if present can allow this to happen using an executable
"~/runqemu-renice".

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 141a3c9ce93bc3d526303021ecf0460c6e9fea8a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
scripts/runqemu

index b24ac1c8042d68d5bd76efafb71115387d0970e0..cc87ea871a40591e357041d2e4a68cbd0d06f25c 100755 (executable)
@@ -1507,6 +1507,11 @@ def main():
     try:
         config = BaseConfig()
 
+        renice = os.path.expanduser("~/bin/runqemu-renice")
+        if os.path.exists(renice):
+            logger.info('Using %s to renice' % renice)
+            subprocess.check_call([renice, str(os.getpid())])
+
         def sigterm_handler(signum, frame):
             logger.info("SIGTERM received")
             os.kill(config.qemupid, signal.SIGTERM)