on a small system (like NAME=local configuration) ldiskfs
transactions can not accept many changes. with batched
precreation in OFD, the default value of 128 objects may
lead to warnings and transaction overflow. to prevent this
OFD checks fs and if it's small (OFD_PRECREATE_SMALL_FS
= 1GB), then initial number of objects to precreate in a
single transaction is set to OFD_PRECREATE_BATCH_SMALL=8.
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: Id9b9c4b6abd76df69787777cc52380d71fdf5a86
Reviewed-on: http://review.whamcloud.com/4274
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
}
m->ofd_blockbits = fls(osfs->os_bsize) - 1;
+ m->ofd_precreate_batch = OFD_PRECREATE_BATCH_DEFAULT;
+ if (osfs->os_bsize * osfs->os_blocks < OFD_PRECREATE_SMALL_FS)
+ m->ofd_precreate_batch = OFD_PRECREATE_BATCH_SMALL;
+
snprintf(info->fti_u.name, sizeof(info->fti_u.name), "filter-%p", m);
m->ofd_namespace = ldlm_namespace_new(obd, info->fti_u.name,
LDLM_NAMESPACE_SERVER,
if (rc)
GOTO(cleanup, rc);
- ofd->ofd_precreate_batch = OFD_PRECREATE_BATCH_DEFAULT;
groups_size = (unsigned long)info->fti_attr.la_size;
if (groups_size == sizeof(last_group)) {
#define OFD_MAX_GROUPS 256
#define OFD_PRECREATE_BATCH_DEFAULT (FILTER_SUBDIR_COUNT * 4)
+/* on small filesystems we should not precreate too many objects in
+ * a single transaction, otherwise we can overflow transactions */
+#define OFD_PRECREATE_SMALL_FS (1024ULL * 1024 * 1024)
+#define OFD_PRECREATE_BATCH_SMALL 8
+
/* Limit the returned fields marked valid to those that we actually might set */
#define OFD_VALID_FLAGS (LA_TYPE | LA_MODE | LA_SIZE | LA_BLOCKS | \
LA_BLKSIZE | LA_ATIME | LA_MTIME | LA_CTIME)