Skip to contentSkip to conversation

mm: introduce numa_zero_pfn

PATCH In review Joonsoo Kim 4 participants 5 messages Dec 12, 2012 – Dec 17, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: introduce numa_zero_pfn

Currently, we use just *one* zero page regardless of user process' node. When user process read zero page, at first, cpu should load this to cpu cache. If node of cpu is not same as node of zero page, loading takes long time. If we make zero pages for each nodes and use them adequetly, we can reduce this overhead.

This patch implement basic infrastructure for numa_zero_pfn. It is default disabled, because it doesn't provide page coloring and some architecture use page coloring for zero page.

mm/Kconfig +5 -0
index a3f8ddd..de0ab65 100644
@@ -412,3 +412,8 @@ config FRONTSWAP
 	  and swap data is stored as normal on the matching swap device.
 
 	  If unsure, say Y to enable frontswap.
+
+config NUMA_ZERO_PFN
+	bool "Enable NUMA-aware zero page handling"
+	depends on NUMA
+	default n
mm/memory.c +49 -0

67 lines not on this page · raw message

Signature · 7 lines
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#1 lore raw
Quoted 9 lines · Joonsoo Kim

Currently, we use just *one* zero page regardless of user process' node. When user process read zero page, at first, cpu should load this to cpu cache. If node of cpu is not same as node of zero page, loading takes long time. If we make zero pages for each nodes and use them adequetly, we can reduce this overhead.

This patch implement basic infrastructure for numa_zero_pfn. It is default disabled, because it doesn't provide page coloring and some architecture use page coloring for zero page.

Do you have benchmark numbers?

Signature · 1 line
 Kirill A. Shutemov
#2 lore raw
In reply to Joonsoo Kim
Quoted 5 lines · Joonsoo Kim

Currently, we use just *one* zero page regardless of user process' node. When user process read zero page, at first, cpu should load this to cpu cache. If node of cpu is not same as node of zero page, loading takes long time. If we make zero pages for each nodes and use them adequetly, we can reduce this overhead.

Are you sure about the loading taking a long time?

I would expect a processor to fetch the zero page cachelines from the l3 cache from other sockets avoiding memory transactions altogether. The zero page is likely in use somewhere so no typically no memory accesses should occur in a system.

Fetching from the l3 cache out of another socket is faster than fetching from local memory.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw
Quoted 4 lines

I would expect a processor to fetch the zero page cachelines from the l3 cache from other sockets avoiding memory transactions altogether. The zero page is likely in use somewhere so no typically no memory accesses should occur in a system.

It depends on how effectively the workload uses the caches. If something is a cache pig of the L3 cache, then even shareable cache lines may need to be refetched regularly.

But if your workloads spends a significant part of its time reading from zero page read only data there is something wrong with the workload.

I would do some data profiling first to really prove that is the case.

-Andi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#4 lore raw

2012/12/13 Andi Kleen <[email protected]>:

Quoted 5 lines
Quoted 4 lines

I would expect a processor to fetch the zero page cachelines from the l3 cache from other sockets avoiding memory transactions altogether. The zero page is likely in use somewhere so no typically no memory accesses should occur in a system.

Quoted 8 lines

It depends on how effectively the workload uses the caches. If something is a cache pig of the L3 cache, then even shareable cache lines may need to be refetched regularly.

But if your workloads spends a significant part of its time reading from zero page read only data there is something wrong with the workload.

I would do some data profiling first to really prove that is the case.

Okay.
I didn't know about L3 cache, before.
Now, I think that I need some data profiling!
Thanks for comment.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>