mirror of
https://github.com/JakeHillion/scx.git
synced 2024-12-02 13:57:11 +00:00
b04e82b5eb
The dependency of the buddy-alloc crate [1] seems to cause some troubles with packaging, mostly because the selftests for the crate are failing when it's compiled in release mode. For example: $ cargo test --release -- --nocapture thread 'tests::fast_alloc::test_basic_malloc' panicked at src/tests/fast_alloc.rs:25:13: assertion `left == right` failed left: 0 right: 42 Some of these failures with BuddyAlloc can be fixed by using a memory arena buffer aligned to page size. However, some test failures with FastAlloc persist that cannot be resolved merely by aligning the pre-allocated memory arena to the page size, as mentioned in [2]. The concern is that this may potentially lead to actual memory bugs. Therefore, it seems safer to refactor the custom allocator code to simply use BuddyAlloc, dropping FastAlloc completely. To achieve this, the entire BuddyAlloc code has been directly included in scx_rustland_core, referencing the original project and its MIT licensing information (with the entire code still distributed under the GPLv2 license). Then the code has been slightly modified to remove FastAlloc and the external dependency on the buddy-alloc crate has been dropped. From a performance perspective this change doesn't seem to introduce any measurable regression. [1] https://github.com/jjyr/buddy-alloc [2] https://github.com/jjyr/buddy-alloc/issues/16 Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
31 lines
676 B
TOML
31 lines
676 B
TOML
[package]
|
|
name = "scx_rustland_core"
|
|
version = "0.5.0"
|
|
edition = "2021"
|
|
authors = ["Andrea Righi <andrea.righi@canonical.com>"]
|
|
license = "GPL-2.0-only"
|
|
repository = "https://github.com/sched-ext/scx"
|
|
description = "Framework to implement sched_ext schedulers running in user space"
|
|
|
|
[dependencies]
|
|
anyhow = "1.0"
|
|
plain = "0.2.3"
|
|
libbpf-rs = "0.23.1"
|
|
libc = "0.2.137"
|
|
scx_utils = { path = "../scx_utils", version = "0.8.1" }
|
|
|
|
[build-dependencies]
|
|
tar = "0.4"
|
|
walkdir = "2.4"
|
|
scx_utils = { path = "../scx_utils", version = "0.8.1" }
|
|
|
|
[lib]
|
|
name = "scx_rustland_core"
|
|
path = "src/lib.rs"
|
|
|
|
include = [
|
|
"assets/bpf/intf.h",
|
|
"assets/bpf/main.bpf.c",
|
|
"assets/bpf.rs",
|
|
]
|