On Wed, 2014-01-08 at 19:21 +0200, Michael S. Tsirkin wrote:
> Basically yes, we could start dropping packets immediately
> once GFP_ATOMIC allocations fail and repost the buffer to host,
> and hope memory is available by the time we get the next interrupt.
> But we wanted host to have visibility into the fact that
> we are out of memory and packets are dropped, so we did not want to
> repost.
bufferbloat alert :)
> If we don't repost how do we know memory is finally available?
> We went for a timer based workqueue thing.
> What do you suggest?
In normal networking land, when a host A sends frames to host B,
nothing prevents A to pause the traffic to B if B is dropping packets
under stress.
A physical NIC do not use a workqueue to refill its RX queue but uses
the following strategy :
0) Pre filling of RX ring buffer with N frames. This can use GFP_KERNEL
allocations with all needed (sleep/retry/shout) logic...
1) IRQ is handled.
2) Can we allocate a new buffer (GFP_ATOMIC) ?
If yes, we accept the frame,
and post the new buffer for the 'next frame'
If no, we drop the frame and recycle the memory for next round.
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization