Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton: "Incoming: - a small number of updates to scripts/, ocfs2 and fs/buffer.c - most of MM I still have quite a lot of material (mostly not MM) staged after linux-next due to -next dependencies. I'll send those across next week as the preprequisites get merged up" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (135 commits) mm/page_io.c: annotate refault stalls from swap_readpage mm/Kconfig: fix trivial help text punctuation mm/Kconfig: fix indentation mm/memory_hotplug.c: remove __online_page_set_limits() mm: fix typos in comments when calling __SetPageUptodate() mm: fix struct member name in function comments mm/shmem.c: cast the type of unmap_start to u64 mm: shmem: use proper gfp flags for shmem_writepage() mm/shmem.c: make array 'values' static const, makes object smaller userfaultfd: require CAP_SYS_PTRACE for UFFD_FEATURE_EVENT_FORK fs/userfaultfd.c: wp: clear VM_UFFD_MISSING or VM_UFFD_WP during userfaultfd_register() userfaultfd: wrap the common dst_vma check into an inlined function userfaultfd: remove unnecessary WARN_ON() in __mcopy_atomic_hugetlb() userfaultfd: use vma_pagesize for all huge page size calculation mm/madvise.c: use PAGE_ALIGN[ED] for range checking mm/madvise.c: replace with page_size() in madvise_inject_error() mm/mmap.c: make vma_merge() comment more easy to understand mm/hwpoison-inject: use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops autonuma: reduce cache footprint when scanning page tables autonuma: fix watermark checking in migrate_balanced_pgdat() ...
This commit is contained in:
@@ -316,6 +316,53 @@ TRACE_EVENT(mm_page_alloc_extfrag,
|
||||
__entry->change_ownership)
|
||||
);
|
||||
|
||||
/*
|
||||
* Required for uniquely and securely identifying mm in rss_stat tracepoint.
|
||||
*/
|
||||
#ifndef __PTR_TO_HASHVAL
|
||||
static unsigned int __maybe_unused mm_ptr_to_hash(const void *ptr)
|
||||
{
|
||||
int ret;
|
||||
unsigned long hashval;
|
||||
|
||||
ret = ptr_to_hashval(ptr, &hashval);
|
||||
if (ret)
|
||||
return 0;
|
||||
|
||||
/* The hashed value is only 32-bit */
|
||||
return (unsigned int)hashval;
|
||||
}
|
||||
#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 */
|
||||
|
||||
Reference in New Issue
Block a user