* question about memory-hotplug
@ 2007-04-03 2:43 tgh
2007-04-04 5:58 ` Yasunori Goto
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: tgh @ 2007-04-03 2:43 UTC (permalink / raw)
To: linux-hotplug
hi
I try to understand the memory_hotplug.c ,but I am confused about
the mechanism in it
Does the mem_map is allocated when setup for all the memory page both
the existing and the hotplug , or does the mem_map is allocated
dynamically when a chip of memory is hotpluged ?
if mem_map is allocated dynamically,does the mem_map is maintained in
the list or how to deal with it ?
and if mem_map is allocated dynamically,does system need new node and
new zone structure to manage the dynamically-allocated memmap ,or not ?
if system need new node and new zone structure to manage the
dynamically-allocated memmap,does system have to be a NUMA-surpport one
or not?
I am confused about it
could you help me
Thanks in advance
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: question about memory-hotplug
2007-04-03 2:43 question about memory-hotplug tgh
@ 2007-04-04 5:58 ` Yasunori Goto
2007-04-04 8:53 ` tgh
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Yasunori Goto @ 2007-04-04 5:58 UTC (permalink / raw)
To: linux-hotplug
Hello.
> hi
> I try to understand the memory_hotplug.c ,but I am confused about
> the mechanism in it
> Does the mem_map is allocated when setup for all the memory page both
> the existing and the hotplug , or does the mem_map is allocated
> dynamically when a chip of memory is hotpluged ?
> if mem_map is allocated dynamically,does the mem_map is maintained in
> the list or how to deal with it ?
> and if mem_map is allocated dynamically,does system need new node and
> new zone structure to manage the dynamically-allocated memmap ,or not ?
Basically, memory hotplug code depends on sparsemem. So, I'll
recommend that you should see mm/sparse.c too.
In sparsemem code, mem_map is allocated dynamically, and
its pointed by mem_section[] array.
(However, x86-64 code has original code. IIRC, its memmap was allcated
statically....)
> if system need new node and new zone structure to manage the
> dynamically-allocated memmap,does system have to be a NUMA-surpport one
> or not?
Pgdat and zone can be allocated dynamically for NUMA system,
but memmap is not pointed by them if sparsemem is on.
Thanks for your concern. :-)
---
Yasunori Goto
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: question about memory-hotplug
2007-04-03 2:43 question about memory-hotplug tgh
2007-04-04 5:58 ` Yasunori Goto
@ 2007-04-04 8:53 ` tgh
2007-04-04 10:29 ` Yasunori Goto
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: tgh @ 2007-04-04 8:53 UTC (permalink / raw)
To: linux-hotplug
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1252", Size: 2641 bytes --]
Thank you for your reply
Yasunori Goto åé:
> Hello.
>
>
>> hi
>> I try to understand the memory_hotplug.c ,but I am confused about
>> the mechanism in it
>> Does the mem_map is allocated when setup for all the memory page both
>> the existing and the hotplug , or does the mem_map is allocated
>> dynamically when a chip of memory is hotpluged ?
>> if mem_map is allocated dynamically,does the mem_map is maintained in
>> the list or how to deal with it ?
>> and if mem_map is allocated dynamically,does system need new node and
>> new zone structure to manage the dynamically-allocated memmap ,or not ?
>>
>
> Basically, memory hotplug code depends on sparsemem. So, I'll
> recommend that you should see mm/sparse.c too.
> In sparsemem code, mem_map is allocated dynamically, and
> its pointed by mem_section[] array.
>
In the traditional linux without sparsemem, there are node-zone-memmap
mechanism for managing the physical memory,is it right?
while in the sparsemem mechanism, what is the architure of
node-zone-memmap or node-zone-mem_section[]-mem_map like?
and if the sparsemem is on , buddy still does its work in a mem_map as
before or does it work in a new way?
and how does virt-to-phy macro (or something like it) work,when there
are a list of mem_map in the sparsemem system?
> (However, x86-64 code has original code. IIRC, its memmap was allcated
> statically....)
>
does x86-64 not surpport the memory-hotplug,or how does it achieve the
memory-hotplug ?
>
>> if system need new node and new zone structure to manage the
>> dynamically-allocated memmap,does system have to be a NUMA-surpport one
>> or not?
>>
>
> Pgdat and zone can be allocated dynamically for NUMA system,
> but memmap is not pointed by them if sparsemem is on.
>
which structure points it ,mem_section[] does it? then what is the
architure of the node-zone-mem_section[]-mem_map like?
> Thanks for your concern. :-)
>
> ---
> Yasunori Goto
>
>
>
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: question about memory-hotplug
2007-04-03 2:43 question about memory-hotplug tgh
2007-04-04 5:58 ` Yasunori Goto
2007-04-04 8:53 ` tgh
@ 2007-04-04 10:29 ` Yasunori Goto
2007-04-04 12:14 ` tgh
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Yasunori Goto @ 2007-04-04 10:29 UTC (permalink / raw)
To: linux-hotplug
> In the traditional linux without sparsemem, there are node-zone-memmap
> mechanism for managing the physical memory,is it right?
Yes.
> while in the sparsemem mechanism, what is the architure of
> node-zone-memmap or node-zone-mem_section[]-mem_map like?
mem_section[] is "static array" which is defined in sparse.c.
So, no pointer is necessary to point mem_section array.
Its index can be found by only pfn like ((pfn >> PFN_SECTION_SHIFT)).
Each mem_section has pointer of mem_map.
In addition, each page->flags has area for saving mem_section's index.
page_to_section() is (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK).
Tracing __pfn_to_page() and __page_to_pfn in
include/asm-generic/memory_model.h will be good answer
for your understanding.
> and if the sparsemem is on , buddy still does its work in a mem_map as
> before or does it work in a new way?
2.6.10 or older kernel has bitmaps to manage buddy page. Current
one doesn't have it. Its information is saved in page->private.
Others are same.
1 section size is bigger than MAX_ORDER. So, current buddy system
doensn't concern about section size.
This means memory hotplug unit size is section size. (At least now)
> and how does virt-to-phy macro (or something like it) work,when there
> are a list of mem_map in the sparsemem system?
>
> > (However, x86-64 code has original code. IIRC, its memmap was allcated
> > statically....)
> >
> does x86-64 not surpport the memory-hotplug,or how does it achieve the
> memory-hotplug ?
x86-64 supports both of sparse and non sparse. It is seleced by
kernel config option.
Bye.
--
Yasunori Goto
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: question about memory-hotplug
2007-04-03 2:43 question about memory-hotplug tgh
` (2 preceding siblings ...)
2007-04-04 10:29 ` Yasunori Goto
@ 2007-04-04 12:14 ` tgh
2007-04-04 12:33 ` Yasunori Goto
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: tgh @ 2007-04-04 12:14 UTC (permalink / raw)
To: linux-hotplug
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1252", Size: 2539 bytes --]
Thank you for your reply
If sparsememory is on ,are there node and zone structures or not in the
systme?
Thanks in advance
Yasunori Goto åé:
>> In the traditional linux without sparsemem, there are node-zone-memmap
>> mechanism for managing the physical memory,is it right?
>>
>
> Yes.
>
>
>> while in the sparsemem mechanism, what is the architure of
>> node-zone-memmap or node-zone-mem_section[]-mem_map like?
>>
>
> mem_section[] is "static array" which is defined in sparse.c.
> So, no pointer is necessary to point mem_section array.
> Its index can be found by only pfn like ((pfn >> PFN_SECTION_SHIFT)).
> Each mem_section has pointer of mem_map.
>
> In addition, each page->flags has area for saving mem_section's index.
> page_to_section() is (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK).
>
> Tracing __pfn_to_page() and __page_to_pfn in
> include/asm-generic/memory_model.h will be good answer
> for your understanding.
>
>
>> and if the sparsemem is on , buddy still does its work in a mem_map as
>> before or does it work in a new way?
>>
>
> 2.6.10 or older kernel has bitmaps to manage buddy page. Current
> one doesn't have it. Its information is saved in page->private.
> Others are same.
> 1 section size is bigger than MAX_ORDER. So, current buddy system
> doensn't concern about section size.
> This means memory hotplug unit size is section size. (At least now)
>
>
>> and how does virt-to-phy macro (or something like it) work,when there
>> are a list of mem_map in the sparsemem system?
>>
>>
>>> (However, x86-64 code has original code. IIRC, its memmap was allcated
>>> statically....)
>>>
>>>
>> does x86-64 not surpport the memory-hotplug,or how does it achieve the
>> memory-hotplug ?
>>
>
> x86-64 supports both of sparse and non sparse. It is seleced by
> kernel config option.
>
> Bye.
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: question about memory-hotplug
2007-04-03 2:43 question about memory-hotplug tgh
` (3 preceding siblings ...)
2007-04-04 12:14 ` tgh
@ 2007-04-04 12:33 ` Yasunori Goto
2007-04-05 2:03 ` tgh
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Yasunori Goto @ 2007-04-04 12:33 UTC (permalink / raw)
To: linux-hotplug
> Thank you for your reply
You are welcome.
> If sparsememory is on ,are there node and zone structures or not in the
> systme?
Yes there are. Zone is still necessary for page reclaim.
Node and zonelist are used for NUMA system.
Thanks.
--
Yasunori Goto
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: question about memory-hotplug
2007-04-03 2:43 question about memory-hotplug tgh
` (4 preceding siblings ...)
2007-04-04 12:33 ` Yasunori Goto
@ 2007-04-05 2:03 ` tgh
2007-04-05 6:07 ` Yasunori Goto
2007-04-05 8:50 ` tgh
7 siblings, 0 replies; 9+ messages in thread
From: tgh @ 2007-04-05 2:03 UTC (permalink / raw)
To: linux-hotplug
Thank you for your reply
> Yes there are. Zone is still necessary for page reclaim.
> Node and zonelist are used for NUMA system.
>
Buddy allocate memory with the mem_section[] and without zone-aware
,while it reclaim memory with zone,is it right?
I am confused about the functions of the zone and node in the system
,when the sparsemem is on
could you help me
Thanks in advance
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: question about memory-hotplug
2007-04-03 2:43 question about memory-hotplug tgh
` (5 preceding siblings ...)
2007-04-05 2:03 ` tgh
@ 2007-04-05 6:07 ` Yasunori Goto
2007-04-05 8:50 ` tgh
7 siblings, 0 replies; 9+ messages in thread
From: Yasunori Goto @ 2007-04-05 6:07 UTC (permalink / raw)
To: linux-hotplug
> > Yes there are. Zone is still necessary for page reclaim.
> > Node and zonelist are used for NUMA system.
> >
> Buddy allocate memory with the mem_section[] and without zone-aware
> ,while it reclaim memory with zone,is it right?
> I am confused about the functions of the zone and node in the system
> ,when the sparsemem is on
Basically, mem_section[] is for pointer to mem_map.
It doesn't count how many pages are allocated/freed in its section.
This just divides mem_map[] as discontiguous.
Buddy allocater must know 2 things.
First is the address of buddy page against target page.
It can be calculated as --relative offset-- from target page.
(See: __page_find_buddy()). So, buddy allocater doesn't know mem_map is
discontigous or not.
From this view point, Buddy allocater doen't concern about any
zone, node, nor mem_section.
Second is free_list for managing free pages. Its list is connected
to zone. So, buddy allocator must know about only zone's address
and target page's address. It doesn't know mem_map is contiguous
or not too.
Current zone is used for manage freed/active/inactive pages.
Zone has link lists and counters of their pages.
There is no assumption that zone is contiguous from this view point.
Even if there is a memory hole in zone, zone can work.
Just memmap array has assumption that physicall memory is contigous.
Index of memmap is decided by Page Frame Number. If there is big
memory hole in memory, many space of it will be wasted.
This is why mem_section is used for sparse mem.
Node is for NUMA node now. Each node have each pgdat. This is
unit for managing memory areas which has different access
speed. Kernel can use nearest memory from cpu by finding appropriate
pgdat.
Old DISCONTIG_MEM defines one pgdat for one contigous memory area.
But many people dislike now. If system has too much memory area
which area is small size, too much pgdats and big zonelists
are big cause of system load.
Bye.
--
Yasunori Goto
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: question about memory-hotplug
2007-04-03 2:43 question about memory-hotplug tgh
` (6 preceding siblings ...)
2007-04-05 6:07 ` Yasunori Goto
@ 2007-04-05 8:50 ` tgh
7 siblings, 0 replies; 9+ messages in thread
From: tgh @ 2007-04-05 8:50 UTC (permalink / raw)
To: linux-hotplug
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1252", Size: 2764 bytes --]
Thank you for your reply
Thank you
Yasunori Goto åé:
>>> Yes there are. Zone is still necessary for page reclaim.
>>> Node and zonelist are used for NUMA system.
>>>
>>>
>> Buddy allocate memory with the mem_section[] and without zone-aware
>> ,while it reclaim memory with zone,is it right?
>> I am confused about the functions of the zone and node in the system
>> ,when the sparsemem is on
>>
>
> Basically, mem_section[] is for pointer to mem_map.
> It doesn't count how many pages are allocated/freed in its section.
> This just divides mem_map[] as discontiguous.
>
> Buddy allocater must know 2 things.
>
> First is the address of buddy page against target page.
> It can be calculated as --relative offset-- from target page.
> (See: __page_find_buddy()). So, buddy allocater doesn't know mem_map is
> discontigous or not.
> From this view point, Buddy allocater doen't concern about any
> zone, node, nor mem_section.
>
> Second is free_list for managing free pages. Its list is connected
> to zone. So, buddy allocator must know about only zone's address
> and target page's address. It doesn't know mem_map is contiguous
> or not too.
>
> Current zone is used for manage freed/active/inactive pages.
> Zone has link lists and counters of their pages.
> There is no assumption that zone is contiguous from this view point.
> Even if there is a memory hole in zone, zone can work.
>
> Just memmap array has assumption that physicall memory is contigous.
> Index of memmap is decided by Page Frame Number. If there is big
> memory hole in memory, many space of it will be wasted.
> This is why mem_section is used for sparse mem.
>
> Node is for NUMA node now. Each node have each pgdat. This is
> unit for managing memory areas which has different access
> speed. Kernel can use nearest memory from cpu by finding appropriate
> pgdat.
>
> Old DISCONTIG_MEM defines one pgdat for one contigous memory area.
> But many people dislike now. If system has too much memory area
> which area is small size, too much pgdats and big zonelists
> are big cause of system load.
>
>
> Bye.
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-04-05 8:50 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-03 2:43 question about memory-hotplug tgh
2007-04-04 5:58 ` Yasunori Goto
2007-04-04 8:53 ` tgh
2007-04-04 10:29 ` Yasunori Goto
2007-04-04 12:14 ` tgh
2007-04-04 12:33 ` Yasunori Goto
2007-04-05 2:03 ` tgh
2007-04-05 6:07 ` Yasunori Goto
2007-04-05 8:50 ` tgh
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).