From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH 1/2] IB/mlx4: Suppress memory allocations warnings in kmalloc->__vmalloc flows
Date: Thu, 24 Dec 2015 00:22:23 -0500 [thread overview]
Message-ID: <567B810F.2090702@redhat.com> (raw)
In-Reply-To: <1450337513-22609-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2369 bytes --]
On 12/17/2015 02:31 AM, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Failure in kmalloc memory allocations will throw a warning about it.
> Such warnings are not needed anymore, since in commit 0ef2f05c7e02
> ("IB/mlx4: Use vmalloc for WR buffers when needed"), fallback mechanism
> from kmalloc() to __vmalloc() was added.
>
> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Reviewed-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> drivers/infiniband/hw/mlx4/qp.c | 6 ++++--
> drivers/infiniband/hw/mlx4/srq.c | 3 ++-
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
> index 13eaaf45288f..dc86975fe1a9 100644
> --- a/drivers/infiniband/hw/mlx4/qp.c
> +++ b/drivers/infiniband/hw/mlx4/qp.c
> @@ -796,11 +796,13 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
> if (err)
> goto err_mtt;
>
> - qp->sq.wrid = kmalloc(qp->sq.wqe_cnt * sizeof(u64), gfp);
> + qp->sq.wrid = kmalloc(qp->sq.wqe_cnt * sizeof(u64),
> + gfp | __GFP_NOWARN);
> if (!qp->sq.wrid)
> qp->sq.wrid = __vmalloc(qp->sq.wqe_cnt * sizeof(u64),
> gfp, PAGE_KERNEL);
> - qp->rq.wrid = kmalloc(qp->rq.wqe_cnt * sizeof(u64), gfp);
> + qp->rq.wrid = kmalloc(qp->rq.wqe_cnt * sizeof(u64),
> + gfp | __GFP_NOWARN);
> if (!qp->rq.wrid)
> qp->rq.wrid = __vmalloc(qp->rq.wqe_cnt * sizeof(u64),
> gfp, PAGE_KERNEL);
> diff --git a/drivers/infiniband/hw/mlx4/srq.c b/drivers/infiniband/hw/mlx4/srq.c
> index 8d133c40fa0e..f416c7463827 100644
> --- a/drivers/infiniband/hw/mlx4/srq.c
> +++ b/drivers/infiniband/hw/mlx4/srq.c
> @@ -171,7 +171,8 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
> if (err)
> goto err_mtt;
>
> - srq->wrid = kmalloc(srq->msrq.max * sizeof (u64), GFP_KERNEL);
> + srq->wrid = kmalloc(srq->msrq.max * sizeof(u64),
> + GFP_KERNEL | __GFP_NOWARN);
> if (!srq->wrid) {
> srq->wrid = __vmalloc(srq->msrq.max * sizeof(u64),
> GFP_KERNEL, PAGE_KERNEL);
>
Applied with some edits to the commit message, thanks.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
prev parent reply other threads:[~2015-12-24 5:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 7:31 [PATCH 1/2] IB/mlx4: Suppress memory allocations warnings in kmalloc->__vmalloc flows Leon Romanovsky
[not found] ` <1450337513-22609-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2015-12-17 7:31 ` [PATCH 2/2] IB/mlx4: Convert kmalloc to be kmalloc_array to fix checkpatch warnings Leon Romanovsky
[not found] ` <1450337513-22609-2-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2015-12-17 8:44 ` Sagi Grimberg
2015-12-24 5:22 ` Doug Ledford
2015-12-17 8:44 ` [PATCH 1/2] IB/mlx4: Suppress memory allocations warnings in kmalloc->__vmalloc flows Sagi Grimberg
2015-12-24 5:22 ` Doug Ledford [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=567B810F.2090702@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=leon-2ukJVAZIZ/Y@public.gmane.org \
--cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.