Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions rs/config/src/embedders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ pub(crate) const DEFAULT_MAX_DIRTY_PAGES_WITHOUT_OPTIMIZATION: usize = (GIB as u
/// Scheduling overhead for copying dirty pages, in instructions.
pub(crate) const DIRTY_PAGE_COPY_OVERHEAD: NumInstructions = NumInstructions::new(3_000);

/// The overhead for dirty pages in Wasm64.
pub const WASM64_DIRTY_PAGE_OVERHEAD_MULTIPLIER: u64 = 4;

const KIB: u64 = 1024;
const GIB: u64 = KIB * KIB * KIB;

Expand Down Expand Up @@ -245,9 +242,6 @@ pub struct Config {
/// The dirty page copying overhead, in instructions.
pub dirty_page_copy_overhead: NumInstructions,

/// The dirty page overhead factor for Wasm64.
pub wasm64_dirty_page_overhead_multiplier: u64,

/// The maximum allowed size for an uncompressed canister Wasm module.
pub wasm_max_size: NumBytes,

Expand Down Expand Up @@ -298,7 +292,6 @@ impl Config {
max_wasm_memory_size: NumBytes::new(MAX_WASM_MEMORY_IN_BYTES),
max_wasm64_memory_size: NumBytes::new(MAX_WASM64_MEMORY_IN_BYTES),
max_stable_memory_size: NumBytes::new(MAX_STABLE_MEMORY_IN_BYTES),
wasm64_dirty_page_overhead_multiplier: WASM64_DIRTY_PAGE_OVERHEAD_MULTIPLIER,
}
}
}
Expand Down
8 changes: 1 addition & 7 deletions rs/embedders/src/wasmtime_embedder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,13 +639,7 @@ impl WasmtimeEmbedder {
main_memory_type = WasmMemoryType::Wasm64;
}

let dirty_page_overhead = match main_memory_type {
WasmMemoryType::Wasm32 => self.config.dirty_page_overhead,
WasmMemoryType::Wasm64 => NumInstructions::from(
self.config.dirty_page_overhead.get()
* self.config.wasm64_dirty_page_overhead_multiplier,
),
};
let dirty_page_overhead = self.config.dirty_page_overhead;

let memory_trackers = sigsegv_memory_tracker(
memories,
Expand Down
6 changes: 1 addition & 5 deletions rs/embedders/tests/instrumentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,10 @@ fn run_charge_for_dirty_heap(wasm_memory_type: WasmMemoryType) {
},
wasm_memory_type,
);
let mut cd = SchedulerConfig::application_subnet()
let cd = SchedulerConfig::application_subnet()
.dirty_page_overhead
.get();

if let WasmMemoryType::Wasm64 = wasm_memory_type {
cd *= EmbeddersConfig::default().wasm64_dirty_page_overhead_multiplier;
}

// Both stores target Wasm page 0 (bytes 0 and 4096 are within the 64KB page),
// so only one heap page-first-write event occurs.
let overhead = deterministic_tracker_overhead(1, 0);
Expand Down
14 changes: 7 additions & 7 deletions rs/execution_environment/benches/system_api/execute_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ pub fn execute_update_bench(c: &mut Criterion) {
Result::No,
Wasm64::Enabled,
), // 10B max
529004006 + common::deterministic_tracker_write_overhead(1),
529001006 + common::deterministic_tracker_write_overhead(1),
),
common::Benchmark(
"wasm32/ic0_debug_print()/1B".into(),
Expand Down Expand Up @@ -787,7 +787,7 @@ pub fn execute_update_bench(c: &mut Criterion) {
Result::No,
Wasm64::Enabled,
),
517004006 + common::deterministic_tracker_write_overhead(1),
517001006 + common::deterministic_tracker_write_overhead(1),
),
common::Benchmark(
"wasm32/ic0_msg_cycles_available()".into(),
Expand Down Expand Up @@ -937,7 +937,7 @@ pub fn execute_update_bench(c: &mut Criterion) {
Result::No,
Wasm64::Enabled,
),
19004006 + common::deterministic_tracker_write_overhead(1),
19001006 + common::deterministic_tracker_write_overhead(1),
),
common::Benchmark(
"wasm32/ic0_is_controller()".into(),
Expand Down Expand Up @@ -1027,7 +1027,7 @@ pub fn execute_update_bench(c: &mut Criterion) {
Result::No,
Wasm64::Enabled,
),
519004006 + common::deterministic_tracker_write_overhead(1),
519001006 + common::deterministic_tracker_write_overhead(1),
),
common::Benchmark(
"wasm32/ic0_cost_create_canister()".into(),
Expand All @@ -1047,7 +1047,7 @@ pub fn execute_update_bench(c: &mut Criterion) {
Result::No,
Wasm64::Enabled,
),
517004006 + common::deterministic_tracker_write_overhead(1),
517001006 + common::deterministic_tracker_write_overhead(1),
),
common::Benchmark(
"wasm32/ic0_cost_http_request()".into(),
Expand All @@ -1067,7 +1067,7 @@ pub fn execute_update_bench(c: &mut Criterion) {
Result::No,
Wasm64::Enabled,
),
519004006 + common::deterministic_tracker_write_overhead(1),
519001006 + common::deterministic_tracker_write_overhead(1),
),
{
let serialized_params = candid::encode_one(COST_HTTP_REQUEST_V2_PARAMS).unwrap();
Expand Down Expand Up @@ -1111,7 +1111,7 @@ pub fn execute_update_bench(c: &mut Criterion) {
},
Wasm64::Enabled,
),
10019004006 + common::deterministic_tracker_write_overhead(1),
10019001006 + common::deterministic_tracker_write_overhead(1),
)
},
common::Benchmark(
Expand Down
Loading