[Devel] [PATCH RHEL8 COMMIT] memcg: disable accounting in netdev_create_hash()

Konstantin Khorenko khorenko at virtuozzo.com
Wed Apr 14 12:50:45 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.13
------>
commit 1bf26d054c3171e28a00128f3b77a5c27fe2bdea
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Wed Apr 14 12:50:45 2021 +0300

    memcg: disable accounting in netdev_create_hash()
    
    netdev_create_hash() is called twice per netns and
    allocates 1 page only. I think it is too small to account this.
    
    https://jira.sw.ru/browse/PSBM-120694
    To_merge: 06fac184ac6b ("memcg: charge kmem allocations accounted to UBC in PCS6
    to memcg")
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 3b4877d93a4e..6b55bdba1195 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9854,7 +9854,7 @@ static struct hlist_head * __net_init netdev_create_hash(void)
 	int i;
 	struct hlist_head *hash;
 
-	hash = kmalloc_array(NETDEV_HASHENTRIES, sizeof(*hash), GFP_KERNEL_ACCOUNT);
+	hash = kmalloc_array(NETDEV_HASHENTRIES, sizeof(*hash), GFP_KERNEL);
 	if (hash != NULL)
 		for (i = 0; i < NETDEV_HASHENTRIES; i++)
 			INIT_HLIST_HEAD(&hash[i]);


More information about the Devel mailing list