Bug 673629

Summary: hugetlbfs fs interface should deal with minus value echoed to /proc/sys/vm/nr_hugepages gracefully
Product: Red Hat Enterprise Linux 6 Reporter: Zhang Kexin <kzhang>
Component: kernelAssignee: Petr Holasek <pholasek>
Status: CLOSED ERRATA QA Contact: Petr Beňas <pbenas>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1CC: anton, dhoward, pbenas, pholasek, pstehlik
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-2.6.32-150.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 12:41:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Zhang Kexin 2011-01-29 00:02:02 UTC
Description of problem:
hugetlbfs does not deal with minus value echoing to /proc/sys/vm/nr_hugepages gracefully.

Version-Release number of selected component (if applicable):
2.6.32-99.el6.x86_64

How reproducible:
always.

Steps to Reproduce:
1. echo -1 > /proc/sys/vm/nr_hugepages
2. cat /proc/meminfo
3.
  
Actual results:
[root@dell-per510-01 mnt]# cat /proc/meminfo 
MemTotal:       16323332 kB
MemFree:        15323236 kB
Buffers:          119928 kB
Cached:           352784 kB
SwapCached:            0 kB
Active:           269992 kB
Inactive:         237640 kB
Active(anon):      35124 kB
Inactive(anon):       28 kB
Active(file):     234868 kB
Inactive(file):   237612 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      18563064 kB
SwapFree:       18563064 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         34940 kB
Mapped:            13812 kB
Shmem:               232 kB
Slab:             411172 kB
SReclaimable:      86516 kB
SUnreclaim:       324656 kB
KernelStack:        2648 kB
PageTables:         4952 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    26721656 kB
Committed_AS:     138716 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      310000 kB
VmallocChunk:   34359423152 kB
HardwareCorrupted:     0 kB
AnonHugePages:      8192 kB
HugePages_Total:       3
HugePages_Free:        3
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        6756 kB
DirectMap2M:    16760832 kB

Expected results:
HugePages_Total:  preferred to be 0 or keep unchanged.

Additional info:
If echo other minus value, the HugePages_Total: and HugePages_Free: will changed randomly, eg,
[root@dell-per510-01 mnt]# echo -100 > /proc/sys/vm/nr_hugepages
[root@dell-per510-01 mnt]# cat /proc/meminfo 
MemTotal:       16323332 kB
MemFree:        15319140 kB
Buffers:          119936 kB
Cached:           352788 kB
SwapCached:            0 kB
Active:           270012 kB
Inactive:         237648 kB
Active(anon):      35144 kB
Inactive(anon):       28 kB
Active(file):     234868 kB
Inactive(file):   237620 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      18563064 kB
SwapFree:       18563064 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         34940 kB
Mapped:            13812 kB
Shmem:               232 kB
Slab:             411176 kB
SReclaimable:      86520 kB
SUnreclaim:       324656 kB
KernelStack:        2648 kB
PageTables:         4952 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    26719608 kB
Committed_AS:     138716 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      310000 kB
VmallocChunk:   34359423152 kB
HardwareCorrupted:     0 kB
AnonHugePages:      8192 kB
HugePages_Total:       5
HugePages_Free:        5
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        6756 kB
DirectMap2M:    16760832 kB

Comment 2 RHEL Program Management 2011-01-29 00:28:10 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 3 Anton Arapov 2011-02-24 08:04:56 UTC
patch has been sent to upstream and will be in Linus' tree very soon:
  https://lkml.org/lkml/2011/2/22/427 (credits to Peter Holasek)

Comment 4 Linda Wang 2011-02-24 18:24:56 UTC
patch posted for review. move the BZ state to POST.

Comment 5 RHEL Program Management 2011-05-13 15:22:30 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 6 Aristeu Rozanski 2011-05-18 19:48:39 UTC
Patch(es) available on kernel-2.6.32-150.el6

Comment 10 Petr Beňas 2011-07-25 07:19:24 UTC
Reproduced in 2.6.32-130.el6.x86_64 and verified in 2.6.32-155.el6.x86_64.

Comment 11 errata-xmlrpc 2011-12-06 12:41:34 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.

http://rhn.redhat.com/errata/RHSA-2011-1530.html