1. 19 5月, 2010 2 次提交
    • A
      xfs: record log sector size rather than log2(that) · 69ce58f0
      Alex Elder 提交于
      Change struct log so it keeps track of the size (in basic blocks) of
      a log sector in l_sectBBsize rather than the log-base-2 of that
      value (previously, l_sectbb_log).  The name was chosen for
      consistency with the other fields in the structure that represent
      a number of basic blocks.
      
      (Updated so that a variable used in computing and verifying a log's
      sector size is named "log2_size".  Also added the "BB" to the
      structure field name, based on feedback from Eric Sandeen.  Also
      dropped some superfluous parentheses.)
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      Reviewed-by: NEric Sandeen <sandeen@sandeen.net>
      69ce58f0
    • C
      xfs: clean up xlog_write_adv_cnt · e6b1f273
      Christoph Hellwig 提交于
      Replace the awkward xlog_write_adv_cnt with an inline helper that makes
      it more obvious that it's modifying it's paramters, and replace the use
      of an integer type for "ptr" with a real void pointer.  Also move
      xlog_write_adv_cnt to xfs_log_priv.h as it will be used outside of
      xfs_log.c in the delayed logging series.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      e6b1f273
  2. 16 1月, 2010 1 次提交
  3. 15 12月, 2009 1 次提交
    • C
      xfs: event tracing support · 0b1b213f
      Christoph Hellwig 提交于
      Convert the old xfs tracing support that could only be used with the
      out of tree kdb and xfsidbg patches to use the generic event tracer.
      
      To use it make sure CONFIG_EVENT_TRACING is enabled and then enable
      all xfs trace channels by:
      
         echo 1 > /sys/kernel/debug/tracing/events/xfs/enable
      
      or alternatively enable single events by just doing the same in one
      event subdirectory, e.g.
      
         echo 1 > /sys/kernel/debug/tracing/events/xfs/xfs_ihold/enable
      
      or set more complex filters, etc. In Documentation/trace/events.txt
      all this is desctribed in more detail.  To reads the events do a
      
         cat /sys/kernel/debug/tracing/trace
      
      Compared to the last posting this patch converts the tracing mostly to
      the one tracepoint per callsite model that other users of the new
      tracing facility also employ.  This allows a very fine-grained control
      of the tracing, a cleaner output of the traces and also enables the
      perf tool to use each tracepoint as a virtual performance counter,
           allowing us to e.g. count how often certain workloads git various
           spots in XFS.  Take a look at
      
          http://lwn.net/Articles/346470/
      
      for some examples.
      
      Also the btree tracing isn't included at all yet, as it will require
      additional core tracing features not in mainline yet, I plan to
      deliver it later.
      
      And the really nice thing about this patch is that it actually removes
      many lines of code while adding this nice functionality:
      
       fs/xfs/Makefile                |    8
       fs/xfs/linux-2.6/xfs_acl.c     |    1
       fs/xfs/linux-2.6/xfs_aops.c    |   52 -
       fs/xfs/linux-2.6/xfs_aops.h    |    2
       fs/xfs/linux-2.6/xfs_buf.c     |  117 +--
       fs/xfs/linux-2.6/xfs_buf.h     |   33
       fs/xfs/linux-2.6/xfs_fs_subr.c |    3
       fs/xfs/linux-2.6/xfs_ioctl.c   |    1
       fs/xfs/linux-2.6/xfs_ioctl32.c |    1
       fs/xfs/linux-2.6/xfs_iops.c    |    1
       fs/xfs/linux-2.6/xfs_linux.h   |    1
       fs/xfs/linux-2.6/xfs_lrw.c     |   87 --
       fs/xfs/linux-2.6/xfs_lrw.h     |   45 -
       fs/xfs/linux-2.6/xfs_super.c   |  104 ---
       fs/xfs/linux-2.6/xfs_super.h   |    7
       fs/xfs/linux-2.6/xfs_sync.c    |    1
       fs/xfs/linux-2.6/xfs_trace.c   |   75 ++
       fs/xfs/linux-2.6/xfs_trace.h   | 1369 +++++++++++++++++++++++++++++++++++++++++
       fs/xfs/linux-2.6/xfs_vnode.h   |    4
       fs/xfs/quota/xfs_dquot.c       |  110 ---
       fs/xfs/quota/xfs_dquot.h       |   21
       fs/xfs/quota/xfs_qm.c          |   40 -
       fs/xfs/quota/xfs_qm_syscalls.c |    4
       fs/xfs/support/ktrace.c        |  323 ---------
       fs/xfs/support/ktrace.h        |   85 --
       fs/xfs/xfs.h                   |   16
       fs/xfs/xfs_ag.h                |   14
       fs/xfs/xfs_alloc.c             |  230 +-----
       fs/xfs/xfs_alloc.h             |   27
       fs/xfs/xfs_alloc_btree.c       |    1
       fs/xfs/xfs_attr.c              |  107 ---
       fs/xfs/xfs_attr.h              |   10
       fs/xfs/xfs_attr_leaf.c         |   14
       fs/xfs/xfs_attr_sf.h           |   40 -
       fs/xfs/xfs_bmap.c              |  507 +++------------
       fs/xfs/xfs_bmap.h              |   49 -
       fs/xfs/xfs_bmap_btree.c        |    6
       fs/xfs/xfs_btree.c             |    5
       fs/xfs/xfs_btree_trace.h       |   17
       fs/xfs/xfs_buf_item.c          |   87 --
       fs/xfs/xfs_buf_item.h          |   20
       fs/xfs/xfs_da_btree.c          |    3
       fs/xfs/xfs_da_btree.h          |    7
       fs/xfs/xfs_dfrag.c             |    2
       fs/xfs/xfs_dir2.c              |    8
       fs/xfs/xfs_dir2_block.c        |   20
       fs/xfs/xfs_dir2_leaf.c         |   21
       fs/xfs/xfs_dir2_node.c         |   27
       fs/xfs/xfs_dir2_sf.c           |   26
       fs/xfs/xfs_dir2_trace.c        |  216 ------
       fs/xfs/xfs_dir2_trace.h        |   72 --
       fs/xfs/xfs_filestream.c        |    8
       fs/xfs/xfs_fsops.c             |    2
       fs/xfs/xfs_iget.c              |  111 ---
       fs/xfs/xfs_inode.c             |   67 --
       fs/xfs/xfs_inode.h             |   76 --
       fs/xfs/xfs_inode_item.c        |    5
       fs/xfs/xfs_iomap.c             |   85 --
       fs/xfs/xfs_iomap.h             |    8
       fs/xfs/xfs_log.c               |  181 +----
       fs/xfs/xfs_log_priv.h          |   20
       fs/xfs/xfs_log_recover.c       |    1
       fs/xfs/xfs_mount.c             |    2
       fs/xfs/xfs_quota.h             |    8
       fs/xfs/xfs_rename.c            |    1
       fs/xfs/xfs_rtalloc.c           |    1
       fs/xfs/xfs_rw.c                |    3
       fs/xfs/xfs_trans.h             |   47 +
       fs/xfs/xfs_trans_buf.c         |   62 -
       fs/xfs/xfs_vnodeops.c          |    8
       70 files changed, 2151 insertions(+), 2592 deletions(-)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      0b1b213f
  4. 01 9月, 2009 1 次提交
  5. 02 7月, 2009 1 次提交
  6. 16 3月, 2009 1 次提交
  7. 09 2月, 2009 1 次提交
  8. 01 12月, 2008 1 次提交
  9. 17 11月, 2008 1 次提交
    • D
      [XFS] Fix double free of log tickets · cc09c0dc
      Dave Chinner 提交于
      When an I/O error occurs during an intermediate commit on a rolling
      transaction, xfs_trans_commit() will free the transaction structure
      and the related ticket. However, the duplicate transaction that
      gets used as the transaction continues still contains a pointer
      to the ticket. Hence when the duplicate transaction is cancelled
      and freed, we free the ticket a second time.
      
      Add reference counting to the ticket so that we hold an extra
      reference to the ticket over the transaction commit. We drop the
      extra reference once we have checked that the transaction commit
      did not return an error, thus avoiding a double free on commit
      error.
      
      Credit to Nick Piggin for tripping over the problem.
      
      SGI-PV: 989741
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      cc09c0dc
  10. 30 10月, 2008 1 次提交
  11. 17 9月, 2008 1 次提交
    • L
      [XFS] Move memory allocations for log tracing out of the critical path · 31bd61f2
      Lachlan McIlroy 提交于
      Memory allocations for log->l_grant_trace and iclog->ic_trace are done on
      demand when the first event is logged. In xlog_state_get_iclog_space() we
      call xlog_trace_iclog() under a spinlock and allocating memory here can
      cause us to sleep with a spinlock held and deadlock the system.
      
      For the log grant tracing we use KM_NOSLEEP but that means we can lose
      trace entries. Since there is no locking to serialize the log grant
      tracing we could race and have multiple allocations and leak memory.
      
      So move the allocations to where we initialize the log/iclog structures.
      Use KM_NOFS to avoid recursing into the filesystem and drop log->l_trace
      since it's not even used.
      
      SGI-PV: 983738
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31896a
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      31bd61f2
  12. 13 8月, 2008 2 次提交
  13. 28 7月, 2008 1 次提交
  14. 18 4月, 2008 4 次提交
    • D
      [XFS] Reorganise xlog_t for better cacheline isolation of contention · 4679b2d3
      David Chinner 提交于
      To reduce contention on the log in large CPU count, separate out different
      parts of the xlog_t structure onto different cachelines. Move each lock
      onto a different cacheline along with all the members that are
      accessed/modified while that lock is held.
      
      Also, move the debugging code into debug code.
      
      SGI-PV: 978729
      SGI-Modid: xfs-linux-melb:xfs-kern:30772a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      4679b2d3
    • D
      [XFS] Remove the xlog_ticket allocator · eb01c9cd
      David Chinner 提交于
      The ticket allocator is just a simple slab implementation internal to the
      log. It requires the icloglock to be held when manipulating it and this
      contributes to contention on that lock.
      
      Just kill the entire allocator and use a memory zone instead. While there,
      allow us to gracefully fail allocation with ENOMEM.
      
      SGI-PV: 978729
      SGI-Modid: xfs-linux-melb:xfs-kern:30771a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      eb01c9cd
    • D
      [XFS] Per iclog callback chain lock · 114d23aa
      David Chinner 提交于
      Rather than use the icloglock for protecting the iclog completion callback
      chain, use a new per-iclog lock so that walking the callback chain doesn't
      require holding a global lock.
      
      This reduces contention on the icloglock during transaction commit and log
      I/O completion by reducing the number of times we need to hold the global
      icloglock during these operations.
      
      SGI-PV: 978729
      SGI-Modid: xfs-linux-melb:xfs-kern:30770a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      114d23aa
    • D
      [XFS] Use atomics for iclog reference counting · 155cc6b7
      David Chinner 提交于
      Now that we update the log tail LSN less frequently on transaction
      completion, we pass the contention straight to the global log state lock
      (l_iclog_lock) during transaction completion.
      
      We currently have to take this lock to decrement the iclog reference
      count. there is a reference count on each iclog, so we need to take þhe
      global lock for all refcount changes.
      
      When large numbers of processes are all doing small trnasctions, the iclog
      reference counts will be quite high, and the state change that absolutely
      requires the l_iclog_lock is the except rather than the norm.
      
      Change the reference counting on the iclogs to use atomic_inc/dec so that
      we can use atomic_dec_and_lock during transaction completion and avoid the
      need for grabbing the l_iclog_lock for every reference count decrement
      except the one that matters - the last.
      
      SGI-PV: 975671
      SGI-Modid: xfs-linux-melb:xfs-kern:30505a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      155cc6b7
  15. 10 4月, 2008 1 次提交
  16. 07 2月, 2008 5 次提交
    • C
      [XFS] xlog_rec_header/xlog_rec_ext_header endianess annotations · b53e675d
      Christoph Hellwig 提交于
      Mostly trivial conversion with one exceptions: h_num_logops was kept in
      native endian previously and only converted to big endian in xlog_sync,
      but we always keep it big endian now. With todays cpus fast byteswap
      instructions that's not an issue but the new variant keeps the code clean
      and maintainable.
      
      SGI-PV: 971186
      SGI-Modid: xfs-linux-melb:xfs-kern:29821a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      b53e675d
    • C
      [XFS] clean up some xfs_log_priv.h macros · 67fcb7bf
      Christoph Hellwig 提交于
      - the various assign lsn macros are replaced by a single inline,
      xlog_assign_lsn, which is equivalent to ASSIGN_ANY_LSN_HOST except
      for a more sane calling convention. ASSIGN_LSN_DISK is replaced
      by xlog_assign_lsn and a manual bytespap, and ASSIGN_LSN by the same,
      except we pass the cycle and block arguments explicitly instead of a
      log paramter. The latter two variants only had 2, respectively one
      user anyway.
      - the GET_CYCLE is replaced by a xlog_get_cycle inline with exactly the
      same calling conventions.
      - GET_CLIENT_ID is replaced by xlog_get_client_id which leaves away
      the unused arch argument. Instead of conditional defintions
      depending on host endianess we now do an unconditional swap and shift
      then, which generates equal code.
      - the unused XLOG_SET macro is removed.
      
      SGI-PV: 971186
      SGI-Modid: xfs-linux-melb:xfs-kern:29820a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      67fcb7bf
    • C
      [XFS] clean up some xfs_log_priv.h macros · 03bea6fe
      Christoph Hellwig 提交于
      - the various assign lsn macros are replaced by a single inline,
      xlog_assign_lsn, which is equivalent to ASSIGN_ANY_LSN_HOST except
      for a more sane calling convention. ASSIGN_LSN_DISK is replaced
      by xlog_assign_lsn and a manual bytespap, and ASSIGN_LSN by the same,
      except we pass the cycle and block arguments explicitly instead of a
      log paramter. The latter two variants only had 2, respectively one
      user anyway.
      - the GET_CYCLE is replaced by a xlog_get_cycle inline with exactly the
      same calling conventions.
      - GET_CLIENT_ID is replaced by xlog_get_client_id which leaves away
      the unused arch argument. Instead of conditional defintions
      depending on host endianess we now do an unconditional swap and shift
      then, which generates equal code.
      - the unused XLOG_SET macro is removed.
      
      SGI-PV: 971186
      SGI-Modid: xfs-linux-melb:xfs-kern:29819a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      03bea6fe
    • E
      [XFS] Unwrap GRANT_LOCK. · c8b5ea28
      Eric Sandeen 提交于
      Un-obfuscate GRANT_LOCK, remove GRANT_LOCK->mutex_lock->spin_lock macros,
      call spin_lock directly, remove extraneous cookie holdover from old xfs
      code, and change lock type to spinlock_t.
      
      SGI-PV: 970382
      SGI-Modid: xfs-linux-melb:xfs-kern:29741a
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NDonald Douwsma <donaldd@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      c8b5ea28
    • E
      [XFS] Unwrap LOG_LOCK. · b22cd72c
      Eric Sandeen 提交于
      Un-obfuscate LOG_LOCK, remove LOG_LOCK->mutex_lock->spin_lock macros, call
      spin_lock directly, remove extraneous cookie holdover from old xfs code,
      and change lock type to spinlock_t.
      
      SGI-PV: 970382
      SGI-Modid: xfs-linux-melb:xfs-kern:29740a
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NDonald Douwsma <donaldd@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      b22cd72c
  17. 16 10月, 2007 1 次提交
  18. 15 10月, 2007 2 次提交
  19. 28 9月, 2006 2 次提交
  20. 11 1月, 2006 3 次提交
  21. 25 11月, 2005 1 次提交
  22. 02 11月, 2005 3 次提交
  23. 08 9月, 2005 1 次提交
  24. 02 9月, 2005 1 次提交
  25. 21 6月, 2005 1 次提交