feat(scheduler-allocation): add per-host resource-debit reversal

Adds sched_ctx_uncommit_host() (resource.c), the structural inverse
of sched_try_alloc_on_host_()'s existing XVEC_ADD_FLOAT commit call,
scoped to ctx->uncomitted only per requirements.md's Rollback scope
discussion. Test exercises the real sched_ctx_get_uncomit_host()
(schedobj.c) via white-box #include rather than a private
reimplementation, matching test_picker_config_fields.c's established
precedent.

Task 1.4 (scheduler-allocation spec). Requirement 4.2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYdtrEWWZfKRRGED7raEYg
This commit is contained in:
Rongsong Shen 2026-09-04 16:06:59 +00:00
parent d8b5cf8718
commit d0024eb7e8
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
4 changed files with 171 additions and 34 deletions

View file

@ -198,6 +198,7 @@ extern void sched_ctx_fini(xce_sched_ctx_t*);
extern void sched_ctx_set_primary(xce_sched_ctx_t*, xce_primary_resreq_t*);
extern int sched_ctx_get_uncomit_shared(xvec_t**, xce_sched_ctx_t*);
extern int sched_ctx_get_uncomit_host(xvec_t**, xce_sched_ctx_t*, int);
extern int sched_ctx_uncommit_host(xce_sched_ctx_t*, int, xvec_idval_t*);
extern void reset_sched_obj(xce_sched_obj_t*);
#endif