Skip to content

Commit

Permalink
DLPX-80617 zcache hits panic after adding tiny disk (openzfs#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaybee authored Apr 13, 2022
1 parent f519e9e commit fc3711a
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions cmd/zfs_object_agent/zcache/src/hits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ impl SizeHistogram {
/// chunks and then adding the number of samples for the physical cache in the
/// original histogram of these chunks together for each bucket in the new histogram.
fn resample(&self, samples_in_capacity: usize, histogram: &[u64]) -> Vec<u64> {
// Given the desired number of samples for the cache capacity portion of the histogram,
// calculate the total number of samples needed for the capacity covered by the histogram.
let resample_bucket_size = self.cache_capacity / samples_in_capacity as u64;
let target_samples = (histogram.len() as f64 * self.bucket_size as f64
/ resample_bucket_size as f64)
.ceil()
.to_usize()
.unwrap();

let sub_samples_per_resample = usize::from64(self.cache_capacity / self.bucket_size);
let mut sample_iter = histogram.iter();
let mut sub_sample_value = 0.0;
Expand All @@ -75,7 +66,6 @@ impl SizeHistogram {
}
resample.push(accumulated_value.round().to_u64().unwrap());
}
assert_eq!(resample.len(), target_samples);
resample
}

Expand Down

0 comments on commit fc3711a

Please sign in to comment.