On 3/10/25 11:18, Alexei Starovoitov wrote: >> because this will affect the refill even if consume_stock() fails not due to >> a trylock failure (which should not be happening), but also just because the >> stock was of a wrong memcg or depleted. So in the nowait context we deny the >> refill even if we have the memory. Attached patch could be used to see if it >> if fixes things. I'm not sure about the testcases where it doesn't look like >> nowait context would be used though, let's see. > > Not quite. > GFP_NOWAIT includes __GFP_KSWAPD_RECLAIM, > so gfpflags_allow_spinning() will return true. Uh right, it's the new gfpflags_allow_spinning(), not the gfpflags_allow_blocking() I'm used to and implicitly assumed, sorry. But then it's very simple because it has a bug: gfpflags_allow_spinning() does return !(gfp_flags & __GFP_RECLAIM); should be !!