[Devel] [PATCH RHEL7 COMMIT] ms/sysfs: do not account sysfs_ino_ida allocations to memcg

Konstantin Khorenko khorenko at odin.com
Thu May 7 02:11:38 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.4.10
------>
commit 5f52f9964f8b79ebf893aca281fdeab82bde4495
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Thu May 7 13:11:38 2015 +0400

    ms/sysfs: do not account sysfs_ino_ida allocations to memcg
    
    Patch has been added to the mm tree:
    
    http://www.spinics.net/lists/stable/msg89832.html
    
    ==================================================
    sysfs_ino_ida is used for sysfs inode number allocations. Since IDA has
    a layered structure, different IDs can reside on the same layer, which
    is currently accounted to some memory cgroup. The problem is that each
    kmem cache of a memory cgroup has its own directory on sysfs (under
    /sys/fs/kernel/<cache-name>/cgroup). If the inode number of such a
    directory or any file in it gets allocated from a layer accounted to the
    cgroup which the cache is created for, the cgroup will get pinned for
    good, because one has to free all kmem allocations accounted to a cgroup
    in order to release it and destroy all its kmem caches. That said we
    must not account layers of sysfs_ino_ida to any memory cgroup.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 fs/sysfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 2c68c20..e12273c 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -265,7 +265,7 @@ static int sysfs_alloc_ino(unsigned int *pino)
 	spin_unlock(&sysfs_ino_lock);
 
 	if (rc == -EAGAIN) {
-		if (ida_pre_get(&sysfs_ino_ida, GFP_KERNEL))
+		if (ida_pre_get(&sysfs_ino_ida, GFP_KERNEL | __GFP_NOACCOUNT))
 			goto retry;
 		rc = -ENOMEM;
 	}



More information about the Devel mailing list