> > If I read it correctly, the last retry with GFP_ATOMIC is not because of the > > earlier GFP_USER allocation failure but the size of the bucket has changed a lot > > that it is doing one final attempt to get the whole bucket and this requires to > > hold the bucket lock to ensure the size stays the same which then must use > > GFP_ATOMIC. > > Ah exactly, when allocation fails, it always returned an error. > > Sorry, I should've read code first. I was about to type out a response, but Martin beat me to it :). Yep, GFP_ATOMIC is a necessary side-effect of holding onto the lock to make sure the bucket doesn't grow anymore. It's a last resort to make sure the batch size is big enough to grab a full bucket snapshot not a last resort to allocate memory. -Jordan