linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfstests-bld: Simplify determination of number of CPUs in build-all
@ 2014-03-28  9:03 Sedat Dilek
  2014-03-28 16:18 ` tytso
  0 siblings, 1 reply; 19+ messages in thread
From: Sedat Dilek @ 2014-03-28  9:03 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] 19+ messages in thread

end of thread, other threads:[~2014-04-03 21:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-28  9:03 [PATCH] xfstests-bld: Simplify determination of number of CPUs in build-all Sedat Dilek
2014-03-28 16:18 ` 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

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