Re: [PATCH 1/1] IB/rxe: use kvmalloc instead of kmalloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2018/11/30 8:09, Jason Gunthorpe wrote:
On Sun, Nov 18, 2018 at 08:21:24AM -0500, Zhu Yanjun wrote:

diff --git a/drivers/infiniband/sw/rxe/rxe_queue.c b/drivers/infiniband/sw/rxe/rxe_queue.c
index f84ab4469261..e811a655b286 100644
+++ b/drivers/infiniband/sw/rxe/rxe_queue.c
@@ -91,7 +91,7 @@ struct rxe_queue *rxe_queue_init(struct rxe_dev *rxe,
  	if (*num_elem < 0)
  		goto err1;
- q = kmalloc(sizeof(*q), GFP_KERNEL);
+	q = kvmalloc(sizeof(*q), GFP_KERNEL);
sizeof(*q) looks like it is about 64 bytes

It makes no sense to use kvmalloc unless the allocation size is >
PAGE_SIZE

Sure. Thanks

       /*
         * It doesn't really make sense to fallback to vmalloc for sub page
         * requests
         */
        if (ret || size <= PAGE_SIZE)
                return ret;

Zhu Yanjun


Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux