Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rcu: Add RCU stall diagnosis information #18

Open
wants to merge 4 commits into
base: rcu-dev
Choose a base branch
from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: rcu: Add RCU stall diagnosis information
version: 1
url: https://patchwork.kernel.org/project/rcu/list/?series=685780

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 54a118f
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

Zhen Lei added 3 commits October 20, 2022 09:40
Similar to kstat_cpu_irqs_sum(), it counts the sum of all software
interrupts on a specified CPU.

Signed-off-by: Zhen Lei <[email protected]>
Returns the number of context switches on the specified CPU, which can be
used to diagnose rcu stall.

Signed-off-by: Zhen Lei <[email protected]>
In some extreme cases, such as the I/O pressure test, the CPU usage may
be 100%, causing RCU stall. In this case, the printed information about
current is not useful. Displays the number and usage of hard interrupts,
soft interrupts, and context switches that are generated within half of
the CPU stall timeout, can help us make a general judgment. In other
cases, we can preliminarily determine whether an infinite loop occurs
when local_irq, local_bh or preempt is disabled.

For example:
rcu: INFO: rcu_preempt self-detected stall on CPU
rcu:     0-....: (1250 ticks this GP) <omitted>
rcu:          hardirqs   softirqs   csw/system
rcu:  number:      624         45            0
rcu: cputime:       69          1         2425   ==> 2500(ms)

The example above shows that the number of hard and soft interrupts is
small, there is zero context switching, and the system takes up a lot of
time. We can quickly conclude that the current task is infinitely looped
with preempt_disable().

The impact on system performance is negligible because snapshot is
recorded only one time after 1/2 CPU stall timeout.

Signed-off-by: Zhen Lei <[email protected]>
@kernel-patches-bot
Copy link
Author

Master branch: fa70e60
series: https://patchwork.kernel.org/project/rcu/list/?series=685780
version: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants