Skip to content

Commit

Permalink
x86: fix synchronize_rcu(): high latency on idle system
Browse files Browse the repository at this point in the history
an otherwise idle system takes about 3 ticks per network
interface in unregister_netdev() due to multiple calls to synchronize_rcu(),
which adds up to quite a few seconds for tearing down thousands of
interfaces.  By flushing pending rcu callbacks in the idle loop, the system
makes progress hundreds of times faster.  If this is indeed a sane thing to,
it probably needs to be done for other architectures than x86.  And yes, the
network stack shouldn't call synchronize_rcu() quite so much, but fixing that
is a little more involved.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Benjamin LaHaise authored and Ingo Molnar committed Jan 30, 2008
1 parent 6b8be6d commit 0723a69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ void cpu_idle(void)
rmb();
idle = pm_idle;

if (rcu_pending(cpu))
rcu_check_callbacks(cpu, 0);

if (!idle)
idle = default_idle;

Expand Down

0 comments on commit 0723a69

Please sign in to comment.