Re: I: coreutils tests/misc/nproc-avail fails on GNU/Linux without /proc and /sys mounted

2010-01-11 Thread Bruno Haible
Pádraig Brady wrote: Here's a proposed patch. Looks good. OK, I've applied it now. Bruno

Re: I: coreutils tests/misc/nproc-avail fails on GNU/Linux without /proc and /sys mounted

2010-01-10 Thread Bruno Haible
Pádraig Brady wrote: Just to summarize what's happening here... There are 3 CPU counts possible: total = online = available online corresponds to the CPUs enabled system wide, whereas available is what's available to a particular process which may be less due to affinity config.

Re: I: coreutils tests/misc/nproc-avail fails on GNU/Linux without /proc and /sys mounted

2010-01-10 Thread Pádraig Brady
On 10/01/10 10:32, Bruno Haible wrote: Pádraig Brady wrote: So what about a possible work around? How about doing this in nproc(1): if (num_processors(NPROC_ALL) == 1) return num_processors(NPROC_CURRENT_OVERRIDABLE) It should be NPROC_CURRENT, not NPROC_CURRENT_OVERRIDABLE, I think,

Re: I: coreutils tests/misc/nproc-avail fails on GNU/Linux without /proc and /sys mounted

2010-01-10 Thread Dmitry V. Levin
On Sun, Jan 10, 2010 at 11:32:50AM +0100, Bruno Haible wrote: [...] I like this workaround, but would prefer to have it in the nproc module in gnulib. coreutils/src/nproc.c is purely the command-line program. Here's a proposed patch. It looks good, thank you. -- ldv pgpyzrOibAKXP.pgp

I: coreutils tests/misc/nproc-avail fails on GNU/Linux without /proc and /sys mounted

2010-01-09 Thread Dmitry V. Levin
Hi, The recently introduced nproc utility outputs wrong result when run in --all mode inside a /proc-less /sys-less GNU/Linux chroot on a system with several CPUs. In this environment, nproc --all always outputs 1 while plain nproc outputs correct number of available CPUs. The underlying

Re: I: coreutils tests/misc/nproc-avail fails on GNU/Linux without /proc and /sys mounted

2010-01-09 Thread Giuseppe Scrivano
when --all fails for any reason, I think we should try with the number of available processing units, at least it is a more accurate value than return 1 (and document this behaviour). Bruno, Jim, what do you think? Cheers, Giuseppe Dmitry V. Levin l...@altlinux.org writes: Hi, The

Re: I: coreutils tests/misc/nproc-avail fails on GNU/Linux without /proc and /sys mounted

2010-01-09 Thread Pádraig Brady
On 10/01/10 01:14, Giuseppe Scrivano wrote: when --all fails for any reason, I think we should try with the number of available processing units, at least it is a more accurate value than return 1 (and document this behaviour). Bruno, Jim, what do you think? Just to summarize what's happening