]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
nproc: honor cgroup v2 CPU quotas
authorPádraig Brady <P@draigBrady.com>
Tue, 19 Aug 2025 15:49:22 +0000 (16:49 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 19 Aug 2025 16:24:21 +0000 (17:24 +0100)
* NEWS: Mention the new feature.
* doc/coreutils.texi (nproc invocation): Mention that
cgroup CPU quotas can limit the reported number.
* gnulib: Update to new nproc gnulib implementation:
https://github.com/coreutils/gnulib/commit/9b07115f4a

NEWS
doc/coreutils.texi
gnulib

diff --git a/NEWS b/NEWS
index d0bd06d4ade5c6463c32abd72cc8f3cc8b9fc309..5724698bfd443e90f00fc5327928bcaf8024ed45 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -75,15 +75,18 @@ GNU coreutils NEWS                                    -*- outline -*-
   basenc supports the --base58 option to encode and decode
   the visually unambiguous Base58 encoding.
 
+  'date' now outputs dates in the country's native calendar for the
+  Iranian locale (fa_IR) and for the Ethiopian locale (am_ET), and also
+  does so more consistently for the Thailand locale (th_TH.UTF-8).
+
+  nproc now honors any cgroup v2 configured CPU quotas,
+  which may reduce the effective number of processors available.
+
   stty supports setting arbitrary baud rates on supported systems,
   like Hurd, Linux with glibc >= 2.42, and some BSDs.
   Also on other systems the full set of supported baud rates
   is determined at build time if possible.
 
-  'date' now outputs dates in the country's native calendar for the
-  Iranian locale (fa_IR) and for the Ethiopian locale (am_ET), and also
-  does so more consistently for the Thailand locale (th_TH.UTF-8).
-
 ** Changes to conform better to POSIX.1-2024
 
   readlink now defaults to being verbose if the POSIXLY_CORRECT
index c4dd2f60ddf873586cf945d711c43cddeaa4f63c..c874ffc61cc5076dbdcc8b674de52e8e94c543f0 100644 (file)
@@ -17421,8 +17421,9 @@ which may be less than the number of online processors.
 If this information is not accessible, then print the number of
 processors installed.  If the @env{OMP_NUM_THREADS} or @env{OMP_THREAD_LIMIT}
 environment variables are set, then they will determine the minimum
-and maximum returned value respectively.  The result is guaranteed to be
-greater than zero.  Synopsis:
+and maximum returned value respectively.  Linux Cgroups version 2
+CPU quotas may also limit the maximum returned value.
+The result is guaranteed to be greater than zero.  Synopsis:
 
 @example
 nproc [@var{option}]
@@ -17436,8 +17437,8 @@ The program accepts the following options.  Also see @ref{Common options}.
 @opindex --all
 Print the number of installed processors on the system, which may
 be greater than the number online or available to the current process.
-The @env{OMP_NUM_THREADS} or @env{OMP_THREAD_LIMIT} environment variables
-are not honored in this case.
+The @env{OMP_NUM_THREADS} or @env{OMP_THREAD_LIMIT} environment variables,
+or Cgroup CPU quotas, are not honored in this case.
 
 @item --ignore=@var{number}
 @opindex --ignore
diff --git a/gnulib b/gnulib
index 948ba80168293e3d8a905eeffb0ab61424c4c374..9b07115f4a344effef1dde8bd0e6e356d4b0e744 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 948ba80168293e3d8a905eeffb0ab61424c4c374
+Subproject commit 9b07115f4a344effef1dde8bd0e6e356d4b0e744