Skip to content

Commit 2f8228f

Browse files
committed
refactor: rename uffd_valid_handler to uffd_on_demand_handler
This better describes what the handler actually does (technically, fault_all_handler is also "valid"), and now that some tests emit the name of the uffd handler as a metric, the names should be descriptive from the get-go to avoid confusion and future renamings. Signed-off-by: Patrick Roy <[email protected]>
1 parent fbd0aa1 commit 2f8228f

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

docs/snapshotting/handling-page-faults-on-snapshot-resume.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ connect/send data.
162162
### Example
163163

164164
An example of a handler process can be found
165-
[here](../../src/firecracker/examples/uffd/valid_handler.rs). The process is
165+
[here](../../src/firecracker/examples/uffd/on_demand_handler.rs). The process is
166166
designed to tackle faults on a certain address by loading into memory the entire
167167
region that the address belongs to, but users can choose any other behavior that
168168
suits their use case best.

src/firecracker/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ name = "uffd_malicious_handler"
5757
path = "examples/uffd/malicious_handler.rs"
5858

5959
[[example]]
60-
name = "uffd_valid_handler"
61-
path = "examples/uffd/valid_handler.rs"
60+
name = "uffd_on_demand_handler"
61+
path = "examples/uffd/on_demand_handler.rs"
6262

6363
[[example]]
6464
name = "uffd_fault_all_handler"

tests/integration_tests/functional/test_uffd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_valid_handler(uvm_plain, snapshot):
9292
vm.spawn()
9393

9494
# Spawn page fault handler process.
95-
pf_handler = spawn_pf_handler(vm, uffd_handler("valid"), snapshot.mem)
95+
pf_handler = spawn_pf_handler(vm, uffd_handler("on_demand"), snapshot.mem)
9696

9797
vm.restore_from_snapshot(snapshot, resume=True, uffd_path=pf_handler.socket_path)
9898

tests/integration_tests/performance/test_huge_pages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_hugetlbfs_snapshot(microvm_factory, guest_kernel_linux_5_10, rootfs):
9393
vm.spawn()
9494

9595
# Spawn page fault handler process.
96-
pf_handler = spawn_pf_handler(vm, uffd_handler("valid"), snapshot.mem)
96+
pf_handler = spawn_pf_handler(vm, uffd_handler("on_demand"), snapshot.mem)
9797

9898
vm.restore_from_snapshot(snapshot, resume=True, uffd_path=pf_handler.socket_path)
9999

@@ -135,7 +135,7 @@ def test_hugetlbfs_diff_snapshot(microvm_factory, uvm_plain):
135135
vm.spawn()
136136

137137
# Spawn page fault handler process.
138-
pf_handler = spawn_pf_handler(vm, uffd_handler("valid"), snapshot_merged.mem)
138+
pf_handler = spawn_pf_handler(vm, uffd_handler("on_demand"), snapshot_merged.mem)
139139

140140
vm.restore_from_snapshot(
141141
snapshot_merged, resume=True, uffd_path=pf_handler.socket_path

tests/integration_tests/performance/test_snapshot_ab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_restore_latency(
141141
# wakes up, because it gets faulted in on the first page fault. In this scenario, we are not measuring UFFD
142142
# latencies, but KVM latencies of setting up missing EPT entries.
143143
@pytest.mark.nonci
144-
@pytest.mark.parametrize("uffd_handler", [None, "valid", "fault_all"])
144+
@pytest.mark.parametrize("uffd_handler", [None, "on_demand", "fault_all"])
145145
@pytest.mark.parametrize("huge_pages", HugePagesConfig)
146146
def test_post_restore_latency(
147147
microvm_factory, rootfs, guest_kernel_linux_5_10, metrics, uffd_handler, huge_pages

0 commit comments

Comments
 (0)