All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tang Chen <tangchen@cn.fujitsu.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bob Moore <robert.moore@intel.com>, Lv Zheng <lv.zheng@intel.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Len Brown <lenb@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>, Thomas Renninger <trenn@suse.de>,
	Jiang Liu <jiang.liu@huawei.com>,
	Wen Congyang <wency@cn.fujitsu.com>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
	Taku Izumi <izumi.taku@jp.fujitsu.com>,
	Mel Gorman <mgorman@suse.de>, Minchan Kim <minchan@kernel.org>,
	mina86@mina86.com, gong.chen@linux.intel.com,
	Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,
	lwoodman@redhat.com, Rik van Riel <riel@redhat.com>,
	jweiner@redhat.com, Prar
Subject: Re: [PATCH part4 4/4] x86, acpi, numa, mem_hotplug: Find hotpluggable memory in SRAT memory affinities.
Date: Fri, 09 Aug 2013 17:32:59 +0800	[thread overview]
Message-ID: <5204B74B.4050805@cn.fujitsu.com> (raw)
In-Reply-To: <CAE9FiQXwAkGU96Oe5YNErTXs-OHGHTAfVo4oyrF-WUZ97X7pQA@mail.gmail.com>

On 08/09/2013 12:41 AM, Yinghai Lu wrote:
> On Thu, Aug 8, 2013 at 2:41 AM, Tang Chen<tangchen@cn.fujitsu.com>  wrote:
>> In ACPI SRAT(System Resource Affinity Table), there is a memory affinity for each
>> memory range in the system. In each memory affinity, there is a field indicating
>> that if the memory range is hotpluggable.
>>
>> This patch parses all the memory affinities in SRAT only, and find out all the
>> hotpluggable memory ranges in the system.
>
> oh, no.
>
> How do you make sure the SRAT's entries are right ?
> later numa_init could reject srat table if srat ranges does not cover
> e820 memmap.

In numa_meminfo_cover_memory(), it checks if SRAT covers the e820 ranges.
And it uses
     e820ram = max_pfn - absent_pages_in_range(0, max_pfn)
to calculate the e820 ram size.

Since max_pfn is initialized before memblock.memory is fulfilled, I think
we can also do this check at earlier time.

>
> Also parse srat table two times looks silly.

By parsing SRAT twice, I can avoid memory allocation for acpi_tables_addr
in acpi_initrd_override_copy() procedure at such an early time. This memory
could also be in hotpluggable area.

I think, parsing SRAT memory affinities one more time is clean, no memory
allocation, no global variable initialization. All the current numa init
pathes will work as before.

Thanks.

--
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: Tang Chen <tangchen@cn.fujitsu.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bob Moore <robert.moore@intel.com>, Lv Zheng <lv.zheng@intel.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Len Brown <lenb@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>, Thomas Renninger <trenn@suse.de>,
	Jiang Liu <jiang.liu@huawei.com>,
	Wen Congyang <wency@cn.fujitsu.com>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
	Taku Izumi <izumi.taku@jp.fujitsu.com>,
	Mel Gorman <mgorman@suse.de>, Minchan Kim <minchan@kernel.org>,
	mina86@mina86.com, gong.chen@linux.intel.com,
	Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,
	lwoodman@redhat.com, Rik van Riel <riel@redhat.com>,
	jweiner@redhat.com, Prarit Bhargava <prarit@redhat.com>,
	Zhang Yanfei <zhangyanfei@cn.fujitsu.com>,
	yanghy@cn.fujitsu.com, the arch/x86 maintainers <x86@kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH part4 4/4] x86, acpi, numa, mem_hotplug: Find hotpluggable memory in SRAT memory affinities.
Date: Fri, 09 Aug 2013 17:32:59 +0800	[thread overview]
Message-ID: <5204B74B.4050805@cn.fujitsu.com> (raw)
In-Reply-To: <CAE9FiQXwAkGU96Oe5YNErTXs-OHGHTAfVo4oyrF-WUZ97X7pQA@mail.gmail.com>

On 08/09/2013 12:41 AM, Yinghai Lu wrote:
> On Thu, Aug 8, 2013 at 2:41 AM, Tang Chen<tangchen@cn.fujitsu.com>  wrote:
>> In ACPI SRAT(System Resource Affinity Table), there is a memory affinity for each
>> memory range in the system. In each memory affinity, there is a field indicating
>> that if the memory range is hotpluggable.
>>
>> This patch parses all the memory affinities in SRAT only, and find out all the
>> hotpluggable memory ranges in the system.
>
> oh, no.
>
> How do you make sure the SRAT's entries are right ?
> later numa_init could reject srat table if srat ranges does not cover
> e820 memmap.

In numa_meminfo_cover_memory(), it checks if SRAT covers the e820 ranges.
And it uses
     e820ram = max_pfn - absent_pages_in_range(0, max_pfn)
to calculate the e820 ram size.

Since max_pfn is initialized before memblock.memory is fulfilled, I think
we can also do this check at earlier time.

>
> Also parse srat table two times looks silly.

By parsing SRAT twice, I can avoid memory allocation for acpi_tables_addr
in acpi_initrd_override_copy() procedure at such an early time. This memory
could also be in hotpluggable area.

I think, parsing SRAT memory affinities one more time is clean, no memory
allocation, no global variable initialization. All the current numa init
pathes will work as before.

Thanks.

--
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>

  reply	other threads:[~2013-08-09  9:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08  9:41 [PATCH part4 0/4] Parse SRAT memory affinities earlier Tang Chen
2013-08-08  9:41 ` Tang Chen
2013-08-08  9:41 ` [PATCH part4 1/4] x86: Make get_ramdisk_{image|size}() global Tang Chen
2013-08-08  9:41   ` Tang Chen
2013-08-12 14:25   ` Tejun Heo
2013-08-12 14:25     ` Tejun Heo
2013-08-08  9:41 ` [PATCH part4 2/4] x86, acpica, acpi: Try to find if SRAT is overrided earlier Tang Chen
2013-08-08  9:41   ` Tang Chen
2013-08-08 16:29   ` Yinghai Lu
2013-08-09  9:41     ` Tang Chen
2013-08-09 23:34       ` Yinghai Lu
2013-08-12 12:28         ` Tang Chen
2013-08-08  9:41 ` [PATCH part4 3/4] x86, acpica, acpi: Try to find SRAT in firmware earlier Tang Chen
2013-08-08  9:41   ` Tang Chen
2013-08-08  9:41 ` [PATCH part4 4/4] x86, acpi, numa, mem_hotplug: Find hotpluggable memory in SRAT memory affinities Tang Chen
2013-08-08  9:41   ` Tang Chen
2013-08-08 16:41   ` Yinghai Lu
2013-08-08 16:41     ` Yinghai Lu
2013-08-09  9:32     ` Tang Chen [this message]
2013-08-09  9:32       ` Tang Chen
2013-08-09 23:39       ` Yinghai Lu
2013-08-09 23:39         ` Yinghai Lu
2013-08-09 23:43         ` H. Peter Anvin
2013-08-09 23:43           ` H. Peter Anvin
2013-08-09 23:53           ` Yinghai Lu
2013-08-09 23:53             ` Yinghai Lu
2013-08-09 23:56             ` H. Peter Anvin
2013-08-09 23:56               ` H. Peter Anvin
2013-08-10  0:12               ` Yinghai Lu
2013-08-10  0:12                 ` Yinghai Lu

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=5204B74B.4050805@cn.fujitsu.com \
    --to=tangchen@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=gong.chen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=jiang.liu@huawei.com \
    --cc=jweiner@redhat.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=lenb@kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=lwoodman@redhat.com \
    --cc=mgorman@suse.de \
    --cc=mina86@mina86.com \
    --cc=minchan@kernel.org \
    --cc=mingo@elte.hu \
    --cc=riel@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=robert.moore@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=trenn@suse.de \
    --cc=vasilis.liaskovitis@profitbricks.com \
    --cc=wency@cn.fujitsu.com \
    --cc=yinghai@kernel.org \
    /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.