On Wed, 13 Jan 2021 18:15:20 +0100 Eric Dumazet wrote: > > IDK much about MM, but we already have a kmem_cache for skbs and now > > we're building a cache on top of a cache. Shouldn't MM take care of > > providing a per-CPU BH-only lockless cache? > > I think part of the improvement comes from bulk operations, which are > provided by mm layer. > > I also note Alexander made no provision for NUMA awareness. > Probably reusing skb located on a remote node will not be ideal.
I was wondering about that yesterday, but couldn't really think of a legitimate reason not to have XPS set up right. Do you have particular config in mind, or are we taking "default config"? Also can't the skb _itself_ be pfmemalloc? My main point is that I'm wondering if this sort of cache would be useful when allocating skbs for sockets? Assuming that the network stack is not isolated to its own cores, won't fronting alloc_skb() with bh_disable() try the cache bh_enable() potentially help? In that sense fronting kmem_cache would feel cleaner than our own little ring buffer.