Skip to content

Commit

Permalink
HACK: revert mm: emit tracepoint when RSS changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chewitt committed Jun 1, 2020
1 parent 20f4b10 commit 968b941
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 45 deletions.
14 changes: 3 additions & 11 deletions include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1847,27 +1847,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 */
Expand Down
28 changes: 0 additions & 28 deletions include/trace/events/kmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,34 +335,6 @@ static unsigned int __maybe_unused mm_ptr_to_hash(const void *ptr)
#define __PTR_TO_HASHVAL
#endif

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 member=%d size=%ldB",
__entry->mm_id,
__entry->curr,
__entry->member,
__entry->size)
);
#endif /* _TRACE_KMEM_H */

/* This part must be outside protection */
Expand Down
6 changes: 0 additions & 6 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@
#include <linux/oom.h>
#include <linux/numa.h>

#include <trace/events/kmem.h>

#include <asm/io.h>
#include <asm/mmu_context.h>
#include <asm/pgalloc.h>
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 968b941

Please sign in to comment.