Skip to contentSkip to conversation

use nproc

PATCH New Rob Landley 3 participants 5 messages Dec 30, 2016 – Jan 1, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use nproc

My rule of thumb is that once a change is 7 years old, you can rely on the installed base to have it. With that in mind, would you like to use nproc to check how many processors are available?

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f

package/Makefile.in +1 -1
index afd5d3a..5eed804 100644
@@ -12,7 +12,7 @@ HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
 # If the number of processors is not available, assume one.
 ifeq ($(BR2_JLEVEL),0)
 PARALLEL_JOBS := $(shell echo \
-	$$((1 + `getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1`)))
+	$$((1 + `nproc 2>/dev/null || echo 1`)))
 else
 PARALLEL_JOBS := $(BR2_JLEVEL)
 endif
#1 lore raw

PATCH 1/1 use nproc

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Rob" == Rob Landley <[email protected]> writes:

My rule of thumb is that once a change is 7 years old, you can rely on the installed base to have it. With that in mind, would you like to use nproc to check how many processors are available?

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f

Why? What is the advantage? Purely cosmetical? Are there any well known distributions providing nproc and not getconf?

Quoted 19 lines
package/Makefile.in +1 -1
index afd5d3a..5eed804 100644
@@ -12,7 +12,7 @@ HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
 # If the number of processors is not available, assume one.
 ifeq ($(BR2_JLEVEL),0)
 PARALLEL_JOBS := $(shell echo \
-	$$((1 + `getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1`)))
+	$$((1 + `nproc 2>/dev/null || echo 1`)))
 else
 PARALLEL_JOBS := $(BR2_JLEVEL)
 endif

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 use nproc

Hello,

Quoted 8 lines · Peter Korsgaard
Quoted 5 lines

My rule of thumb is that once a change is 7 years old, you can rely on the installed base to have it. With that in mind, would you like to use nproc to check how many processors are available?

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f

Why? What is the advantage? Purely cosmetical? Are there any well known distributions providing nproc and not getconf?

Well, the simplification provided by Rob looks useful to me. It's purely cosmetic, but we also do tons of other cosmetic changes.

The big question is whether nconf is available even in the really old RHEL distros that some of our users have.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 use nproc

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 4 lines · Peter Korsgaard
Quoted 3 lines

My rule of thumb is that once a change is 7 years old, you can rely on the installed base to have it. With that in mind, would you like to use nproc to check how many processors are available?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f

Why? What is the advantage? Purely cosmetical? Are there any well known distributions providing nproc and not getconf?

Well, the simplification provided by Rob looks useful to me. It's purely cosmetic, but we also do tons of other cosmetic changes.

True, but for stuff depending on the details of the host OS we need to be careful, so it is interesting to know if this change is NEEDED somewhere, or just a nice-to-have cleanup thing.

Quoted 2 lines

The big question is whether nconf is available even in the really old RHEL distros that some of our users have.

Indeed, this was the kind of details I was missing in the commit description.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 use nproc

In reply to Rob Landley

Hello,

Quoted 5 lines · Rob Landley

My rule of thumb is that once a change is 7 years old, you can rely on the installed base to have it. With that in mind, would you like to use nproc to check how many processors are available?

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f

This patch lacks your Signed-off-by line, so we can't apply it as-is.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com