From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sedat Dilek Subject: [PATCH] xfstests-bld: Simplify determination of number of CPUs in build-all Date: Fri, 28 Mar 2014 10:03:19 +0100 Message-ID: <1395997399-3000-1-git-send-email-sedat.dilek@gmail.com> Cc: Sedat Dilek To: Theodore Ts'o , lsf@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org Return-path: Received: from mail-qc0-f173.google.com ([209.85.216.173]:35761 "EHLO mail-qc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751005AbaC1JD3 (ORCPT ); Fri, 28 Mar 2014 05:03:29 -0400 Received: by mail-qc0-f173.google.com with SMTP id r5so5592462qcx.18 for ; Fri, 28 Mar 2014 02:03:28 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Use 'getconf _NPROCESSORS_ONLN' to determine the total number of available ("online") CPUs. I have seen this 1st in some build-scripts of Grml project and had some discussions with Thorsten Glaser on this topic. Signed-off-by: Sedat Dilek --- build-all | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-all b/build-all index 9d2959e..50b3d45 100755 --- a/build-all +++ b/build-all @@ -6,8 +6,7 @@ else . config fi -nr_cpus=$(expr 1 + $(grep ^processor /proc/cpuinfo | tail -1 | \ - sed -e 's/.*://') ) +nr_cpus=$(getconf _NPROCESSORS_ONLN) J=-j$(expr $nr_cpus \* 2) DESTDIR=$(pwd)/bld -- 1.9.1