@@ -7,6 +7,7 @@ use std::{
7
7
} ;
8
8
9
9
use crate :: {
10
+ backpressure:: BackpressureGuard ,
10
11
cdt,
11
12
client:: { ClientAction , ClientStopReason , DownstairsClient } ,
12
13
guest:: GuestWork ,
@@ -1822,6 +1823,7 @@ impl Downstairs {
1822
1823
GuestWorkId ( 10 ) ,
1823
1824
request,
1824
1825
is_write_unwritten,
1826
+ ClientData :: from_fn ( |_| BackpressureGuard :: dummy ( ) ) ,
1825
1827
)
1826
1828
}
1827
1829
@@ -1831,6 +1833,7 @@ impl Downstairs {
1831
1833
gw_id : GuestWorkId ,
1832
1834
write : RawWrite ,
1833
1835
is_write_unwritten : bool ,
1836
+ bp_guard : ClientData < BackpressureGuard > ,
1834
1837
) -> JobId {
1835
1838
let ds_id = self . next_id ( ) ;
1836
1839
let dependencies = self . ds_active . deps_for_write ( ds_id, blocks) ;
@@ -1872,7 +1875,7 @@ impl Downstairs {
1872
1875
replay : false ,
1873
1876
data : None ,
1874
1877
read_validations : Vec :: new ( ) ,
1875
- backpressure_guard : ClientMap :: new ( ) ,
1878
+ backpressure_guard : bp_guard . into ( ) ,
1876
1879
} ;
1877
1880
self . enqueue ( io) ;
1878
1881
ds_id
@@ -2453,6 +2456,7 @@ impl Downstairs {
2453
2456
blocks : ImpactedBlocks ,
2454
2457
write : RawWrite ,
2455
2458
is_write_unwritten : bool ,
2459
+ backpressure_guard : ClientData < BackpressureGuard > ,
2456
2460
) -> JobId {
2457
2461
// If there is a live-repair in progress that intersects with this read,
2458
2462
// then reserve job IDs for those jobs.
@@ -2463,6 +2467,7 @@ impl Downstairs {
2463
2467
guest_id,
2464
2468
write,
2465
2469
is_write_unwritten,
2470
+ backpressure_guard,
2466
2471
)
2467
2472
}
2468
2473
@@ -3674,6 +3679,7 @@ impl Downstairs {
3674
3679
data,
3675
3680
} ,
3676
3681
is_write_unwritten,
3682
+ ClientData :: from_fn ( |_| BackpressureGuard :: dummy ( ) ) ,
3677
3683
)
3678
3684
}
3679
3685
@@ -4422,6 +4428,19 @@ impl Downstairs {
4422
4428
}
4423
4429
} ) ;
4424
4430
}
4431
+
4432
+ /// Assign the given number of write bytes to the backpressure counters
4433
+ #[ must_use]
4434
+ pub ( crate ) fn early_write_backpressure (
4435
+ & mut self ,
4436
+ bytes : u64 ,
4437
+ ) -> ClientData < BackpressureGuard > {
4438
+ ClientData :: from_fn ( |i| {
4439
+ self . clients [ i]
4440
+ . backpressure_counters
4441
+ . early_write_increment ( bytes)
4442
+ } )
4443
+ }
4425
4444
}
4426
4445
4427
4446
/// Configuration for per-client backpressure
0 commit comments