* [PATCH] numa: Use LAST_CPUPID_SHIFT to calculate LAST_CPUPID_MASK
@ 2014-03-14 11:55 Srikar Dronamraju
2014-03-14 11:58 ` Srikar Dronamraju
2014-03-15 9:52 ` Aneesh Kumar K.V
0 siblings, 2 replies; 3+ messages in thread
From: Srikar Dronamraju @ 2014-03-14 11:55 UTC (permalink / raw)
To: Liu Ping Fan, Mel Gorman, Andrew Morton
Cc: linux-mm, Peter Zijlstra, Benjamin Herrenschmidt, Paul Mackerras
LAST_CPUPID_MASK is calculated using LAST_CPUPID_WIDTH. However
LAST_CPUPID_WIDTH itself can be 0. (when LAST_CPUPID_NOT_IN_PAGE_FLAGS
is set). In such a case LAST_CPUPID_MASK turns out to be 0.
But with recent commit 1ae71d0319: (mm: numa: bugfix for
LAST_CPUPID_NOT_IN_PAGE_FLAGS) if LAST_CPUPID_MASK is 0,
page_cpupid_xchg_last() and page_cpupid_reset_last() causes
page->_last_cpupid to be set to 0.
This causes performance regression. Its almost as if numa_balancing is
off.
Fix LAST_CPUPID_MASK by using LAST_CPUPID_SHIFT instead of
LAST_CPUPID_WIDTH.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c1b7414..b9765bf 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -684,7 +684,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1)
#define NODES_MASK ((1UL << NODES_WIDTH) - 1)
#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
-#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_WIDTH) - 1)
+#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_SHIFT) - 1)
#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1)
static inline enum zone_type page_zonenum(const struct page *page)
--
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>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] numa: Use LAST_CPUPID_SHIFT to calculate LAST_CPUPID_MASK
2014-03-14 11:55 [PATCH] numa: Use LAST_CPUPID_SHIFT to calculate LAST_CPUPID_MASK Srikar Dronamraju
@ 2014-03-14 11:58 ` Srikar Dronamraju
2014-03-15 9:52 ` Aneesh Kumar K.V
1 sibling, 0 replies; 3+ messages in thread
From: Srikar Dronamraju @ 2014-03-14 11:58 UTC (permalink / raw)
To: Liu Ping Fan, Mel Gorman, Andrew Morton
Cc: linux-mm, Peter Zijlstra, Benjamin Herrenschmidt, Paul Mackerras
Some performance numbers and perf stats with and without the fix.
(3.14-rc6)
----------
numa01
Performance counter stats for '/usr/bin/time -f %e %S %U %c %w -o start_bench.out -a ./numa01':
12,27,462 cs [100.00%]
2,41,957 migrations [100.00%]
1,68,01,713 faults [100.00%]
7,99,35,29,041 cache-misses
98,808 migrate:mm_migrate_pages [100.00%]
1407.690148814 seconds time elapsed
numa02
Performance counter stats for '/usr/bin/time -f %e %S %U %c %w -o start_bench.out -a ./numa02':
63,065 cs [100.00%]
14,364 migrations [100.00%]
2,08,118 faults [100.00%]
25,32,59,404 cache-misses
12 migrate:mm_migrate_pages [100.00%]
63.840827219 seconds time elapsed
(3.14-rc6 with fix)
-------------------
numa01
Performance counter stats for '/usr/bin/time -f %e %S %U %c %w -o start_bench.out -a ./numa01':
9,68,911 cs [100.00%]
1,01,414 migrations [100.00%]
88,38,697 faults [100.00%]
4,42,92,51,042 cache-misses
4,25,060 migrate:mm_migrate_pages [100.00%]
685.965331189 seconds time elapsed
numa02
Performance counter stats for '/usr/bin/time -f %e %S %U %c %w -o start_bench.out -a ./numa02':
17,543 cs [100.00%]
2,962 migrations [100.00%]
1,17,843 faults [100.00%]
11,80,61,644 cache-misses
12,358 migrate:mm_migrate_pages [100.00%]
20.380132343 seconds time elapsed
--
Thanks and Regards
Srikar Dronamraju
--
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] numa: Use LAST_CPUPID_SHIFT to calculate LAST_CPUPID_MASK
2014-03-14 11:55 [PATCH] numa: Use LAST_CPUPID_SHIFT to calculate LAST_CPUPID_MASK Srikar Dronamraju
2014-03-14 11:58 ` Srikar Dronamraju
@ 2014-03-15 9:52 ` Aneesh Kumar K.V
1 sibling, 0 replies; 3+ messages in thread
From: Aneesh Kumar K.V @ 2014-03-15 9:52 UTC (permalink / raw)
To: Srikar Dronamraju, Liu Ping Fan, Mel Gorman, Andrew Morton
Cc: linux-mm, Peter Zijlstra, Benjamin Herrenschmidt, Paul Mackerras
Srikar Dronamraju <srikar@linux.vnet.ibm.com> writes:
> LAST_CPUPID_MASK is calculated using LAST_CPUPID_WIDTH. However
> LAST_CPUPID_WIDTH itself can be 0. (when LAST_CPUPID_NOT_IN_PAGE_FLAGS
> is set). In such a case LAST_CPUPID_MASK turns out to be 0.
>
> But with recent commit 1ae71d0319: (mm: numa: bugfix for
> LAST_CPUPID_NOT_IN_PAGE_FLAGS) if LAST_CPUPID_MASK is 0,
> page_cpupid_xchg_last() and page_cpupid_reset_last() causes
> page->_last_cpupid to be set to 0.
>
> This causes performance regression. Its almost as if numa_balancing is
> off.
>
> Fix LAST_CPUPID_MASK by using LAST_CPUPID_SHIFT instead of
> LAST_CPUPID_WIDTH.
>
> Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index c1b7414..b9765bf 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -684,7 +684,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
> #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1)
> #define NODES_MASK ((1UL << NODES_WIDTH) - 1)
> #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
> -#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_WIDTH) - 1)
> +#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_SHIFT) - 1)
> #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1)
>
> static inline enum zone_type page_zonenum(const struct page *page)
>
> --
> 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>
--
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-15 9:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14 11:55 [PATCH] numa: Use LAST_CPUPID_SHIFT to calculate LAST_CPUPID_MASK Srikar Dronamraju
2014-03-14 11:58 ` Srikar Dronamraju
2014-03-15 9:52 ` Aneesh Kumar K.V
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).