From: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
To: Wengang Wang <wen.gang.wang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Or Gerlitz <gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed
Date: Thu, 8 Oct 2015 09:06:09 +0300 [thread overview]
Message-ID: <20151008060609.GA19101@leon.nu> (raw)
In-Reply-To: <56049A8A.6040101-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
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 <wen.gang.wang@oracle.com> 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 = kmalloc(qp->sq.wqe_cnt * sizeof (u64), gfp);
> >>- qp->rq.wrid = kmalloc(qp->rq.wqe_cnt * sizeof (u64), gfp);
> >>+ qp->sq.wrid = kmalloc(qp->sq.wqe_cnt * sizeof(u64), gfp);
> >>+ if (!qp->sq.wrid)
> >>+ qp->sq.wrid = __vmalloc(qp->sq.wqe_cnt * sizeof(u64),
> >>+ gfp, PAGE_KERNEL);
> >On other spots of mlx4, we're using vmalloc and not __vmalloc, any
> >pros/cons for going that way too here?
>
> vmalloc is just using GFP_KERNEL | __GFP_HIGHMEM, we can't pass in the flag
> gfp with it. We should respect orginal code which needs to pass the flag.
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.
[1] [PATCH 2/7] mm: introduce kvmalloc and kvmalloc_node
https://lkml.org/lkml/2015/7/7/548
[2] [PATCH 0/7] mm: reliable memory allocation with kvmalloc
https://lkml.org/lkml/2015/7/7/545
>
> thanks,
> wengang
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-10-08 6:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 10:49 [PATCH] IB/mlx4: Use vmalloc for WR buffers when needed Wengang Wang
[not found] ` <1443091747-13881-1-git-send-email-wen.gang.wang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-09-24 11:57 ` Or Gerlitz
[not found] ` <CAJ3xEMgN4_gk4_hVXOW2GhcfnXxgPnm=Lrc7JwkxBAeKv4KRAQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-25 0:51 ` Wengang Wang
[not found] ` <56049A8A.6040101-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-10-08 6:06 ` Leon Romanovsky [this message]
[not found] ` <20151008060609.GA19101-2ukJVAZIZ/Y@public.gmane.org>
2015-10-08 6:14 ` Or Gerlitz
[not found] ` <561609D9.2080404-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-10-08 6:25 ` Leon Romanovsky
2015-10-08 5:10 ` Or Gerlitz
-- strict thread matches above, loose matches on Subject: below --
2015-09-24 6:52 Wengang Wang
[not found] ` <1443077547-12246-1-git-send-email-wen.gang.wang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-09-24 8:07 ` Or Gerlitz
[not found] ` <5603AF26.9040403-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-09-24 10:46 ` Wengang Wang
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=20151008060609.GA19101@leon.nu \
--to=leon-2ukjvaziz/y@public.gmane.org \
--cc=gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wen.gang.wang-QHcLZuEGTsvQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).