fix(scheduler): wire mem reservation reconciliation into live rusage event path

sched_reconcile_job_resource_usage() was only reachable from
sched_apply_job_rusage() (scheduler.c's sched_update(), which has no live
caller), so real-usage reconciliation never actually ran outside tests.
Wire it into core_events.c's XCE_CORE_EVENT_JOB_RUSAGE handler instead,
the actual live path shared by both normal-mode (driver.c) and sim/replay
mode (sim_loop.c). Adds link-satisfying stubs to the testsuite files that
#include core_events.c directly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4M5MJM2zK6nU43da267Ku
This commit is contained in:
Rongsong Shen 2026-09-01 07:08:37 +00:00
parent 728496bea0
commit eb06f16d75
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
21 changed files with 389 additions and 6 deletions

View file

@ -162,6 +162,19 @@ void kill_sched_resval(xce_val_t* val) { (void)val; }
* invoked (no worker is ever added here). */
void sched_worker_release_host_ctx(xce_sched_worker_t* w) { (void)w; }
/* resource-accounting.md's reconciliation (resource.c, not linked here --
* this file only #includes core_events.c). core_events.c's
* XCE_CORE_EVENT_JOB_RUSAGE handler calls this whenever job->accounts !=
* NULL; this fixture never populates job->accounts, so the real body is
* never reached -- link-satisfying stub only, same rationale as every
* other stub in this block (see test_job_update.c's identical stub). */
int sched_reconcile_job_resource_usage(xce_sched_core_t* c,
xce_job_account_t* a,
xce_job_rusages_t* r)
{
(void)c; (void)a; (void)r; return 0;
}
/* plugin_prepare_allocation()'s (plugin.c) linker dependency -- never
* invoked (this fixture never drives real resource-matching allocation --
* same rationale test_sim_equivalence.c's own copy documents). */