Commit 63d42578 authored by Hongchao Zhang's avatar Hongchao Zhang Committed by Greg Kroah-Hartman
Browse files

lustre/recovery: free open/close request promptly



- For the non-create open or committed open, the open request
  should be freed along with the close request as soon as the
  close done, despite that the transno of open/close is
  greater than the last committed transno known by client or not.

- Move the committed open request into another dedicated list,
  that will avoid scanning a huge replay list on receiving each
  reply (when there are many open files).

Signed-off-by: default avatarNiu Yawei <yawei.niu@intel.com>
Signed-off-by: default avatarHongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/6665
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2613


Reviewed-by: default avatarAlex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent add882a8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1305,6 +1305,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
#define OBD_CONNECT_SHORTIO     0x2000000000000ULL/* short io */
#define OBD_CONNECT_PINGLESS	0x4000000000000ULL/* pings not required */
#define OBD_CONNECT_FLOCK_DEAD	0x8000000000000ULL/* flock deadlock detection */
#define OBD_CONNECT_DISP_STRIPE 0x10000000000000ULL/*create stripe disposition*/

/* XXX README XXX:
 * Please DO NOT add flag values here before first ensuring that this same
@@ -1344,7 +1345,9 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
				OBD_CONNECT_LIGHTWEIGHT | OBD_CONNECT_UMASK | \
				OBD_CONNECT_LVB_TYPE | OBD_CONNECT_LAYOUTLOCK |\
				OBD_CONNECT_PINGLESS | OBD_CONNECT_MAX_EASIZE |\
				OBD_CONNECT_FLOCK_DEAD)
				OBD_CONNECT_FLOCK_DEAD | \
				OBD_CONNECT_DISP_STRIPE)

#define OST_CONNECT_SUPPORTED  (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
				OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
				OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX | \
@@ -2114,6 +2117,7 @@ extern void lustre_swab_generic_32s (__u32 *val);
#define DISP_ENQ_CREATE_REF  0x01000000
#define DISP_OPEN_LOCK       0x02000000
#define DISP_OPEN_LEASE      0x04000000
#define DISP_OPEN_STRIPE     0x08000000

/* INODE LOCK PARTS */
#define MDS_INODELOCK_LOOKUP 0x000001	/* For namespace, dentry etc, and also
+9 −0
Original line number Diff line number Diff line
@@ -388,6 +388,15 @@ static inline __u64 exp_connect_ibits(struct obd_export *exp)
	return ocd->ocd_ibits_known;
}

static inline bool imp_connect_disp_stripe(struct obd_import *imp)
{
	struct obd_connect_data *ocd;

	LASSERT(imp != NULL);
	ocd = &imp->imp_connect_data;
	return ocd->ocd_connect_flags & OBD_CONNECT_DISP_STRIPE;
}

extern struct obd_export *class_conn2export(struct lustre_handle *conn);
extern struct obd_device *class_conn2obd(struct lustre_handle *conn);

+11 −0
Original line number Diff line number Diff line
@@ -180,6 +180,17 @@ struct obd_import {
	struct list_head		imp_delayed_list;
	/** @} */

	/**
	 * List of requests that are retained for committed open replay. Once
	 * open is committed, open replay request will be moved from the
	 * imp_replay_list into the imp_committed_list.
	 * The imp_replay_cursor is for accelerating searching during replay.
	 * @{
	 */
	struct list_head		imp_committed_list;
	struct list_head	       *imp_replay_cursor;
	/** @} */

	/** obd device for this import */
	struct obd_device	*imp_obd;

+2 −0
Original line number Diff line number Diff line
@@ -2621,6 +2621,8 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd);
 * request queues, request management, etc.
 * @{
 */
void ptlrpc_request_committed(struct ptlrpc_request *req, int force);

void ptlrpc_init_client(int req_portal, int rep_portal, char *name,
			struct ptlrpc_client *);
void ptlrpc_cleanup_client(struct obd_import *imp);
+3 −2
Original line number Diff line number Diff line
@@ -1324,6 +1324,7 @@ struct md_open_data {
	struct ptlrpc_request    *mod_open_req;
	struct ptlrpc_request    *mod_close_req;
	atomic_t		  mod_refcount;
	bool			  mod_is_create;
};

struct lookup_intent;
@@ -1392,7 +1393,7 @@ struct md_ops {

	int (*m_set_open_replay_data)(struct obd_export *,
				      struct obd_client_handle *,
				      struct ptlrpc_request *);
				      struct lookup_intent *);
	int (*m_clear_open_replay_data)(struct obd_export *,
					struct obd_client_handle *);
	int (*m_set_lock_data)(struct obd_export *, __u64 *, void *, __u64 *);
Loading