From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nf-next,v3 2/8] netfilter: nfnetlink: use GFP_KERNEL_ACCOUNT
Date: Mon, 7 Sep 2026 20:55:46 +0200 [thread overview]
Message-ID: <20260907185552.1422008-2-pablo@netfilter.org> (raw)
In-Reply-To: <20260907185552.1422008-1-pablo@netfilter.org>
GFP_KERNEL_ACCOUNT is preferred these days for memcg, replace
GFP_KERNEL by GFP_KERNEL_ACCOUNT.
Use GFP_KERNEL_ACCOUNT for objects that are created from nfnetlink
subsystems.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
v2: no changes
net/netfilter/nfnetlink_acct.c | 2 +-
net/netfilter/nfnetlink_cthelper.c | 3 ++-
net/netfilter/nfnetlink_cttimeout.c | 8 +++++---
net/netfilter/nfnetlink_osf.c | 2 +-
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c
index 8ff1e0ad5cb0..1a366fbd8133 100644
--- a/net/netfilter/nfnetlink_acct.c
+++ b/net/netfilter/nfnetlink_acct.c
@@ -112,7 +112,7 @@ static int nfnl_acct_new(struct sk_buff *skb, const struct nfnl_info *info,
size += sizeof(u64);
}
- nfacct = kzalloc(sizeof(struct nf_acct) + size, GFP_KERNEL);
+ nfacct = kzalloc(sizeof(struct nf_acct) + size, GFP_KERNEL_ACCOUNT);
if (nfacct == NULL)
return -ENOMEM;
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
index 5b6a09f46903..a09b2fdbf9b4 100644
--- a/net/netfilter/nfnetlink_cthelper.c
+++ b/net/netfilter/nfnetlink_cthelper.c
@@ -335,7 +335,8 @@ static int nfnl_cthelper_update_policy_all(struct nlattr *tb[],
struct nf_conntrack_expect_policy *policy;
int i, ret = 0;
- new_policy = kmalloc_objs(*new_policy, helper->expect_class_max + 1);
+ new_policy = kmalloc_objs(*new_policy, helper->expect_class_max + 1,
+ GFP_KERNEL_ACCOUNT);
if (!new_policy)
return -ENOMEM;
diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c
index 66c2016f6049..6b4adaaf61af 100644
--- a/net/netfilter/nfnetlink_cttimeout.c
+++ b/net/netfilter/nfnetlink_cttimeout.c
@@ -71,7 +71,8 @@ ctnl_timeout_parse_policy(void *timeout,
struct nlattr **tb;
int ret = 0;
- tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1);
+ tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1,
+ GFP_KERNEL_ACCOUNT);
if (!tb)
return -ENOMEM;
@@ -150,14 +151,15 @@ static int cttimeout_new_timeout(struct sk_buff *skb,
goto err_proto_put;
}
- timeout = kzalloc(sizeof(*timeout), GFP_KERNEL);
+ timeout = kzalloc(sizeof(*timeout), GFP_KERNEL_ACCOUNT);
if (timeout == NULL) {
ret = -ENOMEM;
goto err_proto_put;
}
timeout->timeout = kzalloc(sizeof(*timeout->timeout) +
- l4proto->ctnl_timeout.obj_size, GFP_KERNEL);
+ l4proto->ctnl_timeout.obj_size,
+ GFP_KERNEL_ACCOUNT);
if (!timeout->timeout) {
ret = -ENOMEM;
goto err;
diff --git a/net/netfilter/nfnetlink_osf.c b/net/netfilter/nfnetlink_osf.c
index 92002079f8ea..e4835b0f4bb1 100644
--- a/net/netfilter/nfnetlink_osf.c
+++ b/net/netfilter/nfnetlink_osf.c
@@ -325,7 +325,7 @@ static int nfnl_osf_add_callback(struct sk_buff *skb,
!memchr(f->version, 0, MAXGENRELEN))
return -EINVAL;
- kf = kmalloc_obj(struct nf_osf_finger);
+ kf = kmalloc_obj(struct nf_osf_finger, GFP_KERNEL_ACCOUNT);
if (!kf)
return -ENOMEM;
--
2.47.3
next prev parent reply other threads:[~2026-09-07 18:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 18:55 [PATCH nf-next,v3 1/8] netfilter: x_tables: use GFP_KERNEL_ACCOUNT in match/target Pablo Neira Ayuso
2026-09-07 18:55 ` Pablo Neira Ayuso [this message]
2026-09-07 18:55 ` [PATCH nf-next,v3 3/8] netfilter: nf_tables: use GFP_KERNEL_ACCOUNT Pablo Neira Ayuso
2026-09-07 18:55 ` [PATCH nf-next,v3 4/8] netfilter: synproxy: " Pablo Neira Ayuso
2026-09-07 18:55 ` [PATCH nf-next,v3 5/8] netfilter: sysctl: " Pablo Neira Ayuso
2026-09-07 18:55 ` [PATCH nf-next,v3 6/8] netfilter: nat: " Pablo Neira Ayuso
2026-09-07 18:55 ` [PATCH nf-next,v3 7/8] netfilter: conncount: " Pablo Neira Ayuso
2026-09-07 18:55 ` [PATCH nf-next,v3 8/8] netfilter: ipset: " Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260907185552.1422008-2-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.