void send_sigbudget(struct task_struct* t) { if (!bt_flag_test_and_set(t, BTF_SIG_BUDGET_SENT)) { /* signal has not yet been sent and we are responsible for sending * since we just set the sent-bit when it was previously 0. */ TRACE_TASK(t, "SIG_BUDGET being sent!\n"); send_sig(SIG_BUDGET, t, 1); /* '1' denotes signal sent from kernel */ } }
static enum hrtimer_restart psnedf_simple_on_exhausted(struct task_struct *t, int in_schedule) { /* Assumption: t is scheduled on the CPU executing this callback */ if (budget_signalled(t) && !bt_flag_is_set(t, BTF_SIG_BUDGET_SENT)) { /* signal exhaustion */ send_sigbudget(t); /* will set BTF_SIG_BUDGET_SENT */ } if (budget_enforced(t) && !bt_flag_test_and_set(t, BTF_BUDGET_EXHAUSTED)) { if (!is_np(t)) { /* np tasks will be preempted when they become * preemptable again */ litmus_reschedule_local(); TRACE("%d is preemptable => FORCE_RESCHED\n", t->pid); } else if (is_user_np(t)) { TRACE("%d is non-preemptable, preemption delayed.\n", t->pid); request_exit_np(t); } } return HRTIMER_NORESTART; }