qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] ci: do not use #processors+1 jobs, #processors is enough


From: Thomas Huth
Subject: Re: [PATCH 2/3] ci: do not use #processors+1 jobs, #processors is enough
Date: Tue, 18 May 2021 12:49:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0

On 18/05/2021 10.41, Paolo Bonzini wrote:
I could not reconstruct the origin of the $(($(nproc) + 1)) idiom,
but I suspect it was there only to have a sensible result when nproc
or getconf do not exist.  This can be achieved also with an "||".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
  .gitlab-ci.yml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4bd1a91aa8..3f0d86cf0a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,7 +17,7 @@ include:
    stage: build
    image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
    before_script:
-    - JOBS=$(expr $(nproc) + 1)
+    - JOBS=$(nproc || echo 1)

The basic idea of the "+ 1" was to make sure that there is always a thread that runs on a CPU while maybe another one is waiting for I/O to complete. This is suggested by various sites on the web, e.g.:


https://unix.stackexchange.com/questions/519092/what-is-the-logic-of-using-nproc-1-in-make-command

So not sure whether this patch here make sense ... I'd rather drop it.

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]