34360e1e4f
P0-P2: Barrier SMP, sigmask/pthread_kill races, robust mutexes, RT scheduling, POSIX sched API P3: PerCpuSched struct, per-CPU wiring, work stealing, load balancing, initial placement P4: 64-shard futex table, REQUEUE, PI futexes (LOCK_PI/UNLOCK_PI/TRYLOCK_PI), robust futexes, vruntime tracking, min-vruntime SCHED_OTHER selection P5: setpriority/getpriority, pthread_setaffinity_np, pthread_setname_np, pthread_setschedparam (Redox) P6: Cache-affine scheduling (last_cpu + vruntime bonus), NUMA topology kernel hints + numad userspace daemon Stability fixes: make_consistent stores 0 (dead TID fix), cond.rs error propagation, SPIN_COUNT adaptive spinning, Sys::open &str fix, PI futex CAS race, proc.rs lock ordering, barrier destroy Patches: 33 kernel + 58 relibc patches, all tracked in recipes Docs: KERNEL-SCHEDULER-MULTITHREAD-IMPROVEMENT-PLAN.md updated, SCHEDULER-REVIEW-FINAL.md created Architecture: NUMA topology parsing stays userspace (numad daemon), kernel stores lightweight NumaTopology hints
48 lines
2.0 KiB
Diff
48 lines
2.0 KiB
Diff
diff --git a/src/scheme/proc.rs b/src/scheme/proc.rs
|
|
--- a/src/scheme/proc.rs
|
|
+++ b/src/scheme/proc.rs
|
|
@@ -147,6 +147,7 @@ enum ContextHandle {
|
|
Priority,
|
|
SchedAffinity,
|
|
SchedPolicy,
|
|
+ Name,
|
|
|
|
MmapMinAddr(Arc<AddrSpaceWrapper>),
|
|
}
|
|
@@ -267,6 +268,7 @@ impl ProcScheme {
|
|
"sched-affinity" => (ContextHandle::SchedAffinity, true),
|
|
// TODO: Switch this kernel-local proc handle over to a stable upstream
|
|
// redox_syscall ProcCall::SetSchedPolicy opcode once that lands.
|
|
"sched-policy" => (ContextHandle::SchedPolicy, false),
|
|
+ "name" => (ContextHandle::Name, false),
|
|
"status" => (ContextHandle::Status { privileged: false }, false),
|
|
_ if path.starts_with("auth-") => {
|
|
let nonprefix = &path["auth-".len()..];
|
|
@@ -1218,6 +1220,16 @@ impl ContextHandle {
|
|
Ok(2)
|
|
}
|
|
+ ContextHandle::Name => {
|
|
+ let mut name_buf = [0u8; 32];
|
|
+ let len = buf.copy_common_bytes_to_slice(&mut name_buf[..31]).unwrap_or(0);
|
|
+ let mut context = context.write(token.token());
|
|
+ context.name.clear();
|
|
+ if let Ok(s) = core::str::from_utf8(&name_buf[..len]) {
|
|
+ context.name.push_str(s);
|
|
+ }
|
|
+ Ok(len)
|
|
+ }
|
|
ContextHandle::Status { privileged } => {
|
|
let mut args = buf.usizes();
|
|
|
|
@@ -1532,6 +1544,10 @@ impl ContextHandle {
|
|
let data = [context.sched_policy as u8, context.sched_rt_priority];
|
|
buf.copy_common_bytes_from_slice(&data)
|
|
}
|
|
+ ContextHandle::Name => {
|
|
+ let context = context.read(token.token());
|
|
+ buf.copy_common_bytes_from_slice(context.name.as_bytes())
|
|
+ }
|
|
ContextHandle::Status { .. } => {
|
|
let status = {
|
|
let context = context.read(token.token());
|