Re: [PATCH rdma-next] RDMA/mlx5: Decrease stack usage in mlx5_ib_create_cq()

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

 



On Tue, Aug 28, 2018 at 02:12:44PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> 
> Change on stack allocation to be dynamically allocated structure to fix
> the following compilation warning.
> 
> drivers/infiniband/hw/mlx5/cq.c: In function _mlx5_ib_create_cq_:
> drivers/infiniband/hw/mlx5/cq.c:1091:1: warning: the frame size of 1064
> bytes is larger than 1024 bytes [-Wframe-larger-than=]
>  }
>  ^
> 
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
>  drivers/infiniband/hw/mlx5/cq.c | 49 ++++++++++++++++++++++++-----------------
>  1 file changed, 29 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
> index 088205d7f1a1..ada77c9e4b6b 100644
> +++ b/drivers/infiniband/hw/mlx5/cq.c
> @@ -778,7 +778,7 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
>  			  int entries, u32 **cqb,
>  			  int *cqe_size, int *index, int *inlen)
>  {
> -	struct mlx5_ib_create_cq ucmd = {};
> +	struct mlx5_ib_create_cq *ucmd;

This is a 24 byte structure, it seems silly to allocate that alone on
the heap. 

How did the stack frame get to 1064 bytes big? I can't get anywhere
near that by eyeballing the stack usage in create_cq_user and
mlx5_ib_create_cq..

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