Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <edumazet@google.com>
Cc: Pavel Begunkov <asml.silence@gmail.com>
Cc: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Cc: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
10369080 b3f4cd07

+9 -5
-2
include/linux/skbuff.h
··· 810 810 * @csum_level: indicates the number of consecutive checksums found in 811 811 * the packet minus one that have been verified as 812 812 * CHECKSUM_UNNECESSARY (max 3) 813 - * @scm_io_uring: SKB holds io_uring registered files 814 813 * @dst_pending_confirm: need to confirm neighbour 815 814 * @decrypted: Decrypted SKB 816 815 * @slow_gro: state present at GRO time, slower prepare step required ··· 988 989 #endif 989 990 __u8 slow_gro:1; 990 991 __u8 csum_not_inet:1; 991 - __u8 scm_io_uring:1; 992 992 993 993 #ifdef CONFIG_NET_SCHED 994 994 __u16 tc_index; /* traffic control index */
+1
include/net/af_unix.h
··· 11 11 void unix_inflight(struct user_struct *user, struct file *fp); 12 12 void unix_notinflight(struct user_struct *user, struct file *fp); 13 13 void unix_destruct_scm(struct sk_buff *skb); 14 + void io_uring_destruct_scm(struct sk_buff *skb); 14 15 void unix_gc(void); 15 16 void wait_for_unix_gc(void); 16 17 struct sock *unix_get_socket(struct file *filp);
+1 -2
io_uring/rsrc.c
··· 867 867 868 868 UNIXCB(skb).fp = fpl; 869 869 skb->sk = sk; 870 - skb->scm_io_uring = 1; 871 - skb->destructor = unix_destruct_scm; 870 + skb->destructor = io_uring_destruct_scm; 872 871 refcount_add(skb->truesize, &sk->sk_wmem_alloc); 873 872 } 874 873
+1 -1
net/unix/garbage.c
··· 305 305 * release.path eventually putting registered files. 306 306 */ 307 307 skb_queue_walk_safe(&hitlist, skb, next_skb) { 308 - if (skb->scm_io_uring) { 308 + if (skb->destructor == io_uring_destruct_scm) { 309 309 __skb_unlink(skb, &hitlist); 310 310 skb_queue_tail(&skb->sk->sk_receive_queue, skb); 311 311 }
+6
net/unix/scm.c
··· 152 152 sock_wfree(skb); 153 153 } 154 154 EXPORT_SYMBOL(unix_destruct_scm); 155 + 156 + void io_uring_destruct_scm(struct sk_buff *skb) 157 + { 158 + unix_destruct_scm(skb); 159 + } 160 + EXPORT_SYMBOL(io_uring_destruct_scm);