From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
netdev@vger.kernel.org, eric.dumazet@gmail.com,
Eric Dumazet <edumazet@google.com>
Subject: [PATCH v3 net-next 2/7] net-sysfs: remove rcu field from 'struct rps_sock_flow_table'
Date: Mon, 2 Mar 2026 18:14:27 +0000 [thread overview]
Message-ID: <20260302181432.1836150-3-edumazet@google.com> (raw)
In-Reply-To: <20260302181432.1836150-1-edumazet@google.com>
Removing rcu_head (and @mask in a following patch)
will allow a power-of-two allocation and thus high-order
allocation for better performance.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/rps.h | 1 -
net/core/sysctl_net_core.c | 4 +++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/net/rps.h b/include/net/rps.h
index f1794cd2e7fb32a36bde9959fab651663ab190fd..32cfa250d9f931b8ab1c94e0410d0820bb9c999f 100644
--- a/include/net/rps.h
+++ b/include/net/rps.h
@@ -60,7 +60,6 @@ struct rps_dev_flow_table {
* meaning we use 32-6=26 bits for the hash.
*/
struct rps_sock_flow_table {
- struct rcu_head rcu;
u32 mask;
u32 ents[] ____cacheline_aligned_in_smp;
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 03aea10073f003b0339884ee0f40b8c96d7d22e2..0b659c932cffef45e05207890b8187d64ae3c85a 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -147,6 +147,7 @@ static int rps_sock_flow_sysctl(const struct ctl_table *table, int write,
};
struct rps_sock_flow_table *orig_sock_table, *sock_table;
static DEFINE_MUTEX(sock_flow_mutex);
+ void *tofree = NULL;
mutex_lock(&sock_flow_mutex);
@@ -193,13 +194,14 @@ static int rps_sock_flow_sysctl(const struct ctl_table *table, int write,
if (orig_sock_table) {
static_branch_dec(&rps_needed);
static_branch_dec(&rfs_needed);
- kvfree_rcu(orig_sock_table, rcu);
+ tofree = orig_sock_table;
}
}
}
mutex_unlock(&sock_flow_mutex);
+ kvfree_rcu_mightsleep(tofree);
return ret;
}
#endif /* CONFIG_RPS */
--
2.53.0.473.g4a7958ca14-goog
next prev parent reply other threads:[~2026-03-02 18:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 18:14 [PATCH v3 net-next 0/7] rfs: use high-order allocations for hash tables Eric Dumazet
2026-03-02 18:14 ` [PATCH v3 net-next 1/7] net: add rps_tag_ptr type and helpers Eric Dumazet
2026-03-03 19:47 ` Kuniyuki Iwashima
2026-03-02 18:14 ` Eric Dumazet [this message]
2026-03-03 19:24 ` [PATCH v3 net-next 2/7] net-sysfs: remove rcu field from 'struct rps_sock_flow_table' Kuniyuki Iwashima
2026-03-02 18:14 ` [PATCH v3 net-next 3/7] net-sysfs: add rps_sock_flow_table_mask() helper Eric Dumazet
2026-03-03 19:28 ` Kuniyuki Iwashima
2026-03-02 18:14 ` [PATCH v3 net-next 4/7] net-sysfs: use rps_tag_ptr and remove metadata from rps_sock_flow_table Eric Dumazet
2026-03-03 19:46 ` Kuniyuki Iwashima
2026-03-02 18:14 ` [PATCH v3 net-next 5/7] net-sysfs: get rid of rps_dev_flow_lock Eric Dumazet
2026-03-03 19:48 ` Kuniyuki Iwashima
2026-03-02 18:14 ` [PATCH v3 net-next 6/7] net-sysfs: remove rcu field from 'struct rps_dev_flow_table' Eric Dumazet
2026-03-03 19:49 ` Kuniyuki Iwashima
2026-03-02 18:14 ` [PATCH v3 net-next 7/7] net-sysfs: use rps_tag_ptr and remove metadata from rps_dev_flow_table Eric Dumazet
2026-03-03 20:06 ` Kuniyuki Iwashima
2026-03-05 1:00 ` [PATCH v3 net-next 0/7] rfs: use high-order allocations for hash tables patchwork-bot+netdevbpf
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=20260302181432.1836150-3-edumazet@google.com \
--to=edumazet@google.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox