From: Baoquan He <bhe@redhat.com>
To: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
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 22:19:34 +0800 [thread overview]
Message-ID: <20180201141934.GC1770@localhost.localdomain> (raw)
In-Reply-To: <6def8374-2de2-a30c-69ff-2a49fb57dc9a@linux.intel.com>
On 02/01/18 at 05:49am, Dave Hansen wrote:
> 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?
Thanks for looking into this, Dave!
I suppose these functions changed here are only called during system
bootup, namely in paging_init(). Hot-add memory goes in a different
path, __add_section() -> sparse_add_one_section(), different called
functions.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Baoquan He <bhe@redhat.com>
To: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
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 22:19:34 +0800 [thread overview]
Message-ID: <20180201141934.GC1770@localhost.localdomain> (raw)
In-Reply-To: <6def8374-2de2-a30c-69ff-2a49fb57dc9a@linux.intel.com>
On 02/01/18 at 05:49am, Dave Hansen wrote:
> 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?
Thanks for looking into this, Dave!
I suppose these functions changed here are only called during system
bootup, namely in paging_init(). Hot-add memory goes in a different
path, __add_section() -> sparse_add_one_section(), different called
functions.
next prev parent reply other threads:[~2018-02-01 14:19 UTC|newest]
Thread overview: 20+ 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 ` 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 7:19 ` Baoquan He
2018-02-01 14:15 ` Dave Hansen
2018-02-01 14:15 ` Dave Hansen
2018-02-01 14:38 ` Baoquan He
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 7:19 ` Baoquan He
2018-02-01 10:16 ` Kirill A. Shutemov
2018-02-01 10:16 ` Kirill A. Shutemov
2018-02-01 13:49 ` Dave Hansen
2018-02-01 13:49 ` Dave Hansen
2018-02-01 14:19 ` Baoquan He [this message]
2018-02-01 14:19 ` Baoquan He
2018-02-01 14:23 ` Dave Hansen
2018-02-01 14:23 ` Dave Hansen
2018-02-01 14:33 ` Baoquan He
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=20180201141934.GC1770@localhost.localdomain \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.