Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-10-08 Thread Leon Romanovsky
On Fri, Sep 25, 2015 at 08:51:22AM +0800, Wengang Wang wrote: > Hi Or, > > 在 2015年09月24日 19:57, Or Gerlitz 写道: > >On Thu, Sep 24, 2015 at 1:49 PM, Wengang Wang > >wrote: > >>@@ -786,8 +787,14 @@ static int create_qp_common(struct mlx4_ib_dev *dev, > >>struct ib_pd

Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-10-08 Thread Leon Romanovsky
On Thu, Oct 8, 2015 at 9:14 AM, Or Gerlitz wrote: > On 10/8/2015 9:06 AM, Leon Romanovsky wrote: >> >> Additionally, I want to spot Or's attention on the following discussion >> in MM-subsystem about kmalloc/vmalloc and general function to fallback >> from one to another.

Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-10-08 Thread Or Gerlitz
On 10/8/2015 9:06 AM, Leon Romanovsky wrote: Additionally, I want to spot Or's attention on the following discussion in MM-subsystem about kmalloc/vmalloc and general function to fallback from one to another. too busy to read them now, if you have review comments speak now and provide them

Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-10-07 Thread Or Gerlitz
On 9/24/2015 1:49 PM, Wengang Wang wrote: @@ -1050,8 +1057,9 @@ static void destroy_qp_common(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp, >db); ib_umem_release(qp->umem); } else { - kfree(qp->sq.wrid); -

[PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-09-24 Thread Wengang Wang
There are several hits that WR buffer allocation(kmalloc) failed. It failed at order 3 and/or 4 contigous pages allocation. At the same time there are actually 100MB+ free memory but well fragmented. So try vmalloc when kmalloc failed. Signed-off-by: Wengang Wang ---

Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-09-24 Thread Wengang Wang
在 2015年09月24日 16:07, Or Gerlitz 写道: On 9/24/2015 9:52 AM, Wengang Wang wrote: } else { -kfree(qp->sq.wrid); -kfree(qp->rq.wrid); +if (is_vmalloc_addr(qp->sq.wrid)) +vfree(qp->sq.wrid); +else +kfree(qp->sq.wrid); + +if

Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-09-24 Thread Or Gerlitz
On Thu, Sep 24, 2015 at 1:49 PM, Wengang Wang wrote: > @@ -786,8 +787,14 @@ static int create_qp_common(struct mlx4_ib_dev *dev, > struct ib_pd *pd, > if (err) > goto err_mtt; > > - qp->sq.wrid =

[PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-09-24 Thread Wengang Wang
There are several hits that WR buffer allocation(kmalloc) failed. It failed at order 3 and/or 4 contigous pages allocation. At the same time there are actually 100MB+ free memory but well fragmented. So try vmalloc when kmalloc failed. Signed-off-by: Wengang Wang ---

Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-09-24 Thread Or Gerlitz
On 9/24/2015 9:52 AM, Wengang Wang wrote: } else { - kfree(qp->sq.wrid); - kfree(qp->rq.wrid); + if (is_vmalloc_addr(qp->sq.wrid)) + vfree(qp->sq.wrid); + else + kfree(qp->sq.wrid); + +

Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed

2015-09-24 Thread Wengang Wang
Hi Or, 在 2015年09月24日 19:57, Or Gerlitz 写道: On Thu, Sep 24, 2015 at 1:49 PM, Wengang Wang wrote: @@ -786,8 +787,14 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd, if (err) goto err_mtt; -