diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-20 09:54:40 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-22 12:19:44 +0100 |
commit | 35a1d37ac8fd57bef6bc4de8047ffcadf7df7e56 (patch) | |
tree | 7ea12c3f5f1046adb14d0f586bdbbed6f285a858 /bitbake/lib/bb/build.py | |
parent | ace48c2866b9e74051ea97e26f09eaded9c21dcf (diff) | |
download | poky-35a1d37ac8fd57bef6bc4de8047ffcadf7df7e56.tar.gz |
bitbake: build: Add BB_TASK_NICE_LEVEL to task code
On Linux its not possible for processes to regain a previous nice level after
it has changed. Its therefore not possible to have a core low priority and
then raise the priorities of individual tasks.
This variable allows us to do something like:
BB_TASK_NICE_LEVEL = "5"
BB_TASK_NICE_LEVEL_task-testimage = "0"
to give priority to specific tasks which the BB_NICE_LEVEL functionality
doesn't give us the option of.
(Bitbake rev: 94d82997220c6cfc7028f76719df028ba8254a5c)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r-- | bitbake/lib/bb/build.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 8aec699e79..2e49a09365 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -346,6 +346,14 @@ def _exec_task(fn, task, d, quieterr): | |||
346 | if not tempdir: | 346 | if not tempdir: |
347 | bb.fatal("T variable not set, unable to build") | 347 | bb.fatal("T variable not set, unable to build") |
348 | 348 | ||
349 | # Change nice level if we're asked to | ||
350 | nice = localdata.getVar("BB_TASK_NICE_LEVEL", True) | ||
351 | if nice: | ||
352 | curnice = os.nice(0) | ||
353 | nice = int(nice) - curnice | ||
354 | newnice = os.nice(nice) | ||
355 | logger.debug(1, "Renice to %s " % newnice) | ||
356 | |||
349 | bb.utils.mkdirhier(tempdir) | 357 | bb.utils.mkdirhier(tempdir) |
350 | 358 | ||
351 | # Determine the logfile to generate | 359 | # Determine the logfile to generate |