AC_MSG_WARN([libaio is not installed in the system]))
]) # LC_HAVE_LIBAIO
-AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
-LB_CHECK_COMPILE([if get_projid exists],
-get_projid, [
- struct inode;
- #include <linux/quota.h>
-],[
- struct dquot_operations ops = { };
-
- ops.get_projid(NULL, NULL);
-],[
- AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
- [get_projid function exists])
-])
-]) # LC_HAVE_PROJECT_QUOTA
-
-AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
-LB_CHECK_COMPILE([if get_inode_usage exists],
-get_inode_usage, [
- struct inode;
- #include <linux/quota.h>
-],[
- struct dquot_operations ops = { };
-
- ops.get_inode_usage(NULL, NULL);
-],[
- AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
- [get_inode_usage function exists])
-])
-]) # LC_HAVE_GET_INODE_USAGE
-
#
# LC_INVALIDATE_RANGE
#
]) # LC_HAVE_BDI_CAP_MAP_COPY
#
+# LC_HAVE_PROJECT_QUOTA
+#
+# Kernel version v4.0-rc1-197-g847aac644e92
+#
+AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
+LB_CHECK_COMPILE([if get_projid exists],
+get_projid, [
+ struct inode;
+ #include <linux/quota.h>
+],[
+ struct dquot_operations ops = { };
+
+ ops.get_projid(NULL, NULL);
+],[
+ AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
+ [get_projid function exists])
+])
+]) # LC_HAVE_PROJECT_QUOTA
+
+#
# LC_IOV_ITER_RW
#
# 4.1 kernel has iov_iter_rw
]) # LC_LOCK_PAGE_MEMCG
#
+# LC_HAVE_DOWN_WRITE_KILLABLE
+#
+# Kernel version v4.6-rc3-28-g916633a40370
+#
+AC_DEFUN([LC_HAVE_DOWN_WRITE_KILLABLE], [
+LB_CHECK_COMPILE([if down_write_killable exists],
+down_write_killable, [
+ struct rw_semaphore sem;
+ #include <linux/rwsem.h>
+],[
+ int rc;
+
+ rc = down_write_killable(&sem);
+],[
+ AC_DEFINE(HAVE_DOWN_WRITE_KILLABLE, 1,
+ [down_write_killable function exists])
+])
+]) # LC_HAVE_DOWN_WRITE_KILLABLE
+
+#
# LC_D_INIT
#
# Kernel version 4.7-rc5 commit 285b102d3b745f3c2c110c9c327741d87e64aacc
]) # LIBCFS_CURRENT_TIME
#
+# LC_HAVE_GET_INODE_USAGE
+#
+# Kernel version v4.12-rc2-43-g7a9ca53aea10
+#
+AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
+LB_CHECK_COMPILE([if get_inode_usage exists],
+get_inode_usage, [
+ struct inode;
+ #include <linux/quota.h>
+],[
+ struct dquot_operations ops = { };
+
+ ops.get_inode_usage(NULL, NULL);
+],[
+ AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
+ [get_inode_usage function exists])
+])
+]) # LC_HAVE_GET_INODE_USAGE
+
+
+#
# Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
# changed struct super_block s_uuid into a proper uuid_t
#
LC_HAVE_IN_COMPAT_SYSCALL
LC_HAVE_XATTR_HANDLER_INODE_PARAM
LC_LOCK_PAGE_MEMCG
+ LC_HAVE_DOWN_WRITE_KILLABLE
# 4.7
LC_D_IN_LOOKUP
LASSERT(desc->ld_active_tgt_count > 0);
desc->ld_active_tgt_count--;
set_bit(LQ_DIRTY, <d->ltd_qos.lq_flags);
- set_bit(LQ_DIRTY, <d->ltd_qos.lq_rr.lqr_flags);
CDEBUG(D_CONFIG, "%s: turns inactive\n",
tgt->ltd_exp->exp_obd->obd_name);
}
tgt->ltd_connecting = 0;
desc->ld_active_tgt_count++;
set_bit(LQ_DIRTY, <d->ltd_qos.lq_flags);
- set_bit(LQ_DIRTY, <d->ltd_qos.lq_rr.lqr_flags);
CDEBUG(D_CONFIG, "%s: turns active\n",
tgt->ltd_exp->exp_obd->obd_name);
}
RETURN(rc);
}
- o = lod_qos_declare_object_on(env, lod, ost_idx, true, th);
+ o = lod_qos_declare_object_on(env, lod, ost_idx, (speed > 1), th);
if (IS_ERR(o)) {
CDEBUG(D_OTHER, "can't declare new object on #%u: %d\n",
ost_idx, (int) PTR_ERR(o));
RETURN(rc);
}
+#ifdef HAVE_DOWN_WRITE_KILLABLE
+struct semaphore_timer {
+ struct timer_list timer;
+ struct task_struct *task;
+};
+
+static void process_semaphore_timer(struct timer_list *t)
+{
+ struct semaphore_timer *timeout = cfs_from_timer(timeout, t, timer);
+
+ send_sig(SIGKILL, timeout->task, 1);
+}
+#endif
+
/**
* Calculate penalties per-ost in a pool
*
stripes_per_ost =
(lod_comp->llc_stripe_count - 1)/osts->op_count + 1;
+#ifdef HAVE_DOWN_WRITE_KILLABLE
+ if (!down_write_trylock(&lod->lod_ost_descs.ltd_qos.lq_rw_sem)) {
+ struct semaphore_timer timer;
+
+ kernel_sigaction(SIGKILL, SIG_DFL);
+ timer.task = current;
+ cfs_timer_setup(&timer.timer, process_semaphore_timer, 0, 0);
+ mod_timer(&timer.timer, jiffies + cfs_time_seconds(2));
+ /* Do actual allocation, use write lock here. */
+ rc = down_write_killable(&lod->lod_ost_descs.ltd_qos.lq_rw_sem);
+
+ del_singleshot_timer_sync(&timer.timer);
+ kernel_sigaction(SIGKILL, SIG_IGN);
+ if (rc) {
+ flush_signals(current);
+ QOS_DEBUG("%s: wakeup semaphore on timeout rc = %d\n",
+ lod2obd(lod)->obd_name, rc);
+ GOTO(out_nolock, rc = -EAGAIN);
+ }
+ }
+#else
/* Do actual allocation, use write lock here. */
down_write(&lod->lod_ost_descs.ltd_qos.lq_rw_sem);
-
+#endif
/*
* Check again, while we were sleeping on @lq_rw_sem things could
* change.