From b7008e545576f7596376b17699ed6a1ad81e79d6 Mon Sep 17 00:00:00 2001 From: vitaly Date: Tue, 18 Nov 2008 21:40:17 +0000 Subject: [PATCH] Branch b1_8_gate b=16129 i=adilger i=green - a high priority request list is added into service; - once a lock is canceled, all the IO requests, including coming ones, under this lock, are moved into this list; - PING is also added into this list; - once a lock cancel timeout occurs, the timeout is prolonged if there is an IO rpc under this lock; - another request list is added into the export, used to speed up the rpc-lock matching. --- lustre/ptlrpc/lproc_ptlrpc.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index 2720061..bda9d8e 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -508,6 +508,32 @@ static int ptlrpc_lprocfs_rd_timeouts(char *page, char **start, off_t off, return rc; } +static int ptlrpc_lprocfs_rd_hp_ratio(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct ptlrpc_service *svc = data; + int rc = snprintf(page, count, "%d", svc->srv_hpreq_ratio); + return rc; +} + +static int ptlrpc_lprocfs_wr_hp_ratio(struct file *file, const char *buffer, + unsigned long count, void *data) +{ + struct ptlrpc_service *svc = data; + int rc, val; + + rc = lprocfs_write_helper(buffer, count, &val); + if (rc < 0) + return rc; + if (val < 0) + return -ERANGE; + + spin_lock(&svc->srv_lock); + svc->srv_hpreq_ratio = val; + spin_unlock(&svc->srv_lock); + return count; +} + void ptlrpc_lprocfs_register_service(struct proc_dir_entry *entry, struct ptlrpc_service *svc) { @@ -523,6 +549,10 @@ void ptlrpc_lprocfs_register_service(struct proc_dir_entry *entry, {.name = "timeouts", .read_fptr = ptlrpc_lprocfs_rd_timeouts, .data = svc}, + {.name = "high_priority_ratio", + .read_fptr = ptlrpc_lprocfs_rd_hp_ratio, + .write_fptr = ptlrpc_lprocfs_wr_hp_ratio, + .data = svc}, {NULL} }; static struct file_operations req_history_fops = { -- 1.8.3.1