static inline void
mem_class_put(ckrm_mem_res_t *cls)
{
+ const char *name;
if (cls && atomic_dec_and_test(&(cls->nr_users)) ) {
- printk("freeing memclass %p of <core:%s>\n", cls, cls->core->name);
+ if (cls->core == NULL) {
+ name = "unknown";
+ } else {
+ name = cls->core->name;
+ }
+ printk("freeing memclass %p of <core:%s>\n", cls, name);
+
// BUG_ON(ckrm_memclass_valid(cls));
- //kfree(cls);
+ // kfree(cls);
}
}
child_guarantee_changed(&parres->shares, res->shares.my_guarantee, 0);
child_maxlimit_changed_local(parres);
}
+ ckrm_mem_evaluate_all_pages();
+ res->core = NULL;
+
spin_lock(&ckrm_mem_lock);
list_del(&res->mcls_list);
spin_unlock(&ckrm_mem_lock);
mem_class_put(res);
- ckrm_mem_evaluate_all_pages();
return;
}