cope with backing store writeout making no progress

This commit is contained in:
Vincent Sanders 2014-12-01 11:32:33 +00:00
parent ba5ade87b2
commit c9ee49baa8

View File

@ -2411,7 +2411,10 @@ static void llcache_persist(void *p)
/* obtained a candidate list, make each object persistant in turn */
for (idx = 0; idx < lst_count; idx++) {
ret = write_backing_store(lst[idx], &written, &elapsed);
if (ret == NSERROR_OK) {
if (ret != NSERROR_OK) {
continue;
}
/* sucessfully wrote object to backing store */
total_written += written;
total_elapsed += elapsed;
@ -2461,13 +2464,18 @@ static void llcache_persist(void *p)
}
break;
}
}
}
free(lst);
/* Completed list without running out of allowed bytes or time */
if (idx == lst_count) {
LOG(("Completed writeout list"));
/* only reschedule if writing is making any progress at all */
if (total_written > 0) {
next = llcache->time_quantum - total_elapsed;
} else {
next = -1;
}
}
LOG(("writeout size:%d time:%d bandwidth:%dbytes/s",