Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
823c98d
Implement set_mempolicy syscall and related error handling
n4mlz Aug 27, 2025
2c3b9e0
Update memory policy validation in setup_memory_policy function
n4mlz Sep 1, 2025
14a114e
Add memory policy tests and integrate into test framework
n4mlz Sep 3, 2025
80fa98b
Refactor memory policy tests to use ConditionalTest for NUMA-dependen…
n4mlz Sep 3, 2025
e40dceb
Add memory policy test for empty mode in tests
n4mlz Sep 3, 2025
449b953
Refactor memory policy mode usage
n4mlz Sep 3, 2025
666a81e
Fix maxnode calculation in build_nodemask function
n4mlz Sep 7, 2025
97255c1
Split Linux memory policy processing into files
n4mlz Sep 7, 2025
d2d971f
Refactor setup_memory_policy function to improve readability and erro…
n4mlz Sep 16, 2025
ffc9bd7
Refactor memory policy flag usage for improved clarity
n4mlz Sep 16, 2025
81a1476
Remove memory policy test case for empty policy
n4mlz Sep 16, 2025
ec948a4
Refactor memory policy validation to simplify function signature and …
n4mlz Sep 16, 2025
652f1d3
Refactor memory policy tests to remove conditional checks and simplif…
n4mlz Sep 16, 2025
9cdbba3
Add documentation for setup_memory_policy function
n4mlz Sep 16, 2025
cbda2d9
Refactor setup_memory_policy to streamline flag handling and improve …
n4mlz Sep 16, 2025
c906009
Refactor setup_memory_policy to separate validation from syscall exec…
n4mlz Sep 18, 2025
178b907
Unify MPOL_DEFAULT and MPOL_LOCAL tests
n4mlz Sep 18, 2025
4fb74dd
Fix memory policy test to match maxnode calculation
n4mlz Sep 18, 2025
273ef96
Remove memory policy test case for empty policy
n4mlz Sep 18, 2025
4223938
Remove duplicate case
n4mlz Sep 18, 2025
e9ef9fa
Add memory policy node verification
n4mlz Sep 19, 2025
e12eff1
Fix test name
n4mlz Sep 19, 2025
a8ea1f8
Use libc::c_ulong for nodemask
n4mlz Sep 19, 2025
e7ddf1f
Remove unused error variant for invalid memory policy mode
n4mlz Sep 28, 2025
d9ac825
Refactor import statements for clarity and consistency
n4mlz Sep 28, 2025
2f0a1e2
Enhance error messages in validate_memory_policy to include mode names
n4mlz Sep 28, 2025
18d2cce
Fix error message in validate_memory_policy for expected node binding
n4mlz Sep 28, 2025
b15150d
Refactor numa_maps_indicates_node0 function to simplify parameters an…
n4mlz Sep 28, 2025
90c9024
Refactor validate_memory_policy to simplify logic
n4mlz Sep 29, 2025
9fcc646
Update oci-spec version to 0.8.3
n4mlz Oct 7, 2025
bee064e
Refactor validate_memory_policy to improve parsing logic and enhance …
n4mlz Oct 9, 2025
c971475
Update runc installation to version 1.4.0-rc.2 for memory policy support
n4mlz Oct 12, 2025
8c9bd9e
Refactor numa_maps_indicates_node0 to improve node parsing logic
n4mlz Oct 16, 2025
7449697
Add empty flags to memory policy test cases
n4mlz Oct 16, 2025
f5f86eb
Add empty nodes to memory policy test cases
n4mlz Oct 16, 2025
eb39c93
Format import order
n4mlz Oct 16, 2025
0133c00
Merge branch 'main' of https://github.com/youki-dev/youki into feat/s…
n4mlz Nov 1, 2025
ab4a91a
Merge branch 'main' of https://github.com/youki-dev/youki into feat/s…
n4mlz Nov 6, 2025
92c61b0
Update memory policy validation to enhance node set handling
n4mlz Nov 12, 2025
7c53fea
Lint fix
n4mlz Nov 12, 2025
d66d9a1
Revert changes related to the runc version
n4mlz Nov 12, 2025
8189200
Update memory policy tests to use ConditionalTest
n4mlz Nov 12, 2025
a7e0a1d
Merge branch 'main' of https://github.com/youki-dev/youki into feat/s…
n4mlz Nov 20, 2025
6de003f
Fix formatting of Cargo.toml
n4mlz Nov 25, 2025
623ca95
Refactor memory policy for improved readability and maintainability
n4mlz Nov 25, 2025
088bfe6
Merge branch 'main' of https://github.com/youki-dev/youki into feat/s…
n4mlz Nov 25, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
run: sudo add-apt-repository -y ppa:criu/ppa
- name: Install requirements
run: sudo env PATH=$PATH just ci-prepare
- name: Install runc 1.3.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m sorry for the trouble.
validate-contest-runc is intended to verify the validity of newly added integration tests by running them with runc.
Thinking ahead to other integration tests we might add, I believe it’s best to use the stable version here.
If the memory policy test fails, we can skip it.
Please refer to the following.

https://github.com/youki-dev/youki/blob/main/tests/contest/contest/src/tests/fd_control/mod.rs#L100

- name: Install runc v1.3.2
run: |
wget -q https://github.com/opencontainers/runc/releases/download/v1.3.2/runc.amd64
sudo mv runc.amd64 /usr/bin/runc
Expand Down
5 changes: 4 additions & 1 deletion crates/libcontainer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ libseccomp = { version = "0.4.0", optional = true }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rust-criu = "0.4.0"
regex = { version = "1.12.2", default-features = false, features = ["std", "unicode-perl"] }
regex = { version = "1.12.2", default-features = false, features = [
"std",
"unicode-perl",
] }
thiserror = "2.0.17"
tracing = { version = "0.1.41", features = ["attributes"] }
safe-path = "0.1.0"
Expand Down
5 changes: 5 additions & 0 deletions crates/libcontainer/src/process/init/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::namespaces::NamespaceError;
use crate::process::channel;
use crate::process::memory_policy::MemoryPolicyError;
use crate::rootfs::device::DeviceError;
#[cfg(feature = "libseccomp")]
use crate::seccomp;
Expand Down Expand Up @@ -64,6 +65,10 @@ pub enum InitProcessError {
IoPriorityClass(String),
#[error("call exec sched_setattr error: {0}")]
SchedSetattr(String),
#[error("invalid memory policy: {0}")]
InvalidMemoryPolicy(String),
#[error(transparent)]
MemoryPolicy(#[from] MemoryPolicyError),
#[error(transparent)]
Network(#[from] crate::network::NetworkError),
#[error("failed to verify if current working directory is safe")]
Expand Down
4 changes: 3 additions & 1 deletion crates/libcontainer/src/process/init/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::network::link::LinkClient;
use crate::network::network_device::{resolve_device_name, setup_addresses_in_network_namespace};
use crate::network::wrapper::create_network_client;
use crate::process::args::{ContainerArgs, ContainerType};
use crate::process::channel;
use crate::process::{channel, memory_policy};
use crate::rootfs::RootFS;
use crate::rootfs::device::{open_device_fd, verify_dev_null};
#[cfg(feature = "libseccomp")]
Expand All @@ -54,6 +54,8 @@ pub fn container_init_process(

setup_scheduler(ctx.process.scheduler())?;

memory_policy::setup_memory_policy(ctx.linux.memory_policy(), ctx.syscall.as_ref())?;

// set up tty if specified
if let Some(csocketfd) = args.console_socket {
tty::setup_console(csocketfd).map_err(|err| {
Expand Down
Loading
Loading