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>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260302181432.1836150-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* 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;
};
struct rps_sock_flow_table *orig_sock_table, *sock_table;
static DEFINE_MUTEX(sock_flow_mutex);
+ void *tofree = NULL;
mutex_lock(&sock_flow_mutex);
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 */