Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa0352f0 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman
Browse files

staging/lustre/ldlm: remove server-side congested locks support



This code only makes sense on the server, also while we are at it
drop registration of server-side procfs values and
as all client side values were already moved to sysfs - also
drop now unused procfs helpers.

Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c841236d
Loading
Loading
Loading
Loading
+0 −42
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ extern struct kset *ldlm_svc_kset;

#define LDLM_DEFAULT_LRU_SIZE (100 * num_online_cpus())
#define LDLM_DEFAULT_MAX_ALIVE (cfs_time_seconds(36000))
#define LDLM_CTIME_AGE_LIMIT (10)
#define LDLM_DEFAULT_PARALLEL_AST_LIMIT 1024

/**
@@ -305,14 +304,6 @@ typedef enum {
	LDLM_NAMESPACE_MODEST = 1 << 1
} ldlm_appetite_t;

/**
 * Default values for the "max_nolock_size", "contention_time" and
 * "contended_locks" namespace tunables.
 */
#define NS_DEFAULT_MAX_NOLOCK_BYTES 0
#define NS_DEFAULT_CONTENTION_SECONDS 2
#define NS_DEFAULT_CONTENDED_LOCKS 32

struct ldlm_ns_bucket {
	/** back pointer to namespace */
	struct ldlm_namespace      *nsb_namespace;
@@ -424,18 +415,6 @@ struct ldlm_namespace {
	unsigned int		ns_max_unused;
	/** Maximum allowed age (last used time) for locks in the LRU */
	unsigned int		ns_max_age;
	/**
	 * Server only: number of times we evicted clients due to lack of reply
	 * to ASTs.
	 */
	unsigned int		ns_timeouts;
	/**
	 * Number of seconds since the file change time after which the
	 * MDT will return an UPDATE lock along with a LOOKUP lock.
	 * This allows the client to start caching negative dentries
	 * for a directory and may save an RPC for a later stat.
	 */
	unsigned int		ns_ctime_age_limit;

	/**
	 * Used to rate-limit ldlm_namespace_dump calls.
@@ -469,27 +448,6 @@ struct ldlm_namespace {
	/** Definition of how eagerly unused locks will be released from LRU */
	ldlm_appetite_t		ns_appetite;

	/**
	 * If more than \a ns_contended_locks are found, the resource is
	 * considered to be contended. Lock enqueues might specify that no
	 * contended locks should be granted
	 */
	unsigned		ns_contended_locks;

	/**
	 * The resources in this namespace remember contended state during
	 * \a ns_contention_time, in seconds.
	 */
	unsigned		ns_contention_time;

	/**
	 * Limit size of contended extent locks, in bytes.
	 * If extended lock is requested for more then this many bytes and
	 * caller instructs us not to grant contended locks, we would disregard
	 * such a request.
	 */
	unsigned		ns_max_nolock_size;

	/** Limit of parallel AST RPC count. */
	unsigned		ns_max_parallel_ast;

+0 −38
Original line number Diff line number Diff line
@@ -80,7 +80,6 @@ static ssize_t lprocfs_wr_dump_ns(struct file *file, const char __user *buffer,
LPROC_SEQ_FOPS_WR_ONLY(ldlm, dump_ns);

LPROC_SEQ_FOPS_RW_TYPE(ldlm_rw, uint);
LPROC_SEQ_FOPS_RO_TYPE(ldlm, uint);

int ldlm_proc_setup(void)
{
@@ -388,15 +387,6 @@ void ldlm_namespace_sysfs_unregister(struct ldlm_namespace *ns)
	wait_for_completion(&ns->ns_kobj_unregister);
}

#define LDLM_NS_ADD_VAR(name, var, ops)				\
	do {							\
		snprintf(lock_name, MAX_STRING_SIZE, name);	\
		lock_vars[0].data = var;			\
		lock_vars[0].fops = ops;			\
		lprocfs_add_vars(ns_pde, lock_vars, NULL);	\
	} while (0)


int ldlm_namespace_sysfs_register(struct ldlm_namespace *ns)
{
	int err;
@@ -420,8 +410,6 @@ int ldlm_namespace_sysfs_register(struct ldlm_namespace *ns)

int ldlm_namespace_proc_register(struct ldlm_namespace *ns)
{
	struct lprocfs_vars lock_vars[2];
	char lock_name[MAX_STRING_SIZE + 1];
	struct proc_dir_entry *ns_pde;

	LASSERT(ns != NULL);
@@ -436,26 +424,6 @@ int ldlm_namespace_proc_register(struct ldlm_namespace *ns)
		ns->ns_proc_dir_entry = ns_pde;
	}

	lock_name[MAX_STRING_SIZE] = '\0';

	memset(lock_vars, 0, sizeof(lock_vars));
	lock_vars[0].name = lock_name;

	if (ns_is_client(ns)) {
	} else {
		LDLM_NS_ADD_VAR("ctime_age_limit", &ns->ns_ctime_age_limit,
				&ldlm_rw_uint_fops);
		LDLM_NS_ADD_VAR("lock_timeouts", &ns->ns_timeouts,
				&ldlm_uint_fops);
		LDLM_NS_ADD_VAR("max_nolock_bytes", &ns->ns_max_nolock_size,
				&ldlm_rw_uint_fops);
		LDLM_NS_ADD_VAR("contention_seconds", &ns->ns_contention_time,
				&ldlm_rw_uint_fops);
		LDLM_NS_ADD_VAR("contended_locks", &ns->ns_contended_locks,
				&ldlm_rw_uint_fops);
		LDLM_NS_ADD_VAR("max_parallel_ast", &ns->ns_max_parallel_ast,
				&ldlm_rw_uint_fops);
	}
	return 0;
}
#undef MAX_STRING_SIZE
@@ -698,16 +666,10 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
	atomic_set(&ns->ns_bref, 0);
	init_waitqueue_head(&ns->ns_waitq);

	ns->ns_max_nolock_size    = NS_DEFAULT_MAX_NOLOCK_BYTES;
	ns->ns_contention_time    = NS_DEFAULT_CONTENTION_SECONDS;
	ns->ns_contended_locks    = NS_DEFAULT_CONTENDED_LOCKS;

	ns->ns_max_parallel_ast   = LDLM_DEFAULT_PARALLEL_AST_LIMIT;
	ns->ns_nr_unused	  = 0;
	ns->ns_max_unused	 = LDLM_DEFAULT_LRU_SIZE;
	ns->ns_max_age	    = LDLM_DEFAULT_MAX_ALIVE;
	ns->ns_ctime_age_limit    = LDLM_CTIME_AGE_LIMIT;
	ns->ns_timeouts	   = 0;
	ns->ns_orig_connect_flags = 0;
	ns->ns_connect_flags      = 0;
	ns->ns_stopping	   = 0;