[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mach's in-kernel scheduling
From: |
Thomas Bushnell, BSG |
Subject: |
Re: Mach's in-kernel scheduling |
Date: |
20 Aug 2001 14:20:19 -0700 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
Igor Khavkine <i_khavki@alcor.concordia.ca> writes:
> It is my understanding that Mach supports "in-kernel" threads,
> i.e. threads that run concurrently in the kernel, not being visible
> in userspace.
>
> The first kernel thread, after it does all the initialization and starts
> userspace initialization, runs vm_pageout() to become the garbage
> collection daemon.
Please don't call this garbage collection, it isn't.
> Turns out that zones are susceptible to garbage collection. However,
> I'm really clueless about Mach's way of scheduling these "in-kernel"
> threads. When does this GC thread actually get to run, can it run
> concurrently while a system call is executed, or does it need
> a yield statement somewhere?
It's a thread just like any other. It's in the same state as if a
system call started doing things but never returned.
Threads in kernel mode like this (either this one, or threads during
syscall execution) are not pre-emptively scheduled. Instead, they
must explicitly block to relinquish the CPU.
The basic code for this thread is vm_pageout.c: vm_pageout_continue.
If you look at that function, you can see where it blocks.