linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>,
	lsf@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Subject: [PATCH] xfstests-bld: Simplify determination of number of CPUs in build-all
Date: Fri, 28 Mar 2014 10:03:19 +0100	[thread overview]
Message-ID: <1395997399-3000-1-git-send-email-sedat.dilek@gmail.com> (raw)

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 <sedat.dilek@gmail.com>
---
 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


             reply	other threads:[~2014-03-28  9:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28  9:03 Sedat Dilek [this message]
2014-03-28 16:18 ` [PATCH] xfstests-bld: Simplify determination of number of CPUs in build-all tytso
2014-03-29 10:04   ` Sedat Dilek
2014-03-29 14:04     ` Theodore Ts'o
2014-03-31  2:51   ` [Lsf] " Dave Chinner
2014-04-01  2:37     ` Theodore Ts'o
2014-04-01 22:28       ` Dave Chinner
2014-04-02 14:26         ` Theodore Ts'o
2014-04-03  1:14           ` Dave Chinner
2014-04-03 10:26             ` Lukáš Czerner
2014-04-03 17:05               ` Andy Lutomirski
2014-04-03 17:35                 ` Theodore Ts'o
2014-04-03 17:42                   ` Andy Lutomirski
2014-04-03 19:06                   ` Eric Sandeen
2014-04-03 19:21                     ` Andy Lutomirski
2014-04-03 21:46                       ` Eric Sandeen
2014-04-03 19:30                     ` Theodore Ts'o
2014-04-03 21:20                       ` Dave Chinner
2014-04-03 13:16           ` Mel Gorman

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=1395997399-3000-1-git-send-email-sedat.dilek@gmail.com \
    --to=sedat.dilek@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lsf@lists.linux-foundation.org \
    --cc=tytso@mit.edu \
    /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).