Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Mar 6, 2024
1 parent 8ba2f26 commit da3332b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
5 changes: 4 additions & 1 deletion downstairs/src/dynamometer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ pub async fn dynamometer(
.collect();

let io_operation_time = Instant::now();
region.region_write(&writes, JobId(1000), false).await?;
let pre = PrecomputedWrite::from_writes(&writes);
region
.region_write_pre(&writes, &pre, JobId(1000), false)
.await?;

total_io_time += io_operation_time.elapsed();
io_operations_sent += num_writes;
Expand Down
13 changes: 10 additions & 3 deletions downstairs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ pub async fn downstairs_import<P: AsRef<Path> + std::fmt::Debug>(
}

// We have no job ID, so it makes no sense for accounting.
region.region_write(&writes, JobId(0), false).await?;
let pre = PrecomputedWrite::from_writes(&writes);
region
.region_write_pre(&writes, &pre, JobId(0), false)
.await?;

assert_eq!(nblocks, pos);
assert_eq!(total, pos.bytes());
Expand Down Expand Up @@ -1164,9 +1167,13 @@ where
* │ │ │ │
* ┌────▼──┴─┐ message ┌┴──────┐ job ┌┴────────┐
* │resp_loop├──────────►│pf_task├─────────►│ dw_task │
* └─────────┘ channel └──┬────┘ channel └▲────────┘
* └──┬───▲──┘ channel └──┬────┘ channel └▲────────┘
* │ │ │ │
* defer│ │oneshot │ │
* ┌▼───┴┐ │ │
* │rayon│ add│work new│work
* └─────┘ │ │
* │ │
* add│work new│work
* per-connection │ │
* ========================= │ ============== │ ===============
* shared state ┌──▼────────────────┴────────────┐
Expand Down
6 changes: 5 additions & 1 deletion downstairs/src/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,10 @@ impl Region {
Ok(result)
}

/// Perform a region write, without precomputed data
///
/// This is only allowed in unit tests
#[cfg(test)]
#[instrument]
pub async fn region_write(
&mut self,
Expand Down Expand Up @@ -821,7 +825,7 @@ impl Region {
let extent = self.get_opened_extent_mut(*eid);
let (writes, ctxs) = batched_writes.get(eid).unwrap();
extent
.write(job_id, &writes, &ctxs, only_write_unwritten)
.write(job_id, writes, ctxs, only_write_unwritten)
.await?;
}

Expand Down

0 comments on commit da3332b

Please sign in to comment.