by unioning few rarely used fields. now the structure should
fit a page:
(gdb) p sizeof(struct osd_thread_info)
$1 = 3296
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: I75d5c6fefa41884390ce155781e0963884a3ad2c
Reviewed-on: http://review.whamcloud.com/9726
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
LASSERT(th != NULL);
LASSERT(th->h_transaction != NULL);
LASSERT(th != NULL);
LASSERT(th->h_transaction != NULL);
- inode = &info->oti_inode;
+ inode = info->oti_inode;
+ if (unlikely(inode == NULL)) {
+ OBD_ALLOC_PTR(inode);
+ if (inode == NULL)
+ RETURN(-ENOMEM);
+ info->oti_inode = inode;
+ }
+
inode->i_sb = osd_sb(osd);
osd_id_to_inode(inode, id);
inode->i_mode = S_IFREG; /* for type in ldiskfs dir entry */
inode->i_sb = osd_sb(osd);
osd_id_to_inode(inode, id);
inode->i_mode = S_IFREG; /* for type in ldiskfs dir entry */
[OSD_OT_WRITE] = OSD_OT_WRITE,
[OSD_OT_INSERT] = OSD_OT_DELETE,
[OSD_OT_DELETE] = OSD_OT_INSERT,
[OSD_OT_WRITE] = OSD_OT_WRITE,
[OSD_OT_INSERT] = OSD_OT_DELETE,
[OSD_OT_DELETE] = OSD_OT_INSERT,
- [OSD_OT_UPDATE] = OSD_OT_MAX,
[OSD_OT_QUOTA] = OSD_OT_MAX,
};
[OSD_OT_QUOTA] = OSD_OT_MAX,
};
oh->ot_credits = 0;
atomic_set(&th->th_refc, 1);
th->th_alloc_size = sizeof(*oh);
oh->ot_credits = 0;
atomic_set(&th->th_refc, 1);
th->th_alloc_size = sizeof(*oh);
- oti->oti_dev = osd_dt_dev(d);
INIT_LIST_HEAD(&oh->ot_dcb_list);
osd_th_alloced(oh);
INIT_LIST_HEAD(&oh->ot_dcb_list);
osd_th_alloced(oh);
struct osd_thandle *oh;
struct osd_thread_info *oti = osd_oti_get(env);
struct osd_iobuf *iobuf = &oti->oti_iobuf;
struct osd_thandle *oh;
struct osd_thread_info *oti = osd_oti_get(env);
struct osd_iobuf *iobuf = &oti->oti_iobuf;
- struct qsd_instance *qsd = oti->oti_dev->od_quota_slave;
+ struct osd_device *osd = osd_dt_dev(th->th_dev);
+ struct qsd_instance *qsd = osd->od_quota_slave;
struct lquota_trans *qtrans;
ENTRY;
struct lquota_trans *qtrans;
ENTRY;
oti->oti_txns--;
rc = dt_txn_hook_stop(env, th);
if (rc != 0)
oti->oti_txns--;
rc = dt_txn_hook_stop(env, th);
if (rc != 0)
- CERROR("Failure in transaction hook: %d\n", rc);
+ CERROR("%s: failed in transaction hook: rc = %d\n",
+ osd_name(osd), rc);
/* hook functions might modify th_sync */
hdl->h_sync = th->th_sync;
/* hook functions might modify th_sync */
hdl->h_sync = th->th_sync;
- oh->ot_handle = NULL;
- OSD_CHECK_SLOW_TH(oh, oti->oti_dev,
- rc = ldiskfs_journal_stop(hdl));
- if (rc != 0)
- CERROR("Failure to stop transaction: %d\n", rc);
- } else {
+ oh->ot_handle = NULL;
+ OSD_CHECK_SLOW_TH(oh, osd, rc = ldiskfs_journal_stop(hdl));
+ if (rc != 0)
+ CERROR("%s: failed to stop transaction: rc = %d\n",
+ osd_name(osd), rc);
+ } else {
thandle_put(&oh->ot_super);
thandle_put(&oh->ot_super);
/* inform the quota slave device that the transaction is stopping */
qsd_op_end(env, qsd, qtrans);
/* inform the quota slave device that the transaction is stopping */
qsd_op_end(env, qsd, qtrans);
*/
wait_event(iobuf->dr_wait,
atomic_read(&iobuf->dr_numreqs) == 0);
*/
wait_event(iobuf->dr_wait,
atomic_read(&iobuf->dr_numreqs) == 0);
- osd_fini_iobuf(oti->oti_dev, iobuf);
+ osd_fini_iobuf(osd, iobuf);
if (!rc)
rc = iobuf->dr_error;
if (!rc)
rc = iobuf->dr_error;
{
struct osd_thread_info *info = data;
{
struct osd_thread_info *info = data;
+ if (info->oti_inode != NULL)
+ OBD_FREE_PTR(info->oti_inode);
if (info->oti_hlock != NULL)
ldiskfs_htree_lock_free(info->oti_hlock);
OBD_FREE(info->oti_it_ea_buf, OSD_IT_EA_BUFSIZE);
if (info->oti_hlock != NULL)
ldiskfs_htree_lock_free(info->oti_hlock);
OBD_FREE(info->oti_it_ea_buf, OSD_IT_EA_BUFSIZE);
+ /* please, try to keep osd_thread_info smaller than a page */
+ CLASSERT(sizeof(struct osd_thread_info) <= PAGE_SIZE);
+
osd_oi_mod_init();
rc = lu_kmem_init(ldiskfs_caches);
osd_oi_mod_init();
rc = lu_kmem_init(ldiskfs_caches);
OSD_OT_WRITE = 7,
OSD_OT_INSERT = 8,
OSD_OT_DELETE = 9,
OSD_OT_WRITE = 7,
OSD_OT_INSERT = 8,
OSD_OT_DELETE = 9,
- OSD_OT_UPDATE = 10,
- OSD_OT_QUOTA = 11,
- OSD_OT_MAX = 12
+ OSD_OT_QUOTA = 10,
+ OSD_OT_MAX = 11
};
struct osd_thread_info {
};
struct osd_thread_info {
- const struct lu_env *oti_env;
- /**
- * used for index operations.
- */
- struct dentry oti_obj_dentry;
- struct dentry oti_child_dentry;
+ const struct lu_env *oti_env;
+ /**
+ * used for index operations.
+ */
+ struct dentry oti_obj_dentry;
+ struct dentry oti_child_dentry;
+
+ /** dentry for Iterator context. */
+ struct dentry oti_it_dentry;
- /** dentry for Iterator context. */
- struct dentry oti_it_dentry;
- struct htree_lock *oti_hlock;
+ union {
+ /* fake struct file for osd_object_sync */
+ struct file oti_file;
+ /* osd_statfs() */
+ struct kstatfs oti_ksfs;
+ };
+ struct htree_lock *oti_hlock;
+
+ struct lu_fid oti_fid;
struct lu_fid oti_fid2;
struct lu_fid oti_fid3;
struct osd_inode_id oti_id;
struct lu_fid oti_fid2;
struct lu_fid oti_fid3;
struct osd_inode_id oti_id;
* XXX temporary: for ->i_op calls.
*/
struct timespec oti_time;
* XXX temporary: for ->i_op calls.
*/
struct timespec oti_time;
- /*
- * XXX temporary: fake struct file for osd_object_sync
- */
- struct file oti_file;
/*
* XXX temporary: for capa operations.
*/
/*
* XXX temporary: for capa operations.
*/
void *oti_it_ea_buf;
unsigned int oti_it_ea_buf_used:1;
void *oti_it_ea_buf;
unsigned int oti_it_ea_buf_used:1;
- struct kstatfs oti_ksfs;
-
- /** IAM iterator for index operation. */
- struct iam_iterator oti_idx_it;
+ /* IAM iterator for index operation. */
+ struct iam_iterator oti_idx_it;
/** union to guarantee that ->oti_ipd[] has proper alignment. */
union {
/** union to guarantee that ->oti_ipd[] has proper alignment. */
union {
char oti_it_ipd[DX_IPD_MAX_SIZE];
long long oti_alignment_lieutenant;
};
char oti_it_ipd[DX_IPD_MAX_SIZE];
long long oti_alignment_lieutenant;
};
struct lustre_mdt_attrs oti_mdt_attrs;
/* old LMA for compatibility */
char oti_mdt_attrs_old[LMA_OLD_SIZE];
struct lustre_mdt_attrs oti_mdt_attrs;
/* old LMA for compatibility */
char oti_mdt_attrs_old[LMA_OLD_SIZE];
+ struct filter_fid_old oti_ff;
+ struct filter_fid oti_ff_new;
};
/** 0-copy IO */
struct osd_iobuf oti_iobuf;
};
/** 0-copy IO */
struct osd_iobuf oti_iobuf;
- struct inode oti_inode;
+ /* used to access objects in /O */
+ struct inode *oti_inode;
#define OSD_FID_REC_SZ 32
char oti_ldp[OSD_FID_REC_SZ];
char oti_ldp2[OSD_FID_REC_SZ];
#define OSD_FID_REC_SZ 32
char oti_ldp[OSD_FID_REC_SZ];
char oti_ldp2[OSD_FID_REC_SZ];
unsigned short oti_declare_ops_rb[OSD_OT_MAX];
unsigned short oti_declare_ops_cred[OSD_OT_MAX];
bool oti_rollback;
unsigned short oti_declare_ops_rb[OSD_OT_MAX];
unsigned short oti_declare_ops_cred[OSD_OT_MAX];
bool oti_rollback;
-
- char oti_name[48];
- union {
- struct filter_fid_old oti_ff;
- struct filter_fid oti_ff_new;
- };
};
extern int ldiskfs_pdo;
};
extern int ldiskfs_pdo;
LASSERT(op < OSD_OT_MAX);
} else {
CWARN("%s: Invalid operation index %d\n",
LASSERT(op < OSD_OT_MAX);
} else {
CWARN("%s: Invalid operation index %d\n",
- osd_name(oti->oti_dev), op);
+ osd_name(osd_dt_dev(oh->ot_super.th_dev)), op);
libcfs_debug_dumpstack(NULL);
}
} else {
libcfs_debug_dumpstack(NULL);
}
} else {
LASSERT(op < OSD_OT_MAX);
else {
CWARN("%s: Invalid operation index %d\n",
LASSERT(op < OSD_OT_MAX);
else {
CWARN("%s: Invalid operation index %d\n",
- osd_name(oti->oti_dev), op);
+ osd_name(osd_dt_dev(oh->ot_super.th_dev)), op);
libcfs_debug_dumpstack(NULL);
return;
}
libcfs_debug_dumpstack(NULL);
return;
}
LASSERTF(rb < OSD_OT_MAX, "rb = %u\n", rb);
else {
CWARN("%s: Invalid rollback index %d\n",
LASSERTF(rb < OSD_OT_MAX, "rb = %u\n", rb);
else {
CWARN("%s: Invalid rollback index %d\n",
- osd_name(oti->oti_dev), rb);
+ osd_name(osd_dt_dev(th->th_dev)), rb);
libcfs_debug_dumpstack(NULL);
return;
}
libcfs_debug_dumpstack(NULL);
return;
}
else {
CWARN("%s: Overflow in tracking declares for "
"index, rb = %d\n",
else {
CWARN("%s: Overflow in tracking declares for "
"index, rb = %d\n",
- osd_name(oti->oti_dev), rb);
+ osd_name(osd_dt_dev(th->th_dev)), rb);
libcfs_debug_dumpstack(NULL);
return;
}
libcfs_debug_dumpstack(NULL);
return;
}
LASSERT(op < OSD_OT_MAX);
else {
CWARN("%s: Invalid operation index %d\n",
LASSERT(op < OSD_OT_MAX);
else {
CWARN("%s: Invalid operation index %d\n",
- osd_name(oti->oti_dev), op);
+ osd_name(osd_dt_dev(th->th_dev)), op);
libcfs_debug_dumpstack(NULL);
}
libcfs_debug_dumpstack(NULL);
}
struct lquota_id_info *qi, struct osd_object *obj,
bool enforce, int *flags)
{
struct lquota_id_info *qi, struct osd_object *obj,
bool enforce, int *flags)
{
- struct osd_thread_info *info = osd_oti_get(env);
- struct osd_device *dev = info->oti_dev;
+ struct osd_device *dev = osd_dt_dev(oh->ot_super.th_dev);
struct qsd_instance *qsd = dev->od_quota_slave;
struct inode *inode = NULL;
int i, rc = 0, crd;
struct qsd_instance *qsd = dev->od_quota_slave;
struct inode *inode = NULL;
int i, rc = 0, crd;