Re: [PATCH net-next v6 2/3] udp: implement memory accounting helpers

2016-10-21 Thread Eric Dumazet
On Fri, 2016-10-21 at 13:55 +0200, Paolo Abeni wrote: > Avoid using the generic helpers. > Use the receive queue spin lock to protect the memory > accounting operation, both on enqueue and on dequeue. > > On dequeue perform partial memory reclaiming, trying to > leave a quantum of forward allocate

Re: [PATCH net-next v6 2/3] udp: implement memory accounting helpers

2016-10-21 Thread Eric Dumazet
On Fri, 2016-10-21 at 15:34 +0200, Paolo Abeni wrote: > Updating sk_rmem_alloc would still need an atomic operation, > because it is touched also by the error queue path: we will end up > adding an atomic operation (or two, when reclaiming the fwd allocated > memory) inside the critical section. T

Re: [PATCH net-next v6 2/3] udp: implement memory accounting helpers

2016-10-21 Thread Paolo Abeni
On Fri, 2016-10-21 at 05:24 -0700, Eric Dumazet wrote: > On Fri, 2016-10-21 at 13:55 +0200, Paolo Abeni wrote: > > Avoid using the generic helpers. > > Use the receive queue spin lock to protect the memory > > accounting operation, both on enqueue and on dequeue. > > > > On dequeue perform partial

Re: [PATCH net-next v6 2/3] udp: implement memory accounting helpers

2016-10-21 Thread Eric Dumazet
On Fri, 2016-10-21 at 13:55 +0200, Paolo Abeni wrote: > Avoid using the generic helpers. > Use the receive queue spin lock to protect the memory > accounting operation, both on enqueue and on dequeue. > > On dequeue perform partial memory reclaiming, trying to > leave a quantum of forward allocate

[PATCH net-next v6 2/3] udp: implement memory accounting helpers

2016-10-21 Thread Paolo Abeni
Avoid using the generic helpers. Use the receive queue spin lock to protect the memory accounting operation, both on enqueue and on dequeue. On dequeue perform partial memory reclaiming, trying to leave a quantum of forward allocated memory. On enqueue use a custom helper, to allow some optimizat