On Mon, Oct 10, 2022 at 07:55:29AM -0700, Christoph Hellwig wrote: > On Mon, Oct 10, 2022 at 01:41:57PM +0200, Guillaume Nault wrote: > > However, ->sk_allocation isn't used just by the memory allocator. > > In particular, sk_page_frag() uses it to figure out if it can return > > the page_frag from current or if it has to use the socket one. > > Well, that just means sk_page_frag really needs to look at > PF_MEMALLOC_* as well. So instead of reverting the proper change > please fix that. A helper that looks at sk_allocation and > current->flags is probably the right way to deal with that. That's what my RFC patch did. It was rejected because reading current->flags may incur a cache miss thus slowing down TCP fast path. See the discussion in the Link tag: https://lore.kernel.org/netdev/b4d8cb09c913d3e34f853736f3f5628abfd7f4b6.1656699567.git.gnault@xxxxxxxxxx/