Is address space common between cores in multicore proc

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
sawdust
Member
Member
Posts: 51
Joined: Thu Dec 20, 2007 4:04 pm

Is address space common between cores in multicore proc

Post by sawdust »

Hi,
Is address space common between cores in multicore processor? E.g. if a physical address is mapped to a virtual address 0xabcdefabcedf, in a BSP, is it the same for the AP (running some guest OS) also?
TIA
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Is address space common between cores in multicore proc

Post by Brendan »

Hi,
sawdust wrote:Is address space common between cores in multicore processor? E.g. if a physical address is mapped to a virtual address 0xabcdefabcedf, in a BSP, is it the same for the AP (running some guest OS) also?
For all forms of multi-CPU (separate chips, multi-core and hyper-threading), every logical CPU has it's own CR3 which tells the logical CPU which virtual address space it's currently using. This means that every logical CPU can have it's own entirely separate virtual address space, or they can share virtual address spaces if you want.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Is address space common between cores in multicore proc

Post by Love4Boobies »

It depends on what type of system you're playing with. The two main types of MP systems are NUMA and SMP. In SMP, you have multiple CPUs using the same memory, in NUMA you may have multiple SMPs (1 or more CPUs), each with its own memory. Core i7 is the only Intel processor (and perhaps the only anyway) that combines both SMP and NUMA - you can use it however you want.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Is address space common between cores in multicore proc

Post by Combuster »

NUMA is orthogonal to SMP - you can have both SMP systems with NUMA (the physical address spaces are the same for each execution unit, but not the route to each subsection of the address space), and you can have non-SMP NUMA systems (i.e. the megadrive console's main and audio processor have the system memory mapped at different locations in their address spaces)
Think about there being two computers (or one for each core) with a communication wire between them - if the wire is transparent to application programmers then its SMP, if you have to explicitly deal with it, its not.
If that wire slows down communication between each half, then its NUMA.

I haven't read up on i7, but it appears to me it is an uniform SMP system (Can't imagine intel to have each core a different interface to the memory controller)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
sawdust
Member
Member
Posts: 51
Joined: Thu Dec 20, 2007 4:04 pm

Re: Is address space common between cores in multicore proc

Post by sawdust »

I'll try to be more specific. The machine has a dual-core AMD cpu and 2GiB RAM. Linux is on one core and a guest on another. They don't share any process. While linux does a 4KB paging, can the guest OS do a 2MB paging of the same memory?
TIA
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Is address space common between cores in multicore proc

Post by bewing »

As Brendan said, paging involves the virtual memory mappngs, and each core is completely independent.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Is address space common between cores in multicore proc

Post by Love4Boobies »

i7 is both SMP and NUMA.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Is address space common between cores in multicore proc

Post by Combuster »

Love4Boobies wrote:i7 is both SMP and NUMA.
Explain why its NUMA?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Is address space common between cores in multicore proc

Post by Owen »

Because i7 uses "Quick path interconnect" to the chipset and has an internal memory controller.

Yes, Intel are shamelessly copying AMD. Though why they don't just use HyperTransport is beyond me - it's an open (non AMD controlled) standard. Probably just to stop people using Intel CPUs and AMD chipsets (or vise versa)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Is address space common between cores in multicore proc

Post by Combuster »

Having a memory controller on-die or not just makes a difference in where the wires are running, quickpath is only a different communication bus to the chipset.

That still doesn't make it NUMA because the access times to a certain memory unit are still the same for each processor core.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Is address space common between cores in multicore proc

Post by Brendan »

Hi,
Combuster wrote:That still doesn't make it NUMA because the access times to a certain memory unit are still the same for each processor core.
It's "ccNUMA", the same as AMD's hyper-transport.

Code: Select all

RAM3 <--> Chip3 <--> Chip2 <--> RAM2
            |          |
            |          |
RAM1 <--> Chip1 <--> Chip0 <--> RAM0
                       |
                     IO_Hub
Of course we won't see any NUMA characteristics until next year, because Intel haven't released chips for "multi-chip" configurations yet (and there's no 2-way, 4-way or 8-way motherboards yet either).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply