From: Michal Hocko <mhocko@kernel.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-mm@kvack.org, virtualization@lists.linux-foundation.org
Subject: Re: GFP_REPEAT usage in vhost_net_open resp. vhost_vsock_dev_open
Date: Wed, 4 Jan 2017 19:06:24 +0100 [thread overview]
Message-ID: <20170104180624.GA10183@dhcp22.suse.cz> (raw)
In-Reply-To: <20170104195521-mutt-send-email-mst@kernel.org>
On Wed 04-01-17 19:56:42, Michael S. Tsirkin wrote:
> On Wed, Jan 04, 2017 at 04:08:00PM +0100, Michal Hocko wrote:
> > Hi Michael,
> > I am currently cleaning up opencoded kmalloc with vmalloc fallback users
> > [1] and my current kvmalloc_node helper doesn't support GFP_REPEAT
> > because there are no users which would need it. At least that's what I
> > thought until I've encountered vhost_vsock_dev_open resp.
> > vhost_vsock_dev_open which are trying to use GFP_REPEAT for kmalloc.
> > 23cc5a991c7a ("vhost-net: extend device allocation to vmalloc") explains
> > the motivation as follows:
> > "
> > As vmalloc() adds overhead on a critical network path, add __GFP_REPEAT
> > to kzalloc() flags to do this fallback only when really needed.
> > "
> >
> > I am wondering whether vmalloc adds more overhead than GFP_REPEAT
>
> Yes but the GFP_REPEAT overhead is during allocation time.
> Using vmalloc means all accesses are slowed down.
> Allocation is not on data path, accesses are.
OK, that wasn't clear to me. Thanks for the clarification. If the access
path can compensate the allocation cost then I agree that GFP_REPEAT
makes a lot of sense. I will cook up a patch to allow GFP_REPEAT in the
current kvmalloc_node and convert vhost users to it.
Thanks!
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2017-01-04 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 15:08 GFP_REPEAT usage in vhost_net_open resp. vhost_vsock_dev_open Michal Hocko
2017-01-04 17:56 ` Michael S. Tsirkin
2017-01-04 18:06 ` Michal Hocko [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=20170104180624.GA10183@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=linux-mm@kvack.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.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).