Whamcloud - gitweb
LU-4416 osd-ldiskfs: limit trans size to match reservations 76/10376/12
authorJeff Mahoney <jeffm@suse.com>
Wed, 3 Sep 2014 13:37:36 +0000 (09:37 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 11 Sep 2014 19:53:00 +0000 (19:53 +0000)
Linux commit 8f7d89f36 (jbd2: transaction reservation support)
shrunk the limit of a transaction size to be
j_max_transaction_buffers / 2 to accomodate the reservations.
This can have a perforamce impact so we limit this change to
3.10+ kernels. The same commit that changed this is the same
one that changed the number of arguments to ext4_journal_start
function so we use that test for this. This patch adjusts the
limit in osd_trans_start to match depending on the kernel
version.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I10a65474dbaf7b67fe7cd59cc2544759d1e3270d
Reviewed-on: http://review.whamcloud.com/10376
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h

index 5ff2ffe..c85d7d5 100644 (file)
@@ -890,7 +890,7 @@ static int osd_param_is_not_sane(const struct osd_device *dev,
 {
        struct osd_thandle *oh = container_of(th, typeof(*oh), ot_super);
 
-       return oh->ot_credits > osd_journal(dev)->j_max_transaction_buffers;
+       return oh->ot_credits > osd_transaction_size(dev);
 }
 
 /*
@@ -1040,7 +1040,7 @@ int osd_trans_start(const struct lu_env *env, struct dt_device *d,
                 *
                 *     This should be removed when we can calculate the
                 *     credits precisely. */
-               oh->ot_credits = osd_journal(dev)->j_max_transaction_buffers;
+               oh->ot_credits = osd_transaction_size(dev);
        }
 
         /*
index 39e54e6..06ffc8a 100644 (file)
@@ -1089,7 +1089,9 @@ static inline int fid_is_internal(const struct lu_fid *fid)
 # define osd_ldiskfs_find_entry(dir, name, de, inlined, lock) \
                ldiskfs_find_entry(dir, name, de, inlined, lock)
 # define osd_journal_start(inode, type, nblocks) \
-               ldiskfs_journal_start(inode, type, nblocks);
+               ldiskfs_journal_start(inode, type, nblocks)
+# define osd_transaction_size(dev) \
+               (osd_journal(dev)->j_max_transaction_buffers / 2)
 #else
 # define LDISKFS_HT_MISC       0
 # define osd_journal_start_sb(sb, type, nblock) \
@@ -1099,7 +1101,9 @@ static inline int fid_is_internal(const struct lu_fid *fid)
 # define osd_ldiskfs_find_entry(dir, name, de, inlined, lock) \
                ldiskfs_find_entry(dir, name, de, lock)
 # define osd_journal_start(inode, type, nblocks) \
-               ldiskfs_journal_start(inode, nblocks);
+               ldiskfs_journal_start(inode, nblocks)
+# define osd_transaction_size(dev) \
+               (osd_journal(dev)->j_max_transaction_buffers)
 #endif
 
 void ldiskfs_inc_count(handle_t *handle, struct inode *inode);