mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "leon@kernel.org" <leon@kernel.org>,
	"jan.dakinevich@virtuozzo.com" <jan.dakinevich@virtuozzo.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"den@virtuozzo.com" <den@virtuozzo.com>,
	"jgg@ziepe.ca" <jgg@ziepe.ca>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"khorenko@virtuozzo.com" <khorenko@virtuozzo.com>
Subject: Re: [PATCH] ib_srpt: use kvmalloc to allocate ring pointers
Date: Tue, 10 Jul 2018 15:08:38 +0000	[thread overview]
Message-ID: <5196ea6e33825dd5fde58d23b38630afafcb77f1.camel@wdc.com> (raw)
In-Reply-To: <20180710053944.GN3014@mtr-leonro.mtl.com>

On Tue, 2018-07-10 at 08:39 +0300, Leon Romanovsky wrote:
> On Mon, Jul 09, 2018 at 04:51:08PM +0300, Jan Dakinevich wrote:
> > An array of pointers to SRPT contexts in ib_device is over 30KiB even
> > in default case, in which an amount of contexts is 4095. The patch
> > is intended to weed out large contigous allocation for non-DMA memory.
> 
> kvmalloc* doesn't "weed out" large contiguous allocations, but tries to
> allocate them and gracefully fallback to vmalloc if kmalloc fails.
> 
> More on that, for allocations less than page (64KB for PowerPC), it will
> not call to vmalloc at all, which is fine too, because pages granularity.
> 
> If you want to get rid of "contiguous allocations", use vmalloc instead.

vmalloc() has a very significant disadvantage compared to kvmalloc(): with
vmalloc() it is guaranteed that memory allocations will be slow. That's not
the case for kvmalloc() if the number of bytes that is allocated is small
enough.

Bart.





  reply	other threads:[~2018-07-10 15:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 13:51 Jan Dakinevich
2018-07-09 20:56 ` Bart Van Assche
2018-07-09 22:16 ` Jason Gunthorpe
2018-07-10  5:39 ` Leon Romanovsky
2018-07-10 15:08   ` Bart Van Assche [this message]
2018-07-10 15:53     ` Leon Romanovsky

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=5196ea6e33825dd5fde58d23b38630afafcb77f1.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=den@virtuozzo.com \
    --cc=dledford@redhat.com \
    --cc=jan.dakinevich@virtuozzo.com \
    --cc=jgg@ziepe.ca \
    --cc=khorenko@virtuozzo.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.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

all inboxes | Powered by JetHome®