linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] build-all: Simplify determination of number of CPUs
@ 2014-03-28  9:01 Sedat Dilek
  0 siblings, 0 replies; only message in thread
From: Sedat Dilek @ 2014-03-28  9:01 UTC (permalink / raw)
  To: Theodore Ts'o, lsf, linux-fsdevel; +Cc: Sedat Dilek

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-28  9:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-28  9:01 [PATCH] build-all: Simplify determination of number of CPUs Sedat Dilek

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).