General packing of structs

Get back some memory/cachelines by packing any leftover static fields together.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
This commit is contained in:
Kozlowski Mateusz
2021-03-15 14:45:59 +01:00
parent 642527d72a
commit fdd6b88cc4
16 changed files with 90 additions and 87 deletions

View File

@@ -199,8 +199,8 @@ struct ocf_metadata_load_properties {
enum ocf_metadata_shutdown_status shutdown_status;
uint8_t dirty_flushed;
ocf_metadata_layout_t layout;
ocf_cache_line_size_t line_size;
ocf_cache_mode_t cache_mode;
ocf_cache_line_size_t line_size;
char *cache_name;
};

View File

@@ -14,8 +14,6 @@ struct ocf_user_part_config {
char name[OCF_IO_CLASS_NAME_MAX];
uint32_t min_size;
uint32_t max_size;
int16_t priority;
ocf_cache_mode_t cache_mode;
struct {
uint8_t valid : 1;
uint8_t added : 1;
@@ -24,6 +22,8 @@ struct ocf_user_part_config {
* and means that can evict from this partition
*/
} flags;
int16_t priority;
ocf_cache_mode_t cache_mode;
};
struct ocf_user_part_runtime {
@@ -40,12 +40,12 @@ typedef bool ( *_lru_hash_locked_pfn)(struct ocf_request *req,
in round robin order */
struct ocf_lru_iter
{
/* per-partition cacheline iterator */
ocf_cache_line_t curr_cline[OCF_NUM_EVICTION_LISTS];
/* cache object */
ocf_cache_t cache;
/* target partition */
struct ocf_user_part *part;
/* per-partition cacheline iterator */
ocf_cache_line_t curr_cline[OCF_NUM_EVICTION_LISTS];
/* available (non-empty) eviction list bitmap rotated so that current
@evp is on the most significant bit */
unsigned long long next_avail_evp;

View File

@@ -20,6 +20,10 @@ struct ocf_superblock_config {
* shouldn't change!! */
uint8_t clean_shutdown;
uint8_t dirty_flushed;
/* Current core sequence number */
ocf_core_id_t curr_core_seq_no;
uint32_t magic_number;
uint32_t metadata_version;
@@ -47,9 +51,6 @@ struct ocf_superblock_config {
ocf_eviction_t eviction_policy_type;
/* Current core sequence number */
ocf_core_id_t curr_core_seq_no;
/*
* Checksum for each metadata region.
* This field has to be the last one!