Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1618543

Re: [PATCH 2/9] mm: support __GFP_REPEAT in kvmalloc_node for >32kB

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/9] mm: support __GFP_REPEAT in kvmalloc_node for >32kB
Date 2017-04-07 09:50 +0200
Message-ID <ttwOB-4ar-3@gated-at.bofh.it> (permalink)
References <thYdA-6Qv-15@gated-at.bofh.it> <thYdB-6Qv-41@gated-at.bofh.it> <ttqga-8fC-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 06-04-17 17:45:23, Shakeel Butt wrote:
> On Mon, Mar 6, 2017 at 2:30 AM, Michal Hocko <mhocko@kernel.org> wrote:
> > From: Michal Hocko <mhocko@suse.com>
> >
> > vhost code uses __GFP_REPEAT when allocating vhost_virtqueue resp.
> > vhost_vsock because it would really like to prefer kmalloc to the
> > vmalloc fallback - see 23cc5a991c7a ("vhost-net: extend device
> > allocation to vmalloc") for more context. Michael Tsirkin has also
> > noted:
> > "
> > __GFP_REPEAT overhead is during allocation time.  Using vmalloc means all
> > accesses are slowed down.  Allocation is not on data path, accesses are.
> > "
> >
> > The similar applies to other vhost_kvzalloc users.
> >
> > Let's teach kvmalloc_node to handle __GFP_REPEAT properly. There are two
> > things to be careful about. First we should prevent from the OOM killer
> > and so have to involve __GFP_NORETRY by default and secondly override
> > __GFP_REPEAT for !costly order requests as the __GFP_REPEAT is ignored
> > for !costly orders.
> >
> > Supporting __GFP_REPEAT like semantic for !costly request is possible
> > it would require changes in the page allocator. This is out of scope of
> > this patch.
> >
> > This patch shouldn't introduce any functional change.
> >
> > Acked-by: Vlastimil Babka <vbabka@suse.cz>
> > Acked-by: Michael S. Tsirkin <mst@redhat.com>
> > Signed-off-by: Michal Hocko <mhocko@suse.com>
> > ---
> >  drivers/vhost/net.c   |  9 +++------
> >  drivers/vhost/vhost.c | 15 +++------------
> >  drivers/vhost/vsock.c |  9 +++------
> >  mm/util.c             | 20 ++++++++++++++++----
> >  4 files changed, 25 insertions(+), 28 deletions(-)
> >
> 
> There is a kzalloc/vzalloc call in
> drivers/vhost/scsi.c:vhost_scsi_open() which is not converted to
> kvzalloc(). Was that intentional?

No, an omission, I suspect. Feel free to send a follow up patch. I
suspect there will be more of those...

-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 2/9] mm: support __GFP_REPEAT in kvmalloc_node for >32kB Shakeel Butt <shakeelb@google.com> - 2017-04-07 02:50 +0200
  Re: [PATCH 2/9] mm: support __GFP_REPEAT in kvmalloc_node for >32kB Michal Hocko <mhocko@kernel.org> - 2017-04-07 09:50 +0200

csiph-web