From: Alex Zhuravlev Date: Tue, 29 Aug 2017 12:08:42 +0000 (+0300) Subject: LU-9660 ptlrpc: do not wakeup every second X-Git-Tag: 2.10.3-RC1~41 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7faa2fec32b9d8a8f9dd646ca0b418c754cd8d0a;p=fs%2Flustre-release.git LU-9660 ptlrpc: do not wakeup every second Even if there are no RPC requests on the set, there is no need to wake up every second. The thread is woken up when a request is added to the set or when the STOP bit is set, so it is sufficient to only wake up when there are requests on the set to worry about. Lustre-change: https://review.whamcloud.com/28776 Lustre-commit: e81847bd06519dd9847c31244abe6da978bcd016 Change-Id: Iac01d8c46e8645ecb6303ce72e0f6c59f16dcd5d Signed-off-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Reviewed-by: Patrick Farrell Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/29969 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond --- diff --git a/lustre/ptlrpc/ptlrpcd.c b/lustre/ptlrpc/ptlrpcd.c index f305739..0532c4d 100644 --- a/lustre/ptlrpc/ptlrpcd.c +++ b/lustre/ptlrpc/ptlrpcd.c @@ -413,7 +413,7 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc) } } - RETURN(rc); + RETURN(rc || test_bit(LIOD_STOP, &pc->pc_flags)); } /** @@ -479,8 +479,8 @@ static int ptlrpcd(void *arg) int timeout; timeout = ptlrpc_set_next_timeout(set); - lwi = LWI_TIMEOUT(cfs_time_seconds(timeout ? timeout : 1), - ptlrpc_expired_set, set); + lwi = LWI_TIMEOUT(cfs_time_seconds(timeout), + ptlrpc_expired_set, set); lu_context_enter(&env.le_ctx); lu_context_enter(env.le_ses);