netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem in pfmemalloc skb handling in net/core/dev.c
@ 2021-04-08 18:52 Xie He
  2021-04-09  7:30 ` Mel Gorman
  0 siblings, 1 reply; 12+ messages in thread
From: Xie He @ 2021-04-08 18:52 UTC (permalink / raw)
  To: Mel Gorman, Mel Gorman, jslaby, Neil Brown, Peter Zijlstra,
	Mike Christie, Eric B Munson, Eric Dumazet,
	Sebastian Andrzej Siewior, Christoph Lameter, Andrew Morton,
	David S. Miller, Jakub Kicinski, Linux Kernel Network Developers,
	LKML

Hi Mel Gorman,

I may have found a problem in pfmemalloc skb handling in
net/core/dev.c. I see there are "if" conditions checking for
"sk_memalloc_socks() && skb_pfmemalloc(skb)", and when the condition
is true, the skb is handled specially as a pfmemalloc skb, otherwise
it is handled as a normal skb.

However, if "sk_memalloc_socks()" is false and "skb_pfmemalloc(skb)"
is true, the skb is still handled as a normal skb. Is this correct?
This might happen if "sk_memalloc_socks()" was originally true and has
just turned into false before the check. Can this happen?

I found the original commit that added the "if" conditions:
commit b4b9e3558508 ("netvm: set PF_MEMALLOC as appropriate during SKB
processing")
The commit message clearly indicates pfmemalloc skbs shouldn't be
delivered to taps (or protocols that don't support pfmemalloc skbs).
However, if they are incorrectly handled as normal skbs, they could be
delivered to those places.

I'm not sure if my understanding is correct. Could you please help? Thank you!

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-04-12 20:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 18:52 Problem in pfmemalloc skb handling in net/core/dev.c Xie He
2021-04-09  7:30 ` Mel Gorman
2021-04-09  8:33   ` Xie He
2021-04-09  8:44     ` Mel Gorman
2021-04-09  9:14       ` Xie He
2021-04-09  9:58         ` Mel Gorman
2021-04-09 10:08           ` Xie He
2021-04-09 10:04         ` Eric Dumazet
2021-04-09 10:14           ` Xie He
2021-04-09 11:50             ` Eric Dumazet
2021-04-09 19:12               ` Xie He
2021-04-12 20:40                 ` Xie He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).