Bug 987507 - numastat -m reports incorrect data about amount of static huge pages
Summary: numastat -m reports incorrect data about amount of static huge pages
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: numactl
Version: 6.4
Hardware: All
OS: Linux
Target Milestone: rc
: 6.5
Assignee: Anton Arapov
QA Contact: Juraj Marko
Depends On:
TreeView+ depends on / blocked
Reported: 2013-07-23 14:31 UTC by Bill Gray
Modified: 2015-09-01 03:39 UTC (History)
8 users (show)

Fixed In Version: numactl-2.0.7-7.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-11-21 23:36:36 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1712 0 normal SHIPPED_LIVE numactl bug fix update 2013-11-20 21:51:49 UTC

Description Bill Gray 2013-07-23 14:31:24 UTC
There is a small error in the numastat source that prevents it from correctly calculating the amount of static huge page memory for the "numastat -m" report.  The fix is known and trivial.

Comment 1 Bill Burns 2013-07-23 17:47:31 UTC
Know this is a late request for a package that is not on the ACL. It's a minor change to 1 item in the package, just numastat.

Comment 2 Bill Gray 2013-07-25 14:53:13 UTC
A patch "[PATCH] Bring numastat up to revision 20130723" has been sent to the linux-numa mailing list with a fix for the incorrect static huge page quantity parsing.  The actual bug fix is a one-character change.

Comment 9 Anton Arapov 2013-08-14 17:20:23 UTC
Bill, could you attach a patch to this Bugzilla please. I will spin a build.

Comment 10 Bill Gray 2013-08-14 17:30:17 UTC
Yes, thanks!  Here is the patch, straight from the linux-numa list:

This patch fixes issues (detailed below) in numastat.c and numastat.8,
and brings numastat up to revision 20130723.

numastat.8 |   18 +++++++-----------
numastat.c |    4 ++--
2 files changed, 9 insertions(+), 13 deletions(-)

- fix bug preventing correct static huge page quantities
- update version number

- remove redundant "interleave hit" description
- remove extraneous leading spaces and blank lines
- enhance explanation of correct placement for "-s" option

Signed-off-by: Bill Gray <bgray@redhat.com>

diff -purN numactl-2.0.8-orig/numastat.8 numactl-2.0.8-new/numastat.8
--- numactl-2.0.8-orig/numastat.8    2012-10-11 16:52:25.000000000 -0400
+++ numactl-2.0.8-new/numastat.8    2013-07-24 17:54:36.570307058 -0400
@@ -36,26 +36,20 @@ on another node.
 .B numa_foreign
 is memory intended for this node, but actually allocated on some different node.  Each
- .I numa_foreign
+.I numa_foreign
 has a
- .I numa_miss
-  on another node.
+.I numa_miss
+on another node.
 .B interleave_hit
 is interleaved memory successfully allocated on this node as intended.
-.B interleave_hit
-is the number of interleave policy allocations that were intended for a
-specific node and succeeded there.
 .B local_node
 is memory allocated on this node while a process was running on it.
 .B other_node
 is memory allocated on this node while a process was running on some other node.
 Any supplied options or arguments with the \fBnumastat\fP command will
 significantly change both the content and the format of the display. Specified
 options will cause display units to change to megabytes of memory, and will
@@ -100,7 +94,10 @@ memory consumers are listed first.  With
 sorted by the total column.  If the optional <node> argument is supplied, the
 data will be sorted by the <node> column.  Note that <node> must follow the
 \fB\-s\fP immediately with no intermediate white space (e.g., \fBnumastat
+\-s2\fP). Because \fB\-s\fP can allow an optional argument, it must always be
+the last option character in a compound option character string. For example,
+instead of \fBnumastat \-msc\fP (which probably will not work as you expect),
+use \fBnumastat \-mcs\fP
 Make some reports more verbose.  In particular, process information for
@@ -139,7 +136,6 @@ NUMASTAT_WIDTH
 .I numastat \-c \-z \-m \-n
diff -purN numactl-2.0.8-orig/numastat.c numactl-2.0.8-new/numastat.c
--- numactl-2.0.8-orig/numastat.c    2012-10-11 16:52:25.000000000 -0400
+++ numactl-2.0.8-new/numastat.c    2013-07-24 17:50:02.845242848 -0400
@@ -724,7 +724,7 @@ double huge_page_size_in_bytes = 0;

 void display_version_and_exit() {
-    char *version_string = "20120821";
+    char *version_string = "20130723";
     printf("%s version: %s: %s\n", prog_name, version_string, __DATE__);
@@ -880,7 +880,7 @@ void show_info_from_system_file(char *fi
                 double value = (double)atol(tok[1 + tok_offset]);
                 if (!compatibility_mode) {
                     double multiplier = 1.0;
-                    if (tokens < 5) {
+                    if (tokens < 4) {
                         multiplier = page_size_in_bytes;
                     } else if (!strncmp("HugePages", tok[2], 9)) {
                         multiplier = huge_page_size_in_bytes;


Comment 17 errata-xmlrpc 2013-11-21 23:36:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.