aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.h
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2006-03-13 21:13:09 -0500
committerNathan Scott <nathans@sgi.com>2006-03-13 21:13:09 -0500
commit8d280b98cfe3c0b69c37d355218975c1c0279bb0 (patch)
tree2dc1deaec23a7da29b72152a4225c2600dacf1d4 /fs/xfs/xfs_mount.h
parent9f4cbecd7e5ee6390fecd6032dc04ca8c9805dc9 (diff)
[XFS] On machines with more than 8 cpus, when running parallel I/O
threads, the incore superblock lock becomes the limiting factor for buffered write throughput. Make the contended fields in the incore superblock use per-cpu counters so that there is no global lock to limit scalability. SGI-PV: 946630 SGI-Modid: xfs-linux-melb:xfs-kern:25106a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r--fs/xfs/xfs_mount.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 4c9817a8043..7cca5110ca4 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -267,6 +267,32 @@ typedef struct xfs_ioops {
267#define XFS_IODONE(vfsp) \ 267#define XFS_IODONE(vfsp) \
268 (*(mp)->m_io_ops.xfs_iodone)(vfsp) 268 (*(mp)->m_io_ops.xfs_iodone)(vfsp)
269 269
270#ifdef HAVE_PERCPU_SB
271
272/*
273 * Valid per-cpu incore superblock counters. Note that if you add new counters,
274 * you may need to define new counter disabled bit field descriptors as there
275 * are more possible fields in the superblock that can fit in a bitfield on a
276 * 32 bit platform. The XFS_SBS_* values for the current current counters just
277 * fit.
278 */
279typedef struct xfs_icsb_cnts {
280 uint64_t icsb_fdblocks;
281 uint64_t icsb_ifree;
282 uint64_t icsb_icount;
283 spinlock_t icsb_lock;
284} xfs_icsb_cnts_t;
285
286#define XFS_ICSB_SB_LOCKED (1 << 0) /* sb already locked */
287#define XFS_ICSB_LAZY_COUNT (1 << 1) /* accuracy not needed */
288
289extern int xfs_icsb_init_counters(struct xfs_mount *);
290extern void xfs_icsb_sync_counters_lazy(struct xfs_mount *);
291
292#else
293#define xfs_icsb_init_counters(mp) (0)
294#define xfs_icsb_sync_counters_lazy(mp) do { } while (0)
295#endif
270 296
271typedef struct xfs_mount { 297typedef struct xfs_mount {
272 bhv_desc_t m_bhv; /* vfs xfs behavior */ 298 bhv_desc_t m_bhv; /* vfs xfs behavior */
@@ -372,6 +398,10 @@ typedef struct xfs_mount {
372 struct xfs_qmops m_qm_ops; /* vector of XQM ops */ 398 struct xfs_qmops m_qm_ops; /* vector of XQM ops */
373 struct xfs_ioops m_io_ops; /* vector of I/O ops */ 399 struct xfs_ioops m_io_ops; /* vector of I/O ops */
374 atomic_t m_active_trans; /* number trans frozen */ 400 atomic_t m_active_trans; /* number trans frozen */
401#ifdef HAVE_PERCPU_SB
402 xfs_icsb_cnts_t *m_sb_cnts; /* per-cpu superblock counters */
403 unsigned long m_icsb_counters; /* disabled per-cpu counters */
404#endif
375} xfs_mount_t; 405} xfs_mount_t;
376 406
377/* 407/*
@@ -409,6 +439,8 @@ typedef struct xfs_mount {
409#define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */ 439#define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */
410#define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred 440#define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred
411 * I/O size in stat() */ 441 * I/O size in stat() */
442#define XFS_MOUNT_NO_PERCPU_SB (1ULL << 23) /* don't use per-cpu superblock
443 counters */
412 444
413 445
414/* 446/*
@@ -546,6 +578,8 @@ extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *);
546extern int xfs_unmountfs_writesb(xfs_mount_t *); 578extern int xfs_unmountfs_writesb(xfs_mount_t *);
547extern int xfs_unmount_flush(xfs_mount_t *, int); 579extern int xfs_unmount_flush(xfs_mount_t *, int);
548extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int, int); 580extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int, int);
581extern int xfs_mod_incore_sb_unlocked(xfs_mount_t *, xfs_sb_field_t,
582 int, int);
549extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, 583extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *,
550 uint, int); 584 uint, int);
551extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); 585extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int);