From cd5576319ad2ab71fdb2727ad6ac117b23a96bf4 Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Wed, 22 May 2013 17:04:44 -0700
Subject: [PATCH] sdiag documentation update

Fix minor bug in sdiag backfill scheduling time reported on Bluegene systems
Improve explanation of backfill scheduling cycle time calculation.
---
 doc/man/man1/sdiag.1                  | 13 ++++++++++---
 src/plugins/sched/backfill/backfill.c |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/doc/man/man1/sdiag.1 b/doc/man/man1/sdiag.1
index f4161b1b61c..3448cfc1ec3 100644
--- a/doc/man/man1/sdiag.1
+++ b/doc/man/man1/sdiag.1
@@ -125,12 +125,19 @@ Time when last execution cycle happened in format
 
 .TP
 \fBLast cycle\fR
-Time in microseconds of last backfilling cycle. It counts only execution time
-removing sleep time inside a scheduling cycle when it takes too much.
+Time in microseconds of last backfilling cycle.
+It counts only execution time removing sleep time inside a scheduling cycle
+when it takes too much time.
+Note that locks are released during the sleep time so that other work can
+proceed.
 
 .TP
 \fBMax cycle\fR
-Time in microseconds of maximum backfilling cycle execution since last reset
+Time in microseconds of maximum backfilling cycle execution since last reset.
+It counts only execution time removing sleep time inside a scheduling cycle
+when it takes too much time.
+Note that locks are released during the sleep time so that other work can
+proceed.
 
 .TP
 \fBMean cycle\fR
diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c
index 7c709ea6f28..a2c5f44e0ed 100644
--- a/src/plugins/sched/backfill/backfill.c
+++ b/src/plugins/sched/backfill/backfill.c
@@ -554,6 +554,7 @@ static int _attempt_backfill(void)
 	bool already_counted;
 	uint32_t reject_array_job_id = 0;
 
+	bf_last_yields = 0;
 #ifdef HAVE_CRAY
 	/*
 	 * Run a Basil Inventory immediately before setting up the schedule
@@ -597,7 +598,6 @@ static int _attempt_backfill(void)
 	slurmctld_diag_stats.bf_last_depth = 0;
 	slurmctld_diag_stats.bf_last_depth_try = 0;
 	slurmctld_diag_stats.bf_when_last_cycle = now;
-	bf_last_yields = 0;
 	slurmctld_diag_stats.bf_active = 1;
 
 	node_space = xmalloc(sizeof(node_space_map_t) *
-- 
GitLab