aboutsummaryrefslogtreecommitdiff
path: root/net/unix
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2023-03-07 14:59:59 +0000
committerDavid S. Miller <[email protected]>2023-03-08 13:21:47 +0000
commit10369080454d87ee5b2db211ce947cb3118f0e13 (patch)
tree0fc9e0f971170f352455c006a6e0fbbe3d22db18 /net/unix
parentb3f4cd07dfb467a2ecaf7f5350333a45a23de551 (diff)
net: reclaim skb->scm_io_uring bit
Commit 0091bfc81741 ("io_uring/af_unix: defer registered files gc to io_uring release") added one bit to struct sk_buff. This structure is critical for networking, and we try very hard to not add bloat on it, unless absolutely required. For instance, we can use a specific destructor as a wrapper around unix_destruct_scm(), to identify skbs that unix_gc() has to special case. Signed-off-by: Eric Dumazet <[email protected]> Cc: Pavel Begunkov <[email protected]> Cc: Thadeu Lima de Souza Cascardo <[email protected]> Cc: Jens Axboe <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/garbage.c2
-rw-r--r--net/unix/scm.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index dc2763540393..2405f0f9af31 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -305,7 +305,7 @@ void unix_gc(void)
* release.path eventually putting registered files.
*/
skb_queue_walk_safe(&hitlist, skb, next_skb) {
- if (skb->scm_io_uring) {
+ if (skb->destructor == io_uring_destruct_scm) {
__skb_unlink(skb, &hitlist);
skb_queue_tail(&skb->sk->sk_receive_queue, skb);
}
diff --git a/net/unix/scm.c b/net/unix/scm.c
index aa27a02478dc..f9152881d77f 100644
--- a/net/unix/scm.c
+++ b/net/unix/scm.c
@@ -152,3 +152,9 @@ void unix_destruct_scm(struct sk_buff *skb)
sock_wfree(skb);
}
EXPORT_SYMBOL(unix_destruct_scm);
+
+void io_uring_destruct_scm(struct sk_buff *skb)
+{
+ unix_destruct_scm(skb);
+}
+EXPORT_SYMBOL(io_uring_destruct_scm);