Added support for faulty pagers and their threads to become zombies

Added support for pagers that fault to suspend and become zombies
along with all the threads that they manage. Zombie killing is to
be done at a later time, from this special zombie queue.

The implementation works same as a suspension, with the added action
that the thread is moved to a queue in kernel container.
This commit is contained in:
Bahadir Balban
2009-10-19 18:48:55 +03:00
parent 9177166817
commit cfa35e4a66
8 changed files with 110 additions and 78 deletions

View File

@@ -399,6 +399,8 @@ void init_kernel_container(struct kernel_container *kcont)
memcap_unmap(&kcont->physmem_free, kernel_area->start,
kernel_area->end);
init_ktcb_list(&kcont->zombie_list);
/* TODO:
* Add all virtual memory areas used by the kernel
* e.g. kernel virtual area, syscall page, kip page,

View File

@@ -14,6 +14,7 @@
#include <l4/generic/resource.h>
#include <l4/generic/container.h>
#include <l4/generic/preempt.h>
#include <l4/generic/thread.h>
#include <l4/generic/irq.h>
#include <l4/generic/tcb.h>
#include <l4/api/errno.h>
@@ -239,6 +240,9 @@ void sched_suspend_sync(void)
BUG_ON(scheduler.prio_total < 0);
preempt_enable();
if (current->flags & TASK_EXITING)
thread_make_zombie(current);
/*
* Async wake up any waiting pagers
*

View File

@@ -127,6 +127,15 @@ struct ktcb *tcb_find(l4id_t tid)
return 0;
}
void ktcb_list_add(struct ktcb *new, struct ktcb_list *ktcb_list)
{
spin_lock(&ktcb_list->list_lock);
BUG_ON(!list_empty(&new->task_list));
BUG_ON(!++ktcb_list->count);
list_insert(&new->task_list, &ktcb_list->list);
spin_unlock(&ktcb_list->list_lock);
}
void tcb_add(struct ktcb *new)
{
struct container *c = new->container;