modify priority function for srsf: if remaining slack is negative, return 0 priority

main
xiaosuGW 3 years ago
parent 90997db63e
commit 5af9fffd55

@ -105,12 +105,15 @@ sandbox_get_priority(void *element)
return sandbox->absolute_deadline;
};
static inline int64_t
static inline uint64_t
sandbox_get_srsf_priority(void *element)
{
struct sandbox *sandbox = (struct sandbox *)element;
uint64_t now = __getcycles();
int64_t remaining_slack = sandbox->remaining_slack - (now - sandbox->last_update_timestamp);
if (remaining_slack < 0) {
return 0;
}
return remaining_slack;
};

@ -71,12 +71,15 @@ sandbox_request_get_priority_fn(void *element)
return sandbox_request->absolute_deadline;
};
int64_t
uint64_t
sandbox_request_get_priority_srsf_fn(void *element)
{
struct sandbox_request *sandbox_request = (struct sandbox_request *)element;
uint64_t now = __getcycles();
int64_t remaining_slack = sandbox_request->remaining_slack - (now - sandbox_request->last_update_timestamp);
if (remaining_slack < 0) {
return 0;
}
return remaining_slack;
};

Loading…
Cancel
Save