mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 12:49:08 +07:00
efaffc5e40
Rate limiting of page migrations due to automatic NUMA balancing was introduced to mitigate the worst-case scenario of migrating at high frequency due to false sharing or slowly ping-ponging between nodes. Since then, a lot of effort was spent on correctly identifying these pages and avoiding unnecessary migrations and the safety net may no longer be required. Jirka Hladky reported a regression in 4.17 due to a scheduler patch that avoids spreading STREAM tasks wide prematurely. However, once the task was properly placed, it delayed migrating the memory due to rate limiting. Increasing the limit fixed the problem for him. Currently, the limit is hard-coded and does not account for the real capabilities of the hardware. Even if an estimate was attempted, it would not properly account for the number of memory controllers and it could not account for the amount of bandwidth used for normal accesses. Rather than fudging, this patch simply eliminates the rate limiting. However, Jirka reports that a STREAM configuration using multiple processes achieved similar performance to 4.16. In local tests, this patch improved performance of STREAM relative to the baseline but it is somewhat machine-dependent. Most workloads show little or not performance difference implying that there is not a heavily reliance on the throttling mechanism and it is safe to remove. STREAM on 2-socket machine 4.19.0-rc5 4.19.0-rc5 numab-v1r1 noratelimit-v1r1 MB/sec copy 43298.52 ( 0.00%) 44673.38 ( 3.18%) MB/sec scale 30115.06 ( 0.00%) 31293.06 ( 3.91%) MB/sec add 32825.12 ( 0.00%) 34883.62 ( 6.27%) MB/sec triad 32549.52 ( 0.00%) 34906.60 ( 7.24% Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Reviewed-by: Rik van Riel <riel@surriel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Jirka Hladky <jhladky@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Linux-MM <linux-mm@kvack.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20181001100525.29789-2-mgorman@techsingularity.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
77 lines
1.9 KiB
C
77 lines
1.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM migrate
|
|
|
|
#if !defined(_TRACE_MIGRATE_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_MIGRATE_H
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
#define MIGRATE_MODE \
|
|
EM( MIGRATE_ASYNC, "MIGRATE_ASYNC") \
|
|
EM( MIGRATE_SYNC_LIGHT, "MIGRATE_SYNC_LIGHT") \
|
|
EMe(MIGRATE_SYNC, "MIGRATE_SYNC")
|
|
|
|
|
|
#define MIGRATE_REASON \
|
|
EM( MR_COMPACTION, "compaction") \
|
|
EM( MR_MEMORY_FAILURE, "memory_failure") \
|
|
EM( MR_MEMORY_HOTPLUG, "memory_hotplug") \
|
|
EM( MR_SYSCALL, "syscall_or_cpuset") \
|
|
EM( MR_MEMPOLICY_MBIND, "mempolicy_mbind") \
|
|
EM( MR_NUMA_MISPLACED, "numa_misplaced") \
|
|
EMe(MR_CONTIG_RANGE, "contig_range")
|
|
|
|
/*
|
|
* First define the enums in the above macros to be exported to userspace
|
|
* via TRACE_DEFINE_ENUM().
|
|
*/
|
|
#undef EM
|
|
#undef EMe
|
|
#define EM(a, b) TRACE_DEFINE_ENUM(a);
|
|
#define EMe(a, b) TRACE_DEFINE_ENUM(a);
|
|
|
|
MIGRATE_MODE
|
|
MIGRATE_REASON
|
|
|
|
/*
|
|
* Now redefine the EM() and EMe() macros to map the enums to the strings
|
|
* that will be printed in the output.
|
|
*/
|
|
#undef EM
|
|
#undef EMe
|
|
#define EM(a, b) {a, b},
|
|
#define EMe(a, b) {a, b}
|
|
|
|
TRACE_EVENT(mm_migrate_pages,
|
|
|
|
TP_PROTO(unsigned long succeeded, unsigned long failed,
|
|
enum migrate_mode mode, int reason),
|
|
|
|
TP_ARGS(succeeded, failed, mode, reason),
|
|
|
|
TP_STRUCT__entry(
|
|
__field( unsigned long, succeeded)
|
|
__field( unsigned long, failed)
|
|
__field( enum migrate_mode, mode)
|
|
__field( int, reason)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->succeeded = succeeded;
|
|
__entry->failed = failed;
|
|
__entry->mode = mode;
|
|
__entry->reason = reason;
|
|
),
|
|
|
|
TP_printk("nr_succeeded=%lu nr_failed=%lu mode=%s reason=%s",
|
|
__entry->succeeded,
|
|
__entry->failed,
|
|
__print_symbolic(__entry->mode, MIGRATE_MODE),
|
|
__print_symbolic(__entry->reason, MIGRATE_REASON))
|
|
);
|
|
#endif /* _TRACE_MIGRATE_H */
|
|
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|