Whamcloud - gitweb
LU-5053 ptlrpc: Add schedule point to ptlrpc_check_set() 58/10358/3
authorChristopher J. Morrone <morrone2@llnl.gov>
Wed, 4 Jun 2014 02:11:47 +0000 (19:11 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 11 Jun 2014 02:48:01 +0000 (02:48 +0000)
commitcce8026929381e85e4e51b089b81980213f010fe
treeffb5737e31e1d1aa9f1afeaa7d8a0580816715b1
parent54abe281c91edc1e564afbb233779418b887e625
LU-5053 ptlrpc: Add schedule point to ptlrpc_check_set()

Most ptlrpc sets are believed to be small and bounded in length.  However
at the very least the ptlrpcd reuses the ptlrpc sets at its primary work
queue.  This work queue can easily have work added faster than the ptlrpcd
thread can process the work.  The unbounded work can lead to the ptlrpcd
monopolizing a CPU for hundreds of seconds.  Obviously a well-behaved
kernel function should obey the scheduler and share the processor.

We address that problem by inserting a cond_resched() at the top of the
main loop of ptlrpc_check_set().

Some have suggested putting the cond_resched() lower in the loop.  However,
the only current way to bound the number of loops that we exceed our
allocated run time is to put the call at the top of the loop.  Putting it
lower would allow an unknown number (and since it is unknown, it might be
excessively large at times) of cycles through the loop before a
resched is allowed.

Change-Id: If46a6e1af1d0fdae24af623045aaf902a04fc589
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/10358
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
lustre/ptlrpc/client.c