All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mika Penttilä" <mika.penttila@kolumbus.fi>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Keith Mannthey <kmannth@gmail.com>,
	akpm@osdl.org, tony.luck@intel.com,
	Linux Memory Management List <linux-mm@kvack.org>,
	ak@suse.de, bob.picco@hp.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
Date: Thu, 31 Aug 2006 20:40:59 +0300	[thread overview]
Message-ID: <44F71F2B.2010406@kolumbus.fi> (raw)
In-Reply-To: <Pine.LNX.4.64.0608311749030.13392@skynet.skynet.ie>

Mel Gorman wrote:
> On Thu, 31 Aug 2006, Mika Penttilä wrote:
>
>>
>>>>> static __init inline int srat_disabled(void)
>>>>> @@ -166,7 +167,7 @@ static int hotadd_enough_memory(struct b
>>>>>
>>>>>        if (mem < 0)
>>>>>                return 0;
>>>>> -       allowed = (end_pfn - e820_hole_size(0, end_pfn)) * PAGE_SIZE;
>>>>> +       allowed = (end_pfn - absent_pages_in_range(0, end_pfn)) * 
>>>>> PAGE_SIZE;
>>>>>        allowed = (allowed / 100) * hotadd_percent;
>>>>>        if (allocated + mem > allowed) {
>>>>>                unsigned long range;
>>>>> @@ -238,7 +239,7 @@ static int reserve_hotadd(int node, unsi
>>>>>        }
>>>>>
>>>>>        /* This check might be a bit too strict, but I'm keeping it 
>>>>> for now. */
>>>>> -       if (e820_hole_size(s_pfn, e_pfn) != e_pfn - s_pfn) {
>>>>> +       if (absent_pages_in_range(s_pfn, e_pfn) != e_pfn - s_pfn) {
>>>>>                printk(KERN_ERR "SRAT: Hotplug area has existing 
>>>>> memory\n");
>>>>>                return -1;
>>>>>        }
>>>>>
>>>> We really do want to to compare against the e820 map at it contains
>>>> the memory that is really present (this info was blown away before
>>>> acpi_numa) 
>>>
>>> The information used by absent_pages_in_range() should match what was
>>> available to e820_hole_size().
>>>
>>>
>> But it doesn't : all active ranges are removed before parsing srat. I 
>> think we really need to check against e820 here.
>>
>
> What I see happening is this;
>
> 1. setup_arch calls e820_register_active_regions(0, 0, -1UL) so that all
>    regions are registered as if they were on node 0 so e820_end_of_ram()
>    gets the right value
> 2. remove_all_active_regions() is called to clear what was registered so
>    that rediscovery with NUMA awareness happens
> 3. acpi_numa_init() is called. It parses the table and a little later
>    calls acpi_numa_memory_affinity_init() for each range in the table so
>    now we're into x86_64 code
> 4. acpi_numa_memory_affinity_init() basically deals an address range.
>    Assuming the SRAT table is not broken, it calls
>    e820_register_active_ranges() for that range. At this point, for the
>    range of addresses, the active ranges are now registered
> 5. reserve_hotadd is called if the range is hotpluggable. It will fail if
>    it finds that memory already exists there
>
> So, when absent_pages_in_range() is being called by reserve_hotadd(), 
> it should be using the same information that was available in e820. 
> What am I missing?
>
Ok, right, missed the e820_register_active_ranges() in 
acpi_numa_memory_affinity_init() before reserve_hotadd stuff. So 
logically it should be working mod bugs.

Argh, just looked through the reserve hotadd code and 
hotadd_enough_memory() looks still broken. And why are we doing 
reserve_bootmem_node(), the regions aren't present RAM anyways?

--Mika


WARNING: multiple messages have this Message-ID (diff)
From: "Mika Penttilä" <mika.penttila@kolumbus.fi>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Keith Mannthey <kmannth@gmail.com>,
	akpm@osdl.org, tony.luck@intel.com,
	Linux Memory Management List <linux-mm@kvack.org>,
	ak@suse.de, bob.picco@hp.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
Date: Thu, 31 Aug 2006 20:40:59 +0300	[thread overview]
Message-ID: <44F71F2B.2010406@kolumbus.fi> (raw)
In-Reply-To: <Pine.LNX.4.64.0608311749030.13392@skynet.skynet.ie>

Mel Gorman wrote:
> On Thu, 31 Aug 2006, Mika Penttila wrote:
>
>>
>>>>> static __init inline int srat_disabled(void)
>>>>> @@ -166,7 +167,7 @@ static int hotadd_enough_memory(struct b
>>>>>
>>>>>        if (mem < 0)
>>>>>                return 0;
>>>>> -       allowed = (end_pfn - e820_hole_size(0, end_pfn)) * PAGE_SIZE;
>>>>> +       allowed = (end_pfn - absent_pages_in_range(0, end_pfn)) * 
>>>>> PAGE_SIZE;
>>>>>        allowed = (allowed / 100) * hotadd_percent;
>>>>>        if (allocated + mem > allowed) {
>>>>>                unsigned long range;
>>>>> @@ -238,7 +239,7 @@ static int reserve_hotadd(int node, unsi
>>>>>        }
>>>>>
>>>>>        /* This check might be a bit too strict, but I'm keeping it 
>>>>> for now. */
>>>>> -       if (e820_hole_size(s_pfn, e_pfn) != e_pfn - s_pfn) {
>>>>> +       if (absent_pages_in_range(s_pfn, e_pfn) != e_pfn - s_pfn) {
>>>>>                printk(KERN_ERR "SRAT: Hotplug area has existing 
>>>>> memory\n");
>>>>>                return -1;
>>>>>        }
>>>>>
>>>> We really do want to to compare against the e820 map at it contains
>>>> the memory that is really present (this info was blown away before
>>>> acpi_numa) 
>>>
>>> The information used by absent_pages_in_range() should match what was
>>> available to e820_hole_size().
>>>
>>>
>> But it doesn't : all active ranges are removed before parsing srat. I 
>> think we really need to check against e820 here.
>>
>
> What I see happening is this;
>
> 1. setup_arch calls e820_register_active_regions(0, 0, -1UL) so that all
>    regions are registered as if they were on node 0 so e820_end_of_ram()
>    gets the right value
> 2. remove_all_active_regions() is called to clear what was registered so
>    that rediscovery with NUMA awareness happens
> 3. acpi_numa_init() is called. It parses the table and a little later
>    calls acpi_numa_memory_affinity_init() for each range in the table so
>    now we're into x86_64 code
> 4. acpi_numa_memory_affinity_init() basically deals an address range.
>    Assuming the SRAT table is not broken, it calls
>    e820_register_active_ranges() for that range. At this point, for the
>    range of addresses, the active ranges are now registered
> 5. reserve_hotadd is called if the range is hotpluggable. It will fail if
>    it finds that memory already exists there
>
> So, when absent_pages_in_range() is being called by reserve_hotadd(), 
> it should be using the same information that was available in e820. 
> What am I missing?
>
Ok, right, missed the e820_register_active_ranges() in 
acpi_numa_memory_affinity_init() before reserve_hotadd stuff. So 
logically it should be working mod bugs.

Argh, just looked through the reserve hotadd code and 
hotadd_enough_memory() looks still broken. And why are we doing 
reserve_bootmem_node(), the regions aren't present RAM anyways?

--Mika

--
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:[~2006-08-31 17:39 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-21 13:45 [PATCH 0/6] Sizing zones and holes in an architecture independent manner V9 Mel Gorman
2006-08-21 13:45 ` Mel Gorman
2006-08-21 13:45 ` Mel Gorman
2006-08-21 13:45 ` [PATCH 1/6] Introduce mechanism for registering active regions of memory Mel Gorman
2006-08-21 13:45   ` Mel Gorman
2006-08-21 13:45   ` Mel Gorman
2006-08-21 13:45 ` [PATCH 2/6] Have Power use add_active_range() and free_area_init_nodes() Mel Gorman
2006-08-21 13:45   ` Mel Gorman
2006-08-21 13:45   ` Mel Gorman
2006-08-21 13:46 ` [PATCH 3/6] Have x86 use add_active_range() and free_area_init_nodes Mel Gorman
2006-08-21 13:46   ` Mel Gorman
2006-08-21 13:46   ` Mel Gorman
2006-08-21 13:46 ` [PATCH 4/6] Have x86_64 " Mel Gorman
2006-08-21 13:46   ` Mel Gorman
2006-08-21 13:46   ` Mel Gorman
2006-08-30 20:57   ` Keith Mannthey
2006-08-30 20:57     ` Keith Mannthey
2006-08-30 20:57     ` Keith Mannthey
2006-08-31 15:49     ` Mel Gorman
2006-08-31 15:49       ` Mel Gorman
2006-08-31 15:49       ` Mel Gorman
2006-08-31 16:25       ` Mika Penttilä
2006-08-31 16:25         ` Mika Penttilä
2006-08-31 17:01         ` Mel Gorman
2006-08-31 17:40           ` Mika Penttilä [this message]
2006-08-31 17:40             ` Mika Penttilä
2006-08-31 17:52       ` Keith Mannthey
2006-08-31 17:52         ` Keith Mannthey
2006-08-31 17:52         ` Keith Mannthey
2006-08-31 18:40         ` Mel Gorman
2006-08-31 18:40           ` Mel Gorman
2006-08-31 18:40           ` Mel Gorman
2006-09-01  3:08           ` Keith Mannthey
2006-09-01  3:08             ` Keith Mannthey
2006-09-01  3:08             ` Keith Mannthey
2006-09-01  8:33             ` Mel Gorman
2006-09-01  8:33               ` Mel Gorman
2006-09-01  8:33               ` Mel Gorman
2006-09-01  8:46               ` Mika Penttilä
2006-09-01  8:46                 ` Mika Penttilä
2006-09-01  8:46                 ` Mika Penttilä
2006-09-04 15:36             ` Mel Gorman
2006-09-04 15:36               ` Mel Gorman
2006-09-04 15:36               ` Mel Gorman
2006-09-04 15:38               ` Account for holes that are outside the range of physical memory Mel Gorman
2006-09-04 15:38                 ` Mel Gorman
2006-09-04 15:38                 ` Mel Gorman
2006-09-04 15:39               ` Allow an arch to expand node boundaries Mel Gorman
2006-09-04 15:39                 ` Mel Gorman
2006-09-04 15:39                 ` Mel Gorman
2006-08-21 13:46 ` [PATCH 5/6] Have ia64 use add_active_range() and free_area_init_nodes Mel Gorman
2006-08-21 13:46   ` Mel Gorman
2006-08-21 13:46   ` Mel Gorman
2006-08-21 13:47 ` [PATCH 6/6] Account for memmap and optionally the kernel image as holes Mel Gorman
2006-08-21 13:47   ` Mel Gorman
2006-08-21 13:47   ` Mel Gorman
2006-08-21 18:52 ` [PATCH 0/6] Sizing zones and holes in an architecture independent manner V9 Keith Mannthey
2006-08-21 18:52   ` Keith Mannthey
2006-08-21 18:52   ` Keith Mannthey
2006-08-22  8:38   ` Mel Gorman
2006-08-22  8:38     ` Mel Gorman
2006-08-22  8:38     ` Mel Gorman
  -- strict thread matches above, loose matches on Subject: below --
2006-07-08 11:10 [PATCH 0/6] Sizing zones and holes in an architecture independent manner V8 Mel Gorman
2006-07-08 11:12 ` [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes Mel Gorman
2006-07-08 11:12   ` Mel Gorman
2006-07-08 11:12   ` Mel Gorman
2006-05-08 14:10 [PATCH 0/6] Sizing zones and holes in an architecture independent manner V6 Mel Gorman
2006-05-08 14:11 ` [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes Mel Gorman
2006-05-08 14:11   ` Mel Gorman
2006-05-08 14:11   ` Mel Gorman
2006-05-20 20:59   ` Andrew Morton
2006-05-20 20:59     ` Andrew Morton
2006-05-20 20:59     ` Andrew Morton
2006-05-20 21:27     ` Andi Kleen
2006-05-20 21:27       ` Andi Kleen
2006-05-20 21:27       ` Andi Kleen
2006-05-20 21:40       ` Andrew Morton
2006-05-20 21:40         ` Andrew Morton
2006-05-20 21:40         ` Andrew Morton
2006-05-20 22:17         ` Andi Kleen
2006-05-20 22:17           ` Andi Kleen
2006-05-20 22:17           ` Andi Kleen
2006-05-20 22:54           ` Andrew Morton
2006-05-20 22:54             ` Andrew Morton
2006-05-20 22:54             ` Andrew Morton
2006-05-21 16:20       ` Mel Gorman
2006-05-21 16:20         ` Mel Gorman
2006-05-21 16:20         ` Mel Gorman
2006-05-21 15:50     ` Mel Gorman
2006-05-21 15:50       ` Mel Gorman
2006-05-21 15:50       ` Mel Gorman
2006-05-21 19:08       ` Andrew Morton
2006-05-21 19:08         ` Andrew Morton
2006-05-21 19:08         ` Andrew Morton
2006-05-21 22:23         ` Mel Gorman
2006-05-21 22:23           ` Mel Gorman
2006-05-21 22:23           ` Mel Gorman
2006-05-23 18:01     ` Mel Gorman
2006-05-23 18:01       ` Mel Gorman
2006-05-23 18:01       ` Mel Gorman
2006-04-11 10:39 [PATCH 0/6] [RFC] Sizing zones and holes in an architecture independent manner Mel Gorman
2006-04-11 10:41 ` [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes Mel Gorman

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=44F71F2B.2010406@kolumbus.fi \
    --to=mika.penttila@kolumbus.fi \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=bob.picco@hp.com \
    --cc=kmannth@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=tony.luck@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 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.