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
  • linux
  • kernel
  • trace
  • ring_buffer.c
Find file BlameHistoryPermalink
  • Joel Fernandes's avatar
    tracing/ring_buffer: Try harder to allocate · 84861885
    Joel Fernandes authored Jul 12, 2017
    ftrace can fail to allocate per-CPU ring buffer on systems with a large
    number of CPUs coupled while large amounts of cache happening in the
    page cache. Currently the ring buffer allocation doesn't retry in the VM
    implementation even if direct-reclaim made some progress but still
    wasn't able to find a free page. On retrying I see that the allocations
    almost always succeed. The retry doesn't happen because __GFP_NORETRY is
    used in the tracer to prevent the case where we might OOM, however if we
    drop __GFP_NORETRY, we risk destabilizing the system if OOM killer is
    triggered. To prevent this situation, use the __GFP_RETRY_MAYFAIL flag
    introduced recently [1].
    
    Tested the following still succeeds without destabilizing a system with
    1GB memory.
    echo 300000 > /sys/kernel/debug/tracing/buffer_size_kb
    
    [1] https://marc.info/?l=linux-mm&m=149820805124906&w=2
    
    Link: http://lkml.kernel.org/r/20170713021416.8897-1-joelaf@google.com
    
    
    
    Cc: Tim Murray <timmurray@google.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
    Acked-by: default avatarMichal Hocko <mhocko@kernel.org>
    Signed-off-by: default avatarJoel Fernandes <joelaf@google.com>
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    84861885
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7