If multi-core CPUs share the MMU, can multiple processes run in parallel?

61 Views Asked by At

If multi-core CPUs have a dedicated MMU for each core, multiple processes can run in parallel.I want to know what will happen if multi-core CPUs share the MMU.

I guess,if multi-core CPUs share the MMU, multiple processes can run in parallel. MMU looks at multiple different page tables at different times. Is this true? Can you give a detailed explanation?

1

There are 1 best solutions below

5
Brendan On

If multi-core CPUs share the MMU, can multiple processes run in parallel?

If CPUs share the same MMU (same page tables, etc); then all CPUs must have the same virtual memory, and with nothing else this would make it impossible to have multiple processes (with different virtual address spaces) running in parallel.

However; it'd be easy to have something (e.g. segmentation) to split the whole virtual address space into "zones". For example; if process1 is only able to access the first 1 GiB of the virtual address space, process2 is only able to access the second 1 GiB, and processN is only able to access then Nth GiB; then multiple processes can share the same virtual address space without conflicts or security problems. If the size of the zones are constant; this is functionally equivalent to having a separate MMU for each zone.

I want to know what will happen if multi-core CPUs share the MMU.

What would happen is either:

  • nobody would buy it because it's a dodgy joke (because it can't run multiple processes in parallel), so it'll end up being a few chips in a museum somewhere that everyone laughs at; or

  • the first version will behave the same as "separate MMU per CPU", and then the second version will be "separate MMU per CPU" to improve performance.

In other words, "companies competing for profit" tends to ruin the viability of products that suck.