Skip to content
  • Joonsoo Kim's avatar
    mm/page_ref: add tracepoint to track down page reference manipulation · 95813b8f
    Joonsoo Kim authored
    CMA allocation should be guaranteed to succeed by definition, but,
    unfortunately, it would be failed sometimes.  It is hard to track down
    the problem, because it is related to page reference manipulation and we
    don't have any facility to analyze it.
    
    This patch adds tracepoints to track down page reference manipulation.
    With it, we can find exact reason of failure and can fix the problem.
    Following is an example of tracepoint output.  (note: this example is
    stale version that printing flags as the number.  Recent version will
    print it as human readable string.)
    
    <...>-9018  [004]    92.678375: page_ref_set:         pfn=0x17ac9 flags=0x0 count=1 mapcount=0 mapping=(nil) mt=4 val=1
    <...>-9018  [004]    92.678378: kernel_stack:
     => get_page_from_freelist (ffffffff81176659)
     => __alloc_pages_nodemask (ffffffff81176d22)
     => alloc_pages_vma (ffffffff811bf675)
     => handle_mm_fault (ffffffff8119e693)
     => __do_page_fault (ffffffff810631ea)
     => tr...
    95813b8f