diff --git a/hermit/arch/x86/mm/page.c b/hermit/arch/x86/mm/page.c index a40a18236..e31e8d473 100644 --- a/hermit/arch/x86/mm/page.c +++ b/hermit/arch/x86/mm/page.c @@ -109,7 +109,6 @@ int page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits) int lvl, ret = -ENOMEM; long vpn = viraddr >> PAGE_BITS; long first[PAGE_LEVELS], last[PAGE_LEVELS]; - task_t* curr_task; /* Calculate index boundaries for page map traversal */ for (lvl=0; lvl> (lvl * PAGE_MAP_BITS); } - curr_task = per_core(current_task); - spinlock_irqsave_lock(&page_lock); /* Start iterating through the entries @@ -133,9 +130,6 @@ int page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits) if (BUILTIN_EXPECT(!phyaddr, 0)) goto out; - if (bits & PG_USER) - atomic_int64_inc(curr_task->user_usage); - /* Reference the new table within its parent */ #if 0 self[lvl][vpn] = phyaddr | bits | PG_PRESENT | PG_USER | PG_RW | PG_ACCESSED; diff --git a/hermit/include/hermit/tasks_types.h b/hermit/include/hermit/tasks_types.h index 81e90e6f8..af8687370 100644 --- a/hermit/include/hermit/tasks_types.h +++ b/hermit/include/hermit/tasks_types.h @@ -90,8 +90,6 @@ typedef struct task { uint64_t start_tick; /// the userspace heap vma_t* heap; - /// usage in number of pages (including page map tables) - atomic_int64_t* user_usage; /// parent thread tid_t parent; /// next task in the queue diff --git a/hermit/kernel/tasks.c b/hermit/kernel/tasks.c index 68125f977..8799e6d33 100644 --- a/hermit/kernel/tasks.c +++ b/hermit/kernel/tasks.c @@ -51,8 +51,8 @@ extern const void tls_end; * A task's id will be its position in this array. */ static task_t task_table[MAX_TASKS] = { \ - [0] = {0, TASK_IDLE, 0, NULL, NULL, TASK_DEFAULT_FLAGS, 0, 0, 0, NULL, NULL, 0, NULL, NULL, 0, 0, 0}, \ - [1 ... MAX_TASKS-1] = {0, TASK_INVALID, 0, NULL, NULL, TASK_DEFAULT_FLAGS, 0, 0, 0, NULL, NULL, 0, NULL, NULL, 0, 0, 0}}; + [0] = {0, TASK_IDLE, 0, NULL, NULL, TASK_DEFAULT_FLAGS, 0, 0, 0, NULL, 0, NULL, NULL, 0, 0, 0}, \ + [1 ... MAX_TASKS-1] = {0, TASK_INVALID, 0, NULL, NULL, TASK_DEFAULT_FLAGS, 0, 0, 0, NULL, 0, NULL, NULL, 0, 0, 0}}; static spinlock_irqsave_t table_lock = SPINLOCK_IRQSAVE_INIT; @@ -161,7 +161,6 @@ int set_idle_task(void) set_per_core(kernel_stack, task_table[i].stack + KERNEL_STACK_SIZE - 0x10); task_table[i].prio = IDLE_PRIO; task_table[i].heap = NULL; - task_table[i].user_usage = NULL; readyqueues[core_id].idle = task_table+i; set_per_core(current_task, readyqueues[core_id].idle); ret = 0; @@ -218,11 +217,6 @@ void finish_task_switch(void) old->stack = NULL; } - if (old->user_usage) { - kfree(old->user_usage); - old->user_usage = NULL; - } - if (!old->parent && old->heap) { kfree(old->heap); old->heap = NULL; @@ -363,7 +357,6 @@ int clone_task(tid_t* id, entry_point_t ep, void* arg, uint8_t prio) task_table[i].tls_addr = curr_task->tls_addr; task_table[i].tls_size = curr_task->tls_size; task_table[i].lwip_err = 0; - task_table[i].user_usage = curr_task->user_usage; if (id) *id = i; @@ -453,7 +446,6 @@ int create_task(tid_t* id, entry_point_t ep, void* arg, uint8_t prio, uint32_t c task_table[i].tls_addr = 0; task_table[i].tls_size = 0; task_table[i].lwip_err = 0; - task_table[i].user_usage = (atomic_int64_t*) counter; if (id) *id = i;