aboutsummaryrefslogtreecommitdiff
path: root/lib/int_sqrt.c
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2007-02-10 18:35:09 +1100
committerTim Shimmin <tes@sgi.com>2007-02-10 18:35:09 +1100
commit20b642858b6bb413976ff13ae6a35cc596967bab (patch)
tree363a370fc2e0097603a0cc4494f291bdc7433397 /lib/int_sqrt.c
parent804195b63a6dcb767f5fae43b435067079b52903 (diff)
[XFS] Reduction global superblock lock contention near ENOSPC.
The existing per-cpu superblock counter code uses the global superblock spin lock when we approach ENOSPC for global synchronisation. On larger machines than this code was originally tested on this can still get catastrophic spinlock contention due increasing rebalance frequency near ENOSPC. By introducing a sleeping lock that is used to serialise balances and modifications near ENOSPC we prevent contention from needlessly from wasting the CPU time of potentially hundreds of CPUs. To reduce the number of balances occuring, we separate the need rebalance case from the slow allocate case. Now, a counter running dry will trigger a rebalance during which counters are disabled. Any thread that sees a disabled counter enters a different path where it waits on the new mutex. When it gets the new mutex, it checks if the counter is disabled. If the counter is disabled, then we _know_ that we have to use the global counter and lock and it is safe to do so immediately. Otherwise, we drop the mutex and go back to trying the per-cpu counters which we know were re-enabled. SGI-PV: 952227 SGI-Modid: xfs-linux-melb:xfs-kern:27612a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'lib/int_sqrt.c')
0 files changed, 0 insertions, 0 deletions