linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Tom Herbert <tom@herbertland.com>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: weird allocation pattern in alloc_ila_locks
Date: Mon, 9 Jan 2017 10:58:28 +0100	[thread overview]
Message-ID: <20170109095828.GE7495@dhcp22.suse.cz> (raw)
In-Reply-To: <CANn89iL7JTkV_r9Wqqcrsz1GJmTfWtxD1TUV1YOKsv3rwN-+vQ@mail.gmail.com>

On Sat 07-01-17 10:37:41, Eric Dumazet wrote:
> On Sat, Jan 7, 2017 at 1:27 AM, Michal Hocko <mhocko@kernel.org> wrote:
> > On Fri 06-01-17 14:14:49, Eric Dumazet wrote:
> 
> >> I believe the intent was to get NUMA spreading, a bit like what we have
> >> in alloc_large_system_hash() when hashdist == HASHDIST_DEFAULT
> >
> > Hmm, I am not sure this works as expected then. Because it is more
> > likely that all pages backing the vmallocked area will come from the
> > local node than spread around more nodes. Or did I miss your point?
> 
> Well, you missed that vmalloc() is aware of NUMA policies.

You are right. I have missed that alloc_page ends up using
alloc_pages_current for CONFIG_NUMA rather than alloc_pages_node.

> If current process has requested interleave on 2 nodes (as it is done
> at boot time on a dual node system),
> then vmalloc() of 8 pages will allocate 4 pages on each node.

On the other hand alloc_ila_locks does go over a single page when
lockdep is enabled and I am wondering whether doing this NUMA subtle
magic is any win...

Also this seems to be an init code so I assume a modprobe would have to
set a non-default policy to make use of it. Does anybody do that out
there?

alloc_bucket_locks is a bit more complicated because it is not only
called from the init context. But considering that rhashtable_shrink is
called from the worker context - so no mem policy can be assumed then I
am wondering whether the code really works as expected. To me it sounds
like it is trying to be clever while the outcome doesn't really do what
it is intended.

Would you mind if I just convert it to kvmalloc and make it easier to
understand?
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2017-01-09  9:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06  9:51 weird allocation pattern in alloc_ila_locks Michal Hocko
2017-01-06 10:04 ` Michal Hocko
2017-01-06 12:16   ` Michal Hocko
2017-01-06 22:14     ` Eric Dumazet
2017-01-07  9:27       ` Michal Hocko
2017-01-07 18:37         ` Eric Dumazet
2017-01-09  9:58           ` Michal Hocko [this message]
2017-01-09 14:31             ` Eric Dumazet
2017-01-09 14:41               ` Michal Hocko
2017-01-09 14:43                 ` [PATCH 1/2] rhashtable: simplify a strange allocation pattern Michal Hocko
2017-01-09 14:43                   ` [PATCH 2/2] ila: " Michal Hocko

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=20170109095828.GE7495@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tom@herbertland.com \
    /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).