Commit 3ee45c7e authored by Yang Sheng's avatar Yang Sheng Committed by Greg Kroah-Hartman
Browse files

staging: lustre: lov: trying smaller memory allocations



Reduce struct lov_io_sub to smaller memory usage
on wide-stripe file systems.

Signed-off-by: default avatarYang Sheng <yang.sheng@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7085
Reviewed-on: http://review.whamcloud.com/17476


Reviewed-by: default avatarBob Glossman <bob.glossman@intel.com>
Reviewed-by: default avatarJian Yu <jian.yu@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 37471504
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2437,9 +2437,9 @@ void cl_sync_io_end(const struct lu_env *env, struct cl_sync_io *anchor);
 * @{
 */

struct lu_env *cl_env_get(int *refcheck);
struct lu_env *cl_env_alloc(int *refcheck, __u32 tags);
void cl_env_put(struct lu_env *env, int *refcheck);
struct lu_env *cl_env_get(u16 *refcheck);
struct lu_env *cl_env_alloc(u16 *refcheck, __u32 tags);
void cl_env_put(struct lu_env *env, u16 *refcheck);
unsigned int cl_env_cache_purge(unsigned int nr);
struct lu_env *cl_env_percpu_get(void);
void cl_env_percpu_put(struct lu_env *env);
+8 −8
Original line number Diff line number Diff line
@@ -1159,7 +1159,7 @@ static ssize_t ll_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
	struct lu_env      *env;
	struct vvp_io_args *args;
	ssize_t	     result;
	int		 refcheck;
	u16 refcheck;

	env = cl_env_get(&refcheck);
	if (IS_ERR(env))
@@ -1183,7 +1183,7 @@ static ssize_t ll_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
	struct lu_env      *env;
	struct vvp_io_args *args;
	ssize_t	     result;
	int		 refcheck;
	u16 refcheck;

	env = cl_env_get(&refcheck);
	if (IS_ERR(env))
@@ -1340,7 +1340,7 @@ static int ll_file_getstripe(struct inode *inode,
			     struct lov_user_md __user *lum)
{
	struct lu_env *env;
	int refcheck;
	u16 refcheck;
	int rc;

	env = cl_env_get(&refcheck);
@@ -1517,7 +1517,7 @@ static int ll_do_fiemap(struct inode *inode, struct fiemap *fiemap,
{
	struct ll_fiemap_info_key fmkey = { .lfik_name = KEY_FIEMAP, };
	struct lu_env *env;
	int refcheck;
	u16 refcheck;
	int rc = 0;

	/* Checks for fiemap flags */
@@ -1623,7 +1623,7 @@ int ll_data_version(struct inode *inode, __u64 *data_version, int flags)
	struct cl_object *obj = ll_i2info(inode)->lli_clob;
	struct lu_env *env;
	struct cl_io *io;
	int refcheck;
	u16 refcheck;
	int result;

	/* If no file object initialized, we consider its version is 0. */
@@ -1668,7 +1668,7 @@ int ll_hsm_release(struct inode *inode)
	struct obd_client_handle *och = NULL;
	__u64 data_version = 0;
	int rc;
	int refcheck;
	u16 refcheck;

	CDEBUG(D_INODE, "%s: Releasing file "DFID".\n",
	       ll_get_fsname(inode->i_sb, NULL, 0),
@@ -2324,7 +2324,7 @@ int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
	struct cl_io *io;
	struct cl_fsync_io *fio;
	int result;
	int refcheck;
	u16 refcheck;

	if (mode != CL_FSYNC_NONE && mode != CL_FSYNC_LOCAL &&
	    mode != CL_FSYNC_DISCARD && mode != CL_FSYNC_ALL)
@@ -3272,7 +3272,7 @@ int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf)
	struct cl_object *obj = lli->lli_clob;
	struct lu_env *env;
	int rc;
	int refcheck;
	u16 refcheck;

	if (!obj)
		return 0;
+2 −2
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
}

static int cl_io_get(struct inode *inode, struct lu_env **envout,
		     struct cl_io **ioout, int *refcheck)
		     struct cl_io **ioout, u16 *refcheck)
{
	struct lu_env	  *env;
	struct cl_io	   *io;
@@ -178,7 +178,7 @@ int cl_glimpse_size0(struct inode *inode, int agl)
	struct lu_env	  *env = NULL;
	struct cl_io	   *io  = NULL;
	int		     result;
	int		     refcheck;
	u16 refcheck;

	result = cl_io_get(inode, &env, &io, &refcheck);
	if (result > 0) {
+4 −4
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@
 * mutex.
 */
struct lu_env *cl_inode_fini_env;
int cl_inode_fini_refcheck;
u16 cl_inode_fini_refcheck;

/**
 * A mutex serializing calls to slp_inode_fini() under extreme memory
@@ -86,7 +86,7 @@ int cl_setattr_ost(struct cl_object *obj, const struct iattr *attr,
	struct lu_env *env;
	struct cl_io  *io;
	int	    result;
	int	    refcheck;
	u16 refcheck;

	env = cl_env_get(&refcheck);
	if (IS_ERR(env))
@@ -149,7 +149,7 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
		}
	};
	int result = 0;
	int refcheck;
	u16 refcheck;

	LASSERT(md->body->mbo_valid & OBD_MD_FLID);
	LASSERT(S_ISREG(inode->i_mode));
@@ -237,7 +237,7 @@ void cl_inode_fini(struct inode *inode)
	struct lu_env	   *env;
	struct ll_inode_info    *lli  = ll_i2info(inode);
	struct cl_object	*clob = lli->lli_clob;
	int refcheck;
	u16 refcheck;
	int emergency;

	if (clob) {
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
	struct cl_lock	 *lock;
	struct cl_lock_descr   *descr;
	__u32		   enqflags;
	int		     refcheck;
	u16 refcheck;
	int		     rc;

	env = cl_env_get(&refcheck);
Loading