From c8f80d63063aa6afd5c5e673dc32dbc593e11b94 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Thu, 12 Dec 2019 13:48:45 +0000 Subject: [PATCH 23/24] HACK: revert mm: emit tracepoint when RSS changes The correct fix is modifying the mali-midgard driver to adapt to the changes in newer kernels, but until that's done we need to revert this. Signed-off-by: Christian Hewitt --- include/linux/mm.h | 14 +++----------- include/trace/events/kmem.h | 28 ---------------------------- mm/memory.c | 6 ------ 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 5a323422d783..cebc21f191e7 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1836,27 +1836,19 @@ static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) return (unsigned long)val; } -void mm_trace_rss_stat(struct mm_struct *mm, int member, long count); - static inline void add_mm_counter(struct mm_struct *mm, int member, long value) { - long count = atomic_long_add_return(value, &mm->rss_stat.count[member]); - - mm_trace_rss_stat(mm, member, count); + atomic_long_add(value, &mm->rss_stat.count[member]); } static inline void inc_mm_counter(struct mm_struct *mm, int member) { - long count = atomic_long_inc_return(&mm->rss_stat.count[member]); - - mm_trace_rss_stat(mm, member, count); + atomic_long_inc(&mm->rss_stat.count[member]); } static inline void dec_mm_counter(struct mm_struct *mm, int member) { - long count = atomic_long_dec_return(&mm->rss_stat.count[member]); - - mm_trace_rss_stat(mm, member, count); + atomic_long_dec(&mm->rss_stat.count[member]); } /* Optimized variant when page is already known not to be PageAnon */ diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index f65b1f6db22d..788e049f899c 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -363,34 +363,6 @@ TRACE_MM_PAGES #define EM(a) { a, #a }, #define EMe(a) { a, #a } -TRACE_EVENT(rss_stat, - - TP_PROTO(struct mm_struct *mm, - int member, - long count), - - TP_ARGS(mm, member, count), - - TP_STRUCT__entry( - __field(unsigned int, mm_id) - __field(unsigned int, curr) - __field(int, member) - __field(long, size) - ), - - TP_fast_assign( - __entry->mm_id = mm_ptr_to_hash(mm); - __entry->curr = !!(current->mm == mm); - __entry->member = member; - __entry->size = (count << PAGE_SHIFT); - ), - - TP_printk("mm_id=%u curr=%d type=%s size=%ldB", - __entry->mm_id, - __entry->curr, - __print_symbolic(__entry->member, TRACE_MM_PAGES), - __entry->size) - ); #endif /* _TRACE_KMEM_H */ /* This part must be outside protection */ diff --git a/mm/memory.c b/mm/memory.c index f703fe8c8346..796c5a62e173 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -72,8 +72,6 @@ #include #include -#include - #include #include #include @@ -154,10 +152,6 @@ static int __init init_zero_pfn(void) } core_initcall(init_zero_pfn); -void mm_trace_rss_stat(struct mm_struct *mm, int member, long count) -{ - trace_rss_stat(mm, member, count); -} #if defined(SPLIT_RSS_COUNTING) -- 2.20.1