/* eligible tree holds backlogged classes being sorted by their eligible times. there is one eligible tree per hfsc instance.  */
static void eltree_insert(struct hfsc_class *cl)
/* eligible tree holds backlogged classes being sorted by their eligible times. there is one eligible tree per hfsc instance.  */
static void eltree_insert(struct hfsc_class *cl)
{
	struct rb_node **p = &cl->sched->eligible.rb_node;
	struct rb_node *parent = NULL;
	struct hfsc_class *cl1;
	while (*p != NULL) {
		parent = *p;
		cl1 = rb_entry(parent, struct hfsc_class, el_node);
		if (cl->cl_e >= cl1->cl_e)
			p = &parent->rb_right;
		else
			p = &parent->rb_left;
	}
	rb_link_node(&cl->el_node, parent, p);
	rb_insert_color(&cl->el_node, &cl->sched->eligible);
}