diff --git a/ocf b/ocf index 916713b2f..286f4c0da 160000 --- a/ocf +++ b/ocf @@ -1 +1 @@ -Subproject commit 916713b2fb6e68ac5594b5071e73226ff41031dc +Subproject commit 286f4c0da78114a7a1e0e77c43d6352598ba9592 diff --git a/test/functional/api/cas/cli_messages.py b/test/functional/api/cas/cli_messages.py index 12488c7fd..6d9b04b47 100644 --- a/test/functional/api/cas/cli_messages.py +++ b/test/functional/api/cas/cli_messages.py @@ -88,7 +88,7 @@ get_stats_ioclass_id_not_configured = [r"IO class \d+ is not configured\."] -get_stats_ioclass_id_out_of_range = [r"Invalid IO class id, must be in the range 0-32\."] +get_stats_ioclass_id_out_of_range = [r"Invalid IO class id, must be in the range 0-33\."] remove_multilevel_core = [ r"Error while removing core device \d+ from cache instance \d+", @@ -240,7 +240,7 @@ ] illegal_io_class_invalid_id_number = [ - r"Invalid id, must be in the range 0-32\.\n" + r"Invalid id, must be in the range 0-33\.\n" r"Cannot parse configuration file - error in line 2 in column 1 \(IO class id\)\." ] diff --git a/test/functional/api/cas/ioclass_config.py b/test/functional/api/cas/ioclass_config.py index 07e665270..d6a5594d5 100644 --- a/test/functional/api/cas/ioclass_config.py +++ b/test/functional/api/cas/ioclass_config.py @@ -20,7 +20,7 @@ default_config_file_path = TestRun.TEST_RUN_DATA_PATH + "/opencas_ioclass.conf" -MAX_IO_CLASS_ID = 32 +MAX_IO_CLASS_ID = 33 MAX_IO_CLASS_PRIORITY = 255 DEFAULT_IO_CLASS_ID = 0 DEFAULT_IO_CLASS_PRIORITY = 255 diff --git a/test/functional/api/cas/statistics.py b/test/functional/api/cas/statistics.py index 373a05a3b..fa029ba46 100644 --- a/test/functional/api/cas/statistics.py +++ b/test/functional/api/cas/statistics.py @@ -191,6 +191,7 @@ def __init__(self, stats_dict): self.write_policy = stats_dict["Write Policy"] self.cleaning_policy = stats_dict["Cleaning Policy"] self.promotion_policy = stats_dict["Promotion Policy"] + self.prefetch_policy = stats_dict["Prefetch Policy"] self.cache_line_size = parse_value( value=stats_dict["Cache line size [KiB]"], unit_type=UnitType.kibibyte ) @@ -213,6 +214,7 @@ def __init__(self, stats_dict): del stats_dict["Write Policy"] del stats_dict["Cleaning Policy"] del stats_dict["Promotion Policy"] + del stats_dict["Prefetch Policy"] del stats_dict["Cache line size [KiB]"] del stats_dict[footprint_key] del stats_dict["Dirty for [s]"] @@ -231,6 +233,7 @@ def __str__(self): f"Write Policy: {self.write_policy}\n" f"Cleaning Policy: {self.cleaning_policy}\n" f"Promotion Policy: {self.promotion_policy}\n" + f"Prefetch Policy: {self.prefetch_policy}\n" f"Cache line size: {self.cache_line_size}\n" f"Metadata memory footprint: {self.metadata_memory_footprint}\n" f"Dirty for: {self.dirty_for}\n" @@ -250,6 +253,7 @@ def __eq__(self, other): and self.write_policy == other.write_policy and self.cleaning_policy == other.cleaning_policy and self.promotion_policy == other.promotion_policy + and self.prefetch_policy == other.prefetch_policy and self.cache_line_size == other.cache_line_size and self.metadata_memory_footprint == other.metadata_memory_footprint and self.dirty_for == other.dirty_for @@ -474,6 +478,15 @@ def __init__(self, stats_dict, percentage_val: bool = False): self.requests_serviced = parse_value( value=stats_dict[f"Serviced requests {unit}"], unit_type=unit ) + self.prefetch_readahead = parse_value( + value=stats_dict[f"Prefetch: readahead {unit}"], unit_type=unit + ) + self.cleaner = parse_value( + value=stats_dict[f"Cleaner {unit}"], unit_type=unit + ) + self.requests_user = parse_value( + value=stats_dict[f"User requests {unit}"], unit_type=unit + ) self.requests_total = parse_value( value=stats_dict[f"Total requests {unit}"], unit_type=unit ) @@ -488,6 +501,9 @@ def __init__(self, stats_dict, percentage_val: bool = False): del stats_dict[f"Pass-Through reads {unit}"] del stats_dict[f"Pass-Through writes {unit}"] del stats_dict[f"Serviced requests {unit}"] + del stats_dict[f"Prefetch: readahead {unit}"] + del stats_dict[f"Cleaner {unit}"] + del stats_dict[f"User requests {unit}"] del stats_dict[f"Total requests {unit}"] def __str__(self): @@ -498,6 +514,9 @@ def __str__(self): f"Pass-through reads: {self.pass_through_reads}\n" f"Pass-through writes: {self.pass_through_writes}\n" f"Serviced requests: {self.requests_serviced}\n" + f"Prefetch readahead: {self.prefetch_readahead}\n" + f"Cleaner: {self.cleaner}\n" + f"User requests: {self.requests_user}\n" f"Total requests: {self.requests_total}\n" ) @@ -510,6 +529,9 @@ def __eq__(self, other): and self.pass_through_reads == other.pass_through_reads and self.pass_through_writes == other.pass_through_writes and self.requests_serviced == other.requests_serviced + and self.prefetch_readahead == other.prefetch_readahead + and self.cleaner == other.cleaner + and self.requests_user == other.requests_user and self.requests_total == other.requests_total ) @@ -522,6 +544,9 @@ def __add__(self, other): stats.pass_through_reads = self.pass_through_reads + other.pass_through_reads stats.pass_through_writes = self.pass_through_writes + other.pass_through_writes stats.requests_serviced = self.requests_serviced + other.requests_serviced + stats.prefetch_readahead = self.prefetch_readahead + other.prefetch_readahead + stats.cleaner = self.cleaner + other.cleaner + stats.requests_user = self.requests_user + other.requests_user stats.requests_total = self.requests_total + other.requests_total return stats @@ -544,6 +569,9 @@ def zero(cls, percentage_val: bool = False): f"Pass-Through reads {unit}" : 0, f"Pass-Through writes {unit}" : 0, f"Serviced requests {unit}" : 0, + f"Prefetch: readahead {unit}" : 0, + f"Cleaner {unit}" : 0, + f"User requests {unit}" : 0, f"Total requests {unit}" : 0, }) return cls(stats_dict, percentage_val) @@ -613,11 +641,29 @@ def __init__(self, stats_dict, percentage_val: bool = False): device="exported object", ) + unit = UnitType.percentage if percentage_val else UnitType.block_4k + self.prefetch_core_reads_readahead = parse_value( + value=stats_dict[f"Prefetch core reads: readahead {unit}"], unit_type=unit + ) + self.prefetch_cache_writes_readahead = parse_value( + value=stats_dict[f"Prefetch cache writes: readahead {unit}"], unit_type=unit + ) + self.cleaner_cache_reads = parse_value( + value=stats_dict[f"Cleaner cache reads {unit}"], unit_type=unit + ) + self.cleaner_core_writes = parse_value( + value=stats_dict[f"Cleaner core writes {unit}"], unit_type=unit + ) + for unit in [UnitType.percentage, UnitType.block_4k]: for device in ["core", "cache", "exported object"]: del stats_dict[f"Reads from {device} {unit}"] del stats_dict[f"Writes to {device} {unit}"] del stats_dict[f"Total to/from {device} {unit}"] + del stats_dict[f"Prefetch core reads: readahead {unit}"] + del stats_dict[f"Prefetch cache writes: readahead {unit}"] + del stats_dict[f"Cleaner cache reads {unit}"] + del stats_dict[f"Cleaner core writes {unit}"] def __str__(self): return ( @@ -625,13 +671,23 @@ def __str__(self): f"Core(s):\n{self.core}" f"Cache:\n{self.cache}" f"Exported object(s):\n{self.exp_obj}" + f"Prefetch core reads (readahead): {self.prefetch_core_reads_readahead}\n" + f"Prefetch cache writes (readahead): {self.prefetch_cache_writes_readahead}\n" + f"Cleaner cache reads: {self.cleaner_cache_reads}\n" + f"Cleaner core writes: {self.cleaner_core_writes}\n" ) def __eq__(self, other): if not other: return False return ( - self.core == other.core and self.cache == other.cache and self.exp_obj == other.exp_obj + self.core == other.core + and self.cache == other.cache + and self.exp_obj == other.exp_obj + and self.prefetch_core_reads_readahead == other.prefetch_core_reads_readahead + and self.prefetch_cache_writes_readahead == other.prefetch_cache_writes_readahead + and self.cleaner_cache_reads == other.cleaner_cache_reads + and self.cleaner_core_writes == other.cleaner_core_writes ) def __add__(self, other): @@ -641,6 +697,14 @@ def __add__(self, other): stats.core = self.core + other.core stats.cache = self.cache + other.cache stats.exp_obj = self.exp_obj + other.exp_obj + stats.prefetch_core_reads_readahead = ( + self.prefetch_core_reads_readahead + other.prefetch_core_reads_readahead + ) + stats.prefetch_cache_writes_readahead = ( + self.prefetch_cache_writes_readahead + other.prefetch_cache_writes_readahead + ) + stats.cleaner_cache_reads = self.cleaner_cache_reads + other.cleaner_cache_reads + stats.cleaner_core_writes = self.cleaner_core_writes + other.cleaner_core_writes return stats def __iter__(self): @@ -656,6 +720,12 @@ def zero(cls, percentage_val: bool = False): f"Writes to {device} {unit}" : 0, f"Total to/from {device} {unit}" : 0, }) + stats_dict.update({ + f"Prefetch core reads: readahead {unit}" : 0, + f"Prefetch cache writes: readahead {unit}" : 0, + f"Cleaner cache reads {unit}" : 0, + f"Cleaner core writes {unit}" : 0, + }) return cls(stats_dict, percentage_val) diff --git a/test/functional/tests/stats/test_display_statistics.py b/test/functional/tests/stats/test_display_statistics.py index fd5714180..ad164e176 100644 --- a/test/functional/tests/stats/test_display_statistics.py +++ b/test/functional/tests/stats/test_display_statistics.py @@ -71,6 +71,12 @@ "Pass-Through writes [%]", "Serviced requests [Requests]", "Serviced requests [%]", + "Prefetch: readahead [Requests]", + "Prefetch: readahead [%]", + "Cleaner [Requests]", + "Cleaner [%]", + "User requests [Requests]", + "User requests [%]", "Total requests [Requests]", "Total requests [%]" ] @@ -93,7 +99,15 @@ "Writes to exported object [4KiB Blocks]", "Writes to exported object [%]", "Total to/from exported object [4KiB Blocks]", - "Total to/from exported object [%]" + "Total to/from exported object [%]", + "Prefetch core reads: readahead [4KiB Blocks]", + "Prefetch core reads: readahead [%]", + "Prefetch cache writes: readahead [4KiB Blocks]", + "Prefetch cache writes: readahead [%]", + "Cleaner cache reads [4KiB Blocks]", + "Cleaner cache reads [%]", + "Cleaner core writes [4KiB Blocks]", + "Cleaner core writes [%]" ] error_stats = [ diff --git a/test/functional/tests/stats/test_ioclass_stats.py b/test/functional/tests/stats/test_ioclass_stats.py index 9ae78e7e9..971fce787 100644 --- a/test/functional/tests/stats/test_ioclass_stats.py +++ b/test/functional/tests/stats/test_ioclass_stats.py @@ -76,6 +76,12 @@ "Pass-Through writes [%]", "Serviced requests [Requests]", "Serviced requests [%]", + "Prefetch: readahead [Requests]", + "Prefetch: readahead [%]", + "Cleaner [Requests]", + "Cleaner [%]", + "User requests [Requests]", + "User requests [%]", "Total requests [Requests]", "Total requests [%]" ] @@ -98,7 +104,15 @@ "Writes to exported object [4KiB Blocks]", "Writes to exported object [%]", "Total to/from exported object [4KiB Blocks]", - "Total to/from exported object [%]" + "Total to/from exported object [%]", + "Prefetch core reads: readahead [4KiB Blocks]", + "Prefetch core reads: readahead [%]", + "Prefetch cache writes: readahead [4KiB Blocks]", + "Prefetch cache writes: readahead [%]", + "Cleaner cache reads [4KiB Blocks]", + "Cleaner cache reads [%]", + "Cleaner core writes [4KiB Blocks]", + "Cleaner core writes [%]" ] @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))