From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Wei Yang <richardw.yang@linux.intel.com>,
akpm@linux-foundation.org, osalvador@suse.de,
pasha.tatashin@oracle.com, mhocko@suse.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/sparse: use __nr_to_section(section_nr) to get mem_section
Date: Fri, 9 Aug 2019 14:39:59 +0530 [thread overview]
Message-ID: <e17278f0-94dc-e0c6-379b-b7694cec3247@arm.com> (raw)
In-Reply-To: <20190809010242.29797-1-richardw.yang@linux.intel.com>
On 08/09/2019 06:32 AM, Wei Yang wrote:
> __pfn_to_section is defined as __nr_to_section(pfn_to_section_nr(pfn)).
Right.
>
> Since we already get section_nr, it is not necessary to get mem_section
> from start_pfn. By doing so, we reduce one redundant operation.
>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Looks right.
With this applied, memory hot add still works on arm64.
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> mm/sparse.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 72f010d9bff5..95158a148cd1 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -867,7 +867,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn,
> */
> page_init_poison(pfn_to_page(start_pfn), sizeof(struct page) * nr_pages);
>
> - ms = __pfn_to_section(start_pfn);
> + ms = __nr_to_section(section_nr);
> set_section_nid(section_nr, nid);
> section_mark_present(ms);
>
>
next prev parent reply other threads:[~2019-08-09 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 1:02 Wei Yang
2019-08-09 9:09 ` Anshuman Khandual [this message]
2019-08-09 13:46 ` Wei Yang
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=e17278f0-94dc-e0c6-379b-b7694cec3247@arm.com \
--to=anshuman.khandual@arm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=pasha.tatashin@oracle.com \
--cc=richardw.yang@linux.intel.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