[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OF9196A33D.75E1F25E-ON652577D1.0057D889-652577D1.00592104@in.ibm.com>
Date: Thu, 4 Nov 2010 21:47:04 +0530
From: Krishna Kumar2 <krkumar2@...ibm.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
Rusty Russell <rusty@...tcorp.com.au>, yvugenfi@...hat.com
Subject: Re: [PATCH] virtio_net: Fix queue full check
"Michael S. Tsirkin" <mst@...hat.com> wrote on 11/04/2010 05:54:24 PM:
> > Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
>
> I thought about this some more. I think the original
> code is actually correct in returning ENOSPC: indirect
> buffers are nice, but it's a mistake
> to rely on them as a memory allocation might fail.
>
> And if you look at virtio-net, it is dropping packets
> under memory pressure which is not really a happy outcome:
> the packet will get freed, reallocated and we get another one,
> adding pressure on the allocator instead of releasing it
> until we free up some buffers.
>
> So I now think we should calculate the capacity
> assuming non-indirect entries, and if we manage to
> use indirect, all the better.
>
> So below is what I propose now - as a replacement for
> my original patch. Krishna Kumar, Rusty, what do you think?
>
> Separately I'm also considering moving the
> if (vq->num_free < out + in)
> check earlier in the function to keep all users honest,
> but need to check what the implications are for e.g. block.
> Thoughts on this?
This looks like the right thing to do. Besides this, I
think virtio-net still needs to remove check for ENOMEM?
I will test this patch tomorrow.
Another question about add_recvbuf_small and
add_recvbuf_big - both call virtqueue_add_buf_gfp with
in+out > 1, and that can fail with -ENOSPC. So try_fill_recv
gets -ENOSPC. When that happens, oom is not set to true,
I thought it should have got set. Is this a bug?
Thanks,
- KK
--
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