Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • kernel
  • events
  • ring_buffer.c
Find file BlameHistoryPermalink
  • Zhipeng Xie's avatar
    perf/core: Fix perf_mmap fail when CONFIG_PERF_USE_VMALLOC enabled · 60490e79
    Zhipeng Xie authored Feb 09, 2022
    This problem can be reproduced with CONFIG_PERF_USE_VMALLOC enabled on
    both x86_64 and aarch64 arch when using sysdig -B(using ebpf)[1].
    sysdig -B works fine after rebuilding the kernel with
    CONFIG_PERF_USE_VMALLOC disabled.
    
    I tracked it down to the if condition event->rb->nr_pages != nr_pages
    in perf_mmap is true when CONFIG_PERF_USE_VMALLOC is enabled where
    event->rb->nr_pages = 1 and nr_pages = 2048 resulting perf_mmap to
    return -EINVAL. This is because when CONFIG_PERF_USE_VMALLOC is
    enabled, rb->nr_pages is always equal to 1.
    
    Arch with CONFIG_PERF_USE_VMALLOC enabled by default:
    	arc/arm/csky/mips/sh/sparc/xtensa
    
    Arch with CONFIG_PERF_USE_VMALLOC disabled by default:
    	x86_64/aarch64/...
    
    Fix this problem by using data_page_nr()
    
    [1] https://github.com/draios/sysdig
    
    Fixes: 906010b2
    
     ("perf_event: Provide vmalloc() based mmap() backing")
    Signed-off-by: default avatarZhipeng Xie <xiezhipeng1@huawei.com>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20220209145417.6495-1-xiezhipeng1@huawei.com
    60490e79
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7