Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 679021 - semantic difference between mapped file counters of memcg and global VM
semantic difference between mapped file counters of memcg and global VM
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
6.0
All Linux
unspecified Severity low
: rc
: ---
Assigned To: Johannes Weiner
Boris Ranto
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-21 05:16 EST by Johannes Weiner
Modified: 2015-08-31 23:50 EDT (History)
3 users (show)

See Also:
Fixed In Version: kernel-2.6.32-121.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 08:43:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0542 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 6.1 kernel security, bug fix and enhancement update 2011-05-19 07:58:07 EDT

  None (edit)
Description Johannes Weiner 2011-02-21 05:16:06 EST
Description of problem:
The global nr_mapped count in /proc/vmstat represents all mapped file pages, whereas mapped_file in /cgroup/memory/memory.stat does not include shmem pages.

How reproducible:
The counters differ by the number of shmem pages, so creating those makes the problem visible.

Steps to Reproduce:
compare the counters before and after creating a few thousand shmem pages

# cat /cgroup/memory/memory.stat /proc/vmstat | awk '/^mapped_file/ { print($2 / 4096); } /^nr_mapped/ { print $2 }'
# ./mkshmem &
# !-2
  
Actual results:
The counters differ by roughly the number of shmem pages mkshmem created.

Expected results:
The counters should be roughly the same.

Additional info:

/* gcc -o mkshmem mkshmem.c */

#include <sys/mman.h>
#include <string.h>
#include <stdio.h>

#define SIZE    (20UL << 20)

int main(void)
{
        char *map;

        map = mmap(NULL, SIZE, PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
        if (map == MAP_FAILED)
                return 1;
        memset(map, 0, SIZE);
        getchar();
        munmap(map, SIZE);
        return 0;
}
Comment 2 RHEL Product and Program Management 2011-03-01 16:40:01 EST
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 3 Aristeu Rozanski 2011-03-10 12:57:41 EST
Patch(es) available on kernel-2.6.32-121.el6
Comment 8 errata-xmlrpc 2011-05-19 08:43:40 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

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

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