[RHEL7,COMMIT] ib/srpt: use vmalloc to allocate ring pointers

Submitted by Konstantin Khorenko on July 5, 2018, 8:19 a.m.

Details

Message ID 201807050819.w658JAYm011806@finist_ce7.work
State New
Series "ib/srpt: use vmalloc to allocate ring pointers"
Headers show

Commit Message

Konstantin Khorenko July 5, 2018, 8:19 a.m.
The commit is pushed to "branch-rh7-3.10.0-862.3.2.vz7.61.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.3.2.vz7.61.13
------>
commit 479860d71d2ed5159e5fd81e0ef20b11985a50a3
Author: Jan Dakinevich <jan.dakinevich@virtuozzo.com>
Date:   Thu Jul 5 11:19:09 2018 +0300

    ib/srpt: use vmalloc to allocate ring pointers
    
    An array of pointers to SRPT contexts in ib_device is over 30KiB even in
    default case, in an amount of contexts is 4095. The patch is intended to
    weed out large contigous allocation for non-DMA memory.
    
    https://jira.sw.ru/browse/HCI-100
    
    Signed-off-by: Jan Dakinevich <jan.dakinevich@virtuozzo.com>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index dcd810c5be91..5bc8d57256e2 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -648,7 +648,7 @@  static struct srpt_ioctx **srpt_alloc_ioctx_ring(struct srpt_device *sdev,
 	WARN_ON(ioctx_size != sizeof(struct srpt_recv_ioctx)
 		&& ioctx_size != sizeof(struct srpt_send_ioctx));
 
-	ring = kmalloc(ring_size * sizeof(ring[0]), GFP_KERNEL);
+	ring = vmalloc(ring_size * sizeof(ring[0]));
 	if (!ring)
 		goto out;
 	for (i = 0; i < ring_size; ++i) {
@@ -679,7 +679,7 @@  static void srpt_free_ioctx_ring(struct srpt_ioctx **ioctx_ring,
 
 	for (i = 0; i < ring_size; ++i)
 		srpt_free_ioctx(sdev, ioctx_ring[i], dma_size, dir);
-	kfree(ioctx_ring);
+	vfree(ioctx_ring);
 }
 
 /**