Skip to content
  • Paul E. McKenney's avatar
    x86, rcu: fix strange load average and ksoftirqd behavior · bf51935f
    Paul E. McKenney authored
    
    
    Damien Wyart reported high ksoftirqd CPU usage (20%) on an
    otherwise idle system.
    
    The function-graph trace Damien provided:
    
    >   799.521187 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.521371 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.521555 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.521738 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.521934 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.522068 |   1)  ksoftir-2324  |               |                rcu_check_callbacks() {
    >   799.522208 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.522392 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.522575 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.522759 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.522956 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.523074 |   1)  ksoftir-2324  |               |                  rcu_check_callbacks() {
    >   799.523214 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.523397 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.523579 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.523762 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.523960 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.524079 |   1)  ksoftir-2324  |               |                  rcu_check_callbacks() {
    >   799.524220 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.524403 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.524587 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    >   799.524770 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
    > [ . . . ]
    
    Shows rcu_check_callbacks() being invoked way too often. It should be called
    once per jiffy, and here it is called no less than 22 times in about
    3.5 milliseconds, meaning one call every 160 microseconds or so.
    
    Why do we need to call rcu_pending() and rcu_check_callbacks() from the
    idle loop of 32-bit x86, especially given that no other architecture does
    this?
    
    The following patch removes the call to rcu_pending() and
    rcu_check_callbacks() from the x86 32-bit idle loop in order to
    reduce the softirq load on idle systems.
    
    Reported-by: default avatarDamien Wyart <damien.wyart@free.fr>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    bf51935f