[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1389204587.26646.111.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Wed, 08 Jan 2014 10:09:47 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Michael Dalton <mwdalton@...gle.com>,
Jason Wang <jasowang@...hat.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Eric Dumazet <edumazet@...gle.com>,
Rusty Russell <rusty@...tcorp.com.au>,
lf-virt <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH net-next 2/3] virtio-net: use per-receive queue page
frag alloc for mergeable bufs
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists