@@ -1543,6 +1543,8 @@ struct ptlrpc_service_part {
* threads starting & stopping are also protected by this lock.
*/
spinlock_t scp_lock __cfs_cacheline_aligned;
+ /* userland serialization */
+ struct mutex scp_mutex;
/** total # req buffer descs allocated */
int scp_nrqbds_total;
/** # posted request buffers for receiving */
@@ -869,10 +869,12 @@ struct ptlrpc_srh_iterator {
if (i > cpt) /* make up the lowest position for this CPT */
*pos = PTLRPC_REQ_CPT2POS(svc, i);
+ mutex_lock(&svcpt->scp_mutex);
spin_lock(&svcpt->scp_lock);
rc = ptlrpc_lprocfs_svc_req_history_seek(svcpt, srhi,
PTLRPC_REQ_POS2SEQ(svc, *pos));
spin_unlock(&svcpt->scp_lock);
+ mutex_unlock(&svcpt->scp_mutex);
if (rc == 0) {
*pos = PTLRPC_REQ_SEQ2POS(svc, srhi->srhi_seq);
srhi->srhi_idx = i;
@@ -914,9 +916,11 @@ struct ptlrpc_srh_iterator {
seq = srhi->srhi_seq + (1 << svc->srv_cpt_bits);
}
+ mutex_lock(&svcpt->scp_mutex);
spin_lock(&svcpt->scp_lock);
rc = ptlrpc_lprocfs_svc_req_history_seek(svcpt, srhi, seq);
spin_unlock(&svcpt->scp_lock);
+ mutex_unlock(&svcpt->scp_mutex);
if (rc == 0) {
*pos = PTLRPC_REQ_SEQ2POS(svc, srhi->srhi_seq);
srhi->srhi_idx = i;
@@ -940,6 +944,7 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter)
svcpt = svc->srv_parts[srhi->srhi_idx];
+ mutex_lock(&svcpt->scp_mutex);
spin_lock(&svcpt->scp_lock);
rc = ptlrpc_lprocfs_svc_req_history_seek(svcpt, srhi, srhi->srhi_seq);
@@ -980,6 +985,8 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter)
}
spin_unlock(&svcpt->scp_lock);
+ mutex_unlock(&svcpt->scp_mutex);
+
return rc;
}
@@ -471,6 +471,7 @@ static void ptlrpc_at_timer(struct timer_list *t)
/* rqbd and incoming request queue */
spin_lock_init(&svcpt->scp_lock);
+ mutex_init(&svcpt->scp_mutex);
INIT_LIST_HEAD(&svcpt->scp_rqbd_idle);
INIT_LIST_HEAD(&svcpt->scp_rqbd_posted);
INIT_LIST_HEAD(&svcpt->scp_req_incoming);