qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org
Subject: Re: [PATCH 2/3] ci: do not use #processors+1 jobs, #processors is enough
Date: Tue, 18 May 2021 12:49:53 +0200	[thread overview]
Message-ID: <40f9d46b-d234-c029-3ba2-f5dcac8b87fc@redhat.com> (raw)
In-Reply-To: <20210518084139.97957-3-pbonzini@redhat.com>

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



  parent reply	other threads:[~2021-05-18 11:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  8:41 [PATCH 0/3] Small CI improvements Paolo Bonzini
2021-05-18  8:41 ` [PATCH 1/3] cirrus-ci: test installation Paolo Bonzini
2021-05-18 13:50   ` Alex Bennée
2021-05-19 14:44     ` Paolo Bonzini
2021-05-18  8:41 ` [PATCH 2/3] ci: do not use #processors+1 jobs, #processors is enough Paolo Bonzini
2021-05-18  8:56   ` Philippe Mathieu-Daudé
2021-05-18 10:49   ` Thomas Huth [this message]
2021-05-18 12:30     ` Paolo Bonzini
2021-05-18 12:43       ` Daniel P. Berrangé
2021-05-18 12:48         ` Paolo Bonzini
2021-05-18  8:41 ` [PATCH 3/3] ci: add -j to all "make" jobs Paolo Bonzini
2021-05-18  8:58   ` Philippe Mathieu-Daudé
2021-05-19 15:28 ` [PATCH 0/3] Small CI improvements Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40f9d46b-d234-c029-3ba2-f5dcac8b87fc@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).