linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@linux.intel.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>, Baoquan He <bhe@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, kirill.shutemov@linux.intel.com,
	mhocko@suse.com, tglx@linutronix.de, douly.fnst@cn.fujitsu.com
Subject: Re: [PATCH 2/2] mm/sparse.c: Add nr_present_sections to change the mem_map allocation
Date: Thu, 1 Feb 2018 05:49:50 -0800	[thread overview]
Message-ID: <6def8374-2de2-a30c-69ff-2a49fb57dc9a@linux.intel.com> (raw)
In-Reply-To: <20180201101641.icoxv2sp6ckrjfxd@node.shutemov.name>

On 02/01/2018 02:16 AM, Kirill A. Shutemov wrote:
> On Thu, Feb 01, 2018 at 03:19:56PM +0800, Baoquan He wrote:
>> In sparse_init(), we allocate usemap_map and map_map which are pointer
>> array with the size of NR_MEM_SECTIONS. The memory consumption can be
>> ignorable in 4-level paging mode. While in 5-level paging, this costs
>> much memory, 512M. Kdump kernel even can't boot up with a normal
>> 'crashkernel=' setting.
>>
>> Here add a new variable to record the number of present sections. Let's
>> allocate the usemap_map and map_map with the size of nr_present_sections.
>> We only need to make sure that for the ith present section, usemap_map[i]
>> and map_map[i] store its usemap and mem_map separately.
>>
>> This change can save much memory on most of systems. Anytime, we should
>> avoid to define array or allocate memory with the size of NR_MEM_SECTIONS.
> That's very desirable outcome. But I don't know much about sparsemem.

... with the downside being that we can no longer hot-add memory that
was not part of the original, present sections.

Is that OK?

  reply	other threads:[~2018-02-01 13:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  7:19 [PATCH 0/2] Optimize the code of mem_map allocation in Baoquan He
2018-02-01  7:19 ` [PATCH 1/2] mm/sparsemem: Defer the ms->section_mem_map clearing a little later Baoquan He
2018-02-01 14:15   ` Dave Hansen
2018-02-01 14:38     ` Baoquan He
2018-02-01  7:19 ` [PATCH 2/2] mm/sparse.c: Add nr_present_sections to change the mem_map allocation Baoquan He
2018-02-01 10:16   ` Kirill A. Shutemov
2018-02-01 13:49     ` Dave Hansen [this message]
2018-02-01 14:19       ` Baoquan He
2018-02-01 14:23         ` Dave Hansen
2018-02-01 14:33           ` Baoquan He

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=6def8374-2de2-a30c-69ff-2a49fb57dc9a@linux.intel.com \
    --to=dave.hansen@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=tglx@linutronix.de \
    /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).