mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Zhang Yanfei <zhangyanfei.yes@gmail.com>,
	Zhang Yanfei <zhangyanfei@cn.fujitsu.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Toshi Kani <toshi.kani@hp.com>,
	Ingo Molnar <mingo@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH part2 v2 0/8] Arrange hotpluggable memory as ZONE_MOVABLE
Date: Tue, 15 Oct 2013 09:16:13 -0400	[thread overview]
Message-ID: <20131015131613.GD3141@htj.dyndns.org> (raw)
In-Reply-To: <CAE9FiQUtxKL255e7P8dgTL-WfzRik7dbu_MgGZ9SxVzdj=LfjA@mail.gmail.com>

Hello, Yinghai.

On Mon, Oct 14, 2013 at 07:25:55PM -0700, Yinghai Lu wrote:
> > Wouldn't that amount be fairly static and restricted?  If you wanna
> > chunk memory init anyway, there's no reason to init more than
> > necessary until smp stage is reached.  The more you do early, the more
> > serialized you're, so wouldn't the goal naturally be initing the
> > minimum possible?
> 
> Even we try to go minimum range instead of range that whole range on boot node,
> without parsing srat at first, the minimum range could be crossed the boundary
> of nodes.

I guess it depends on how much is the minimum we're talking about, but
let's say it isn't multiple orders of magnitude larger than the kernel
image.  That shouldn't be a problem then, no?

The thing is I don't really see how SRAT would help much.  I don't
know how the existing systems are configured but it's natural to
assume that hardware-wise per-stick removal will be supported, right?
There's no reason for memory sticks of the first numa node can't be
hotunplugged.  Likely we'll end up with SRAT map which splits the
first node into two pieces - the first smaller part which can't be
removed because firmwares and stuff depend on them and the larger
tailing chunk which can be removed.  Allocating early non-migratable
stuff near the kernel image, which can't be moved without an
additional layer of indirection anyway would be fairly good choice
regardless, right?

Even if we parse SRAT early, we can't unconditionally make the kernel
allocate early stuff from node0.  We do not know how SRAT will look
like in future configurations.  If what the hotplug people are saying
is true, the first non-hotpluggable node being relatively small seems
actually quite likely.  I don't think we want to factor all those
variables into very early bootstrap stages and it's not like we're
talking about gigabytes of memory.  e.g. bring up the first half or
one gig and go from there.  That part of memory is highly unlikely to
be unpluggable anyway.

> > * 4k page mappings.  It'd be nice to keep everything working for 4k
> >   but just following SRAT isn't enough.  What if the non-hotpluggable
> >   boot node doesn't stretch high enough and page table reaches down
> >   too far?  This won't be an optional behavior, so it is actually
> >   *likely* to happen on certain setups.
> 
> no, do not assume 4k page. even we are using 1GB mapping,  we will still have
> chance to have one node to take 512G RAM, that means we can have one 4k page
> on local node ram.

Sure, the kernel image can also be located such that the last page
spills over to the next node too.  No matter what we do, without an
extra layer of indirection, this can't be a complete solution.  Think
about the usual node configuration and where kernel image is usually
loaded.  As long as page table is relatively small, it is highly
unlikely to increase the chance of such issues.

Again, it's all about benefit and cost.  Sure, parsing SRAT early will
definitely decrease the chance of such issues.  However, as long as
the size of page table is small enough, just allocating those on top
of the kernel isn't significantly worse.  Also, following SRAT earlier
not only increases complexity in vulnerable stages of boot but also
carries higher risk with the existing and future configurations
depending on how their SRAT looks like if the new behavior is applied
unconditionally.  If we decide to make early SRAT usage conditional,
that a *LOT* more conditional code than what's added by bottom-up
allocation.

> On x86 system with intel new cpus there is memory controller built-in.,
> could have hotplug modules (with socket and memory) and those hotplug modules
> will be serviced as one single point. Just nowadays like we have pcie
> card hotplugable.
> 
> I don't see where is the " a clear performance trade-off".

Because kernel data structures have to be allocated off-node.

Thanks.

-- 
tejun

  reply	other threads:[~2013-10-15 13:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-12  6:00 Zhang Yanfei
2013-10-12  6:03 ` [PATCH part2 v2 1/8] x86: get pg_data_t's memory from other node Zhang Yanfei
2013-10-12  6:04 ` [PATCH part2 v2 2/8] memblock, numa: Introduce flag into memblock Zhang Yanfei
2013-10-12  6:05 ` [PATCH part2 v2 3/8] memblock, mem_hotplug: Introduce MEMBLOCK_HOTPLUG flag to mark hotpluggable regions Zhang Yanfei
2013-10-12  6:06 ` [PATCH part2 v2 4/8] memblock: Make memblock_set_node() support different memblock_type Zhang Yanfei
2013-10-12  6:07 ` [PATCH part2 v2 5/8] acpi, numa, mem_hotplug: Mark hotpluggable memory in memblock Zhang Yanfei
2013-10-12  6:08 ` [PATCH part2 v2 6/8] acpi, numa, mem_hotplug: Mark all nodes the kernel resides un-hotpluggable Zhang Yanfei
2013-10-12  6:09 ` [PATCH part2 v2 7/8] memblock, mem_hotplug: Make memblock skip hotpluggable regions if needed Zhang Yanfei
2013-10-12  6:09 ` [PATCH part2 v2 8/8] x86, numa, acpi, memory-hotplug: Make movable_node have higher priority Zhang Yanfei
     [not found] ` <525B19C3.9040907@gmail.com>
     [not found]   ` <20131014133835.GG4722@htj.dyndns.org>
     [not found]     ` <525BFCF3.5010908@gmail.com>
     [not found]       ` <20131014142719.GI4722@htj.dyndns.org>
     [not found]         ` <525C02DC.4050706@gmail.com>
     [not found]           ` <20131014145131.GJ4722@htj.dyndns.org>
     [not found]             ` <525C0866.2010808@gmail.com>
     [not found]               ` <20131014151902.GL4722@htj.dyndns.org>
2013-10-14 15:34                 ` [PATCH part2 v2 0/8] Arrange hotpluggable memory as ZONE_MOVABLE Zhang Yanfei
2013-10-14 19:34                   ` Yinghai Lu
2013-10-14 20:04                     ` Tejun Heo
2013-10-14 20:37                       ` Yinghai Lu
2013-10-14 20:42                         ` H. Peter Anvin
2013-10-15  6:50                           ` Ingo Molnar
2013-10-15 17:31                             ` H. Peter Anvin
2013-10-16  7:03                               ` Ingo Molnar
2013-10-14 20:55                         ` Tejun Heo
2013-10-15  1:40                           ` Zhang Yanfei
2013-10-15  2:25                           ` Yinghai Lu
2013-10-15 13:16                             ` Tejun Heo [this message]
2013-10-14 20:35                     ` H. Peter Anvin
2013-10-14 20:42                       ` Yinghai Lu
2013-10-14 20:49                         ` H. Peter Anvin

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=20131015131613.GD3141@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=toshi.kani@hp.com \
    --cc=yinghai@kernel.org \
    --cc=zhangyanfei.yes@gmail.com \
    --cc=zhangyanfei@cn.fujitsu.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

Powered by JetHome