On Thu, 2016-04-07 at 16:17 +0200, Jesper Dangaard Brouer wrote: > (Topic proposal for MM-summit) > > Network Interface Cards (NIC) drivers, and increasing speeds stress > the page-allocator (and DMA APIs). A number of driver specific > open-coded approaches exists that work-around these bottlenecks in the > page allocator and DMA APIs. E.g. open-coded recycle mechanisms, and > allocating larger pages and handing-out page "fragments". > > I'm proposing a generic page-pool recycle facility, that can cover the > driver use-cases, increase performance and open up for zero-copy RX. > > > The basic performance problem is that pages (containing packets at RX) > are cycled through the page allocator (freed at TX DMA completion > time). While a system in a steady state, could avoid calling the page > allocator, when having a pool of pages equal to the size of the RX > ring plus the number of outstanding frames in the TX ring (waiting for > DMA completion). We certainly used this at Google for quite a while. The thing is : in steady state, the number of pages being 'in tx queues' is lower than number of pages that were allocated for RX queues. The page allocator is hardly hit, once you have big enough RX ring buffers. (Nothing fancy, simply the default number of slots) The 'hard coded´ code is quite small actually if (page_count(page) != 1) { free the page and allocate another one, since we are not the exclusive owner. Prefer __GFP_COLD pages btw. } page_ref_inc(page); Problem of a 'pool' is that it matches a router workload, not host one. With existing code, new pages are automatically allocated on demand, if say previous pages are still used by skb stored in sockets receive queues and consumers are slow to react to the presence of this data. But in most cases (steady state), the refcount on the page is released by the application reading the data before the driver cycled through the RX ring buffer and drivers only increments the page count. I also played with grouping pages into the same 2MB pages, but got mixed results. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>