Re: [PATCH 2/2] mt76: dma: add rx buffer recycle support
On Wed, Dec 05, 2018 at 04:17:31PM +0100, Lorenzo Bianconi wrote: > > On Wed, Dec 05, 2018 at 11:37:33AM +0100, Lorenzo Bianconi wrote: > > > > > > > > Add support for recycling rx buffers if they are not forwarded > > > > to network stack instead of reallocate them from scratch > > > > > > > > Signed-off-by: Lorenzo Bianconi > > > > --- > > > > > > Felix, > > > > > > could you please drop this patch since it does not help to reduce pressure > > > on page_frag_cache. > > > > What is the problem ? Maybe using kmalloc() instead of page_frag_alloc() > > could help (kmalloc has standard kmem_cache for 2048 bytes object) ? > > Hi Stanislaw, > > I think the only difference in using a recycle buffer with page_frag_cache is > we are a little bit less greedy in consuming the compound page since in case > of > error we will reuse the previously allocated fragment. However we will need to > reallocate a new compound page if we have a leftover fragment that 'locks' > the previous compound (we have the same issue if we do not use the recycle > buffer). Does this 'little' improvement worth a more complex code? > Do you agree or is there something I am missing here? I was not asking about the patch. I agree it should be droped. I was asking what is the problem with "pressure on page_frag_cache" and if using kmalloc() instead of page_frag_alloc() whould be potential solution. Regards Stanislaw
Re: [PATCH 2/2] mt76: dma: add rx buffer recycle support
> On Wed, Dec 05, 2018 at 11:37:33AM +0100, Lorenzo Bianconi wrote: > > > > > > Add support for recycling rx buffers if they are not forwarded > > > to network stack instead of reallocate them from scratch > > > > > > Signed-off-by: Lorenzo Bianconi > > > --- > > > > Felix, > > > > could you please drop this patch since it does not help to reduce pressure > > on page_frag_cache. > > What is the problem ? Maybe using kmalloc() instead of page_frag_alloc() > could help (kmalloc has standard kmem_cache for 2048 bytes object) ? Hi Stanislaw, I think the only difference in using a recycle buffer with page_frag_cache is we are a little bit less greedy in consuming the compound page since in case of error we will reuse the previously allocated fragment. However we will need to reallocate a new compound page if we have a leftover fragment that 'locks' the previous compound (we have the same issue if we do not use the recycle buffer). Does this 'little' improvement worth a more complex code? Do you agree or is there something I am missing here? Regards, Lorenzo > > Thanks > Stanislaw
Re: [PATCH 2/2] mt76: dma: add rx buffer recycle support
On Wed, Dec 05, 2018 at 11:37:33AM +0100, Lorenzo Bianconi wrote: > > > > Add support for recycling rx buffers if they are not forwarded > > to network stack instead of reallocate them from scratch > > > > Signed-off-by: Lorenzo Bianconi > > --- > > Felix, > > could you please drop this patch since it does not help to reduce pressure > on page_frag_cache. What is the problem ? Maybe using kmalloc() instead of page_frag_alloc() could help (kmalloc has standard kmem_cache for 2048 bytes object) ? Thanks Stanislaw
Re: [PATCH 2/2] mt76: dma: add rx buffer recycle support
> > Add support for recycling rx buffers if they are not forwarded > to network stack instead of reallocate them from scratch > > Signed-off-by: Lorenzo Bianconi > --- Felix, could you please drop this patch since it does not help to reduce pressure on page_frag_cache. Regards, Lorenzo