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


Groups > linux.kernel > #1613544 > unrolled thread

Re: [PATCH 7/9] net: use kvmalloc with __GFP_REPEAT rather than open coded variant

Started byShakeel Butt <shakeelb@google.com>
First post2017-03-31 01:30 +0200
Last post2017-03-31 10:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 7/9] net: use kvmalloc with __GFP_REPEAT rather than open  coded variant Shakeel Butt <shakeelb@google.com> - 2017-03-31 01:30 +0200
    Re: [PATCH 7/9] net: use kvmalloc with __GFP_REPEAT rather than open  coded variant Michal Hocko <mhocko@kernel.org> - 2017-03-31 10:50 +0200

#1613544 — Re: [PATCH 7/9] net: use kvmalloc with __GFP_REPEAT rather than open coded variant

FromShakeel Butt <shakeelb@google.com>
Date2017-03-31 01:30 +0200
SubjectRe: [PATCH 7/9] net: use kvmalloc with __GFP_REPEAT rather than open coded variant
Message-ID<tqRFT-55I-1@gated-at.bofh.it>
On Mon, Mar 6, 2017 at 2:33 AM, Michal Hocko <mhocko@kernel.org> wrote:
> From: Michal Hocko <mhocko@suse.com>
>
> fq_alloc_node, alloc_netdev_mqs and netif_alloc* open code kmalloc
> with vmalloc fallback. Use the kvmalloc variant instead. Keep the
> __GFP_REPEAT flag based on explanation from Eric:
> "
> At the time, tests on the hardware I had in my labs showed that
> vmalloc() could deliver pages spread all over the memory and that was a
> small penalty (once memory is fragmented enough, not at boot time)
> "
>
> The way how the code is constructed means, however, that we prefer to go
> and hit the OOM killer before we fall back to the vmalloc for requests
> <=32kB (with 4kB pages) in the current code. This is rather disruptive for
> something that can be achived with the fallback. On the other hand
> __GFP_REPEAT doesn't have any useful semantic for these requests. So the
> effect of this patch is that requests smaller than 64kB will fallback to

I am a bit confused about this 64kB, shouldn't it be <=32kB (with 4kB
pages & PAGE_ALLOC_COSTLY_ORDER = 3)?

> vmalloc easier now.
>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: netdev@vger.kernel.org
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---

[toc] | [next] | [standalone]


#1613743

FromMichal Hocko <mhocko@kernel.org>
Date2017-03-31 10:50 +0200
Message-ID<tr0pP-2e1-5@gated-at.bofh.it>
In reply to#1613544
On Thu 30-03-17 16:21:43, Shakeel Butt wrote:
> On Mon, Mar 6, 2017 at 2:33 AM, Michal Hocko <mhocko@kernel.org> wrote:
> > From: Michal Hocko <mhocko@suse.com>
> >
> > fq_alloc_node, alloc_netdev_mqs and netif_alloc* open code kmalloc
> > with vmalloc fallback. Use the kvmalloc variant instead. Keep the
> > __GFP_REPEAT flag based on explanation from Eric:
> > "
> > At the time, tests on the hardware I had in my labs showed that
> > vmalloc() could deliver pages spread all over the memory and that was a
> > small penalty (once memory is fragmented enough, not at boot time)
> > "
> >
> > The way how the code is constructed means, however, that we prefer to go
> > and hit the OOM killer before we fall back to the vmalloc for requests
> > <=32kB (with 4kB pages) in the current code. This is rather disruptive for
> > something that can be achived with the fallback. On the other hand
> > __GFP_REPEAT doesn't have any useful semantic for these requests. So the
> > effect of this patch is that requests smaller than 64kB will fallback to
> 
> I am a bit confused about this 64kB, shouldn't it be <=32kB (with 4kB
> pages & PAGE_ALLOC_COSTLY_ORDER = 3)?

You are right. I just forgot to update wording. "mm: support
__GFP_REPEAT in kvmalloc_node for >32kB" was fixed but this one stayed
in place.

s@smaller than 64kB@which fit into 32kB@

Andrew could you update the changelog please?
-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web