Skip to content

Commit

Permalink
Merge pull request #1353 from arutk/apf
Browse files Browse the repository at this point in the history
Fix ALRU wake up time test and documentation
  • Loading branch information
Robert Baldyga authored Sep 30, 2022
2 parents 485170e + f0a3981 commit 6af0c5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion casadm/cas_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ static struct cas_param cas_cache_params[] = {
#define CLEANING_POLICY_TYPE_DESC "Cleaning policy type. " \
"Available policy types: {nop|alru|acp}"

#define CLEANING_ALRU_WAKE_UP_DESC "Period of time between awakenings of flushing thread <%d-%d>[s] (default: %d s)"
#define CLEANING_ALRU_WAKE_UP_DESC "Cleaning thread sleep time after an idle wake up <%d-%d>[s] (default: %d s)"
#define CLEANING_ALRU_STALENESS_TIME_DESC "Time that has to pass from the last write operation before a dirty cache" \
" block can be scheduled to be flushed <%d-%d>[s] (default: %d s)"
#define CLEANING_ALRU_FLUSH_MAX_BUFFERS_DESC "Number of dirty cache blocks to be flushed in one cleaning cycle" \
Expand Down
4 changes: 3 additions & 1 deletion casadm/casadm.8
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ Identifier of cache instance <1-16384>.

.TP
.B -w, --wake-up <NUMBER>
Period of time between awakenings of flushing thread [s] (default: 20 s).
Cleaning thread sleep time after an idle wake up [s] (default: 20 s).
Idle wake up happens when there is no dirty data or the cleaning thread does not start cleaning
due to staleness time and/or activity threshold constraints.

.TP
.B -s, --staleness-time <NUMBER>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ def test_cleaning_policy_config():
f"Dirty data before pause: {core_dirty_before}\n"
f"Dirty data after pause: {core_dirty_after}"
)
elif core_dirty_before != core_dirty_after + data_to_flush:
# Only check whether a minimum amount of data is flushed, as ALRU does not have
# a configurable sleep time between active flushing iterations which would allow
# to precisely estimate expected amount of data.
elif core_dirty_before < core_dirty_after + data_to_flush:
TestRun.LOGGER.error(
f"Number of dirty blocks flushed differs from configured in policy.\n"
f"Expected dirty data flushed: {data_to_flush}\n"
f"Expected minimum dirty data flushed: {data_to_flush}\n"
f"Actual dirty data flushed: "
f"{core_dirty_before - core_dirty_after}"
)
Expand Down

0 comments on commit 6af0c5d

Please sign in to comment.