Prev: mm,migration: Avoid race between shift_arg_pages() and rmap_walk() during migration by not migrating temporary stacks
Next: r8169 INFO: inconsistent lock state
From: Michael S. Tsirkin on 30 Apr 2010 14:30 virtio-net bounces buffer allocations off to a thread if it can't allocate buffers from the atomic pool. However, if posting buffers still requires atomic buffers, this is unlikely to succeed. Fix by passing in the proper gfp_t parameter. Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com> --- drivers/net/virtio_net.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 91738d8..fca44b2 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -339,7 +339,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp) skb_to_sgvec(skb, sg + 1, 0, skb->len); - err = virtqueue_add_buf(vi->rvq, sg, 0, 2, skb); + err = virtqueue_add_buf_gfp(vi->rvq, sg, 0, 2, skb, gfp); if (err < 0) dev_kfree_skb(skb); @@ -386,8 +386,8 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp) /* chain first in list head */ first->private = (unsigned long)list; - err = virtqueue_add_buf(vi->rvq, sg, 0, MAX_SKB_FRAGS + 2, - first); + err = virtqueue_add_buf_gfp(vi->rvq, sg, 0, MAX_SKB_FRAGS + 2, + first, gfp); if (err < 0) give_pages(vi, first); @@ -406,7 +406,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp) sg_init_one(&sg, page_address(page), PAGE_SIZE); - err = virtqueue_add_buf(vi->rvq, &sg, 0, 1, page); + err = virtqueue_add_buf_gfp(vi->rvq, &sg, 0, 1, page, gfp); if (err < 0) give_pages(vi, page); -- 1.7.1.rc1.22.g3163 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |