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
  • trace
  • ring_buffer.c
Find file BlameHistoryPermalink
  • Steven Rostedt's avatar
    ring-buffer: Handle resize in early boot up · 88ca6a71
    Steven Rostedt authored Dec 09, 2022
    With the new command line option that allows trace event triggers to be
    added at boot, the "snapshot" trigger will allocate the snapshot buffer
    very early, when interrupts can not be enabled. Allocating the ring buffer
    is not the problem, but it also resizes it, which is, as the resize code
    does synchronization that can not be preformed at early boot.
    
    To handle this, first change the raw_spin_lock_irq() in rb_insert_pages()
    to raw_spin_lock_irqsave(), such that the unlocking of that spin lock will
    not enable interrupts.
    
    Next, where it calls schedule_work_on(), disable migration and check if
    the CPU to update is the current CPU, and if so, perform the work
    directly, otherwise re-enable migration and call the schedule_work_on() to
    the CPU that is being updated. The rb_insert_pages() just needs to be run
    on the CPU that it is updating, and does not need preemption nor
    interrupts disabled when calling it.
    
    Link: https://lore.kernel.org/lkml/Y5J%2FCajlNh1gexvo@google.com/
    Link: https://lore.kernel.org/linux-trace-kernel/20221209101151.1fec1167@gandalf.local.home
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    
    Fixes: a01fdc89
    
     ("tracing: Add trace_trigger kernel command line option")
    Reported-by: default avatarRoss Zwisler <zwisler@google.com>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    Tested-by: default avatarRoss Zwisler <zwisler@google.com>
    Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    88ca6a71
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7