[Devel] [PATCH RHEL8 COMMIT] memcg: Account xt_counters for ip6_tables and arp_tables

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 16 17:57:24 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.14
------>
commit 4e596dd8428bd9a8b7fe9e2abbbda4d01ea09b32
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Fri Apr 16 17:57:24 2021 +0300

    memcg: Account xt_counters for ip6_tables and arp_tables
    
    currently xt_counters are accounted for ip_tables only,
    it makes sense to do it for ip6_tables and arp_tables too.
    
    Fixes: 06fac184ac6b "memcg: charge kmem allocations accounted to UBC in
    PCS6 to memcg"
    https://jira.sw.ru/browse/PSBM-120694
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 net/ipv4/netfilter/arp_tables.c | 2 +-
 net/ipv6/netfilter/ip6_tables.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index d198cd3e8137..72e0a56369ee 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -657,7 +657,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table)
 	 * about).
 	 */
 	countersize = sizeof(struct xt_counters) * private->number;
-	counters = vzalloc(countersize);
+	counters = vzalloc_account(countersize);
 
 	if (counters == NULL)
 		return ERR_PTR(-ENOMEM);
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 04e3670c9217..238a1f135499 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -816,7 +816,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table)
 	   (other than comefrom, which userspace doesn't care
 	   about). */
 	countersize = sizeof(struct xt_counters) * private->number;
-	counters = vzalloc(countersize);
+	counters = vzalloc_account(countersize);
 
 	if (counters == NULL)
 		return ERR_PTR(-ENOMEM);


More information about the Devel mailing list