Re: Stacks leading into skb:kfree_skb

From
Jakub Kicinski <kuba@kernel.org>
Date
2023-07-18 22:36:33
Reply to
David Ahern, 2023-07-15
On Fri, 14 Jul 2023 18:54:14 -0600 David Ahern wrote:
quoted
I made some aggregations for the stacks we see leading into
skb:kfree_skb endpoint. There's a lot of data that is not easily
digestible, so I lightly massaged the data and added flamegraphs in
addition to raw stack counts. Here's the gist link:

* https://gist.github.com/bobrik/0e57671c732d9b13ac49fed85a2b2290  
I see a lot of packet_rcv as the tip before kfree_skb. How many packet
sockets do you have running on that box? Can you accumulate the total
packet_rcv -> kfree_skb_reasons into 1 count -- regardless of remaining
stacktrace?
On a quick look we have 3 branches which can get us to kfree_skb from
packet_rcv:

	if (skb->pkt_type == PACKET_LOOPBACK)
		goto drop;
...
	if (!net_eq(dev_net(dev), sock_net(sk)))
		goto drop;
...
	res = run_filter(skb, sk, snaplen);
	if (!res)
		goto drop_n_restore;

I'd guess is the last one? Which we should mark with the SOCKET_FILTER
drop reason? 
Thread (9 messages) 9 messages, 6 authors, last reply 2023-07-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help