Subject: Re: MIPS cpu_fork() runs kthreads at splhigh()
To: None <port-mips@netbsd.org>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: port-mips
Date: 04/25/2001 14:28:52
>> The issue was spotted by Ethan Solomita, after NetBSD kernel was changed
>> to have kthreads for various purposes, and fixed by me.
>>
>> From CVS commit log of NetBSD/pmax machdep.c;
>
> Ah, I didn't realize it was done in the port-specific code... I kept
> looking in generic MIPS code. This explains why I couldn't find it.
>
> My second question is 'why?'. Why was this done in port-specific code
> and not in the general mips code?
Well, first of all, it's a sub-optimal solution to fix "kthread left
in splhigh condition" by mucking cpu_fork(). The true source resides
in pcb0. Some CPU architectures require to have a set of bit pattern
1 to make processes spl0.
It was natural to add a single line initialize proc0 pcb in init() path.
I could argue here about how to _implement_ and _organize_ common-ness,
but the arguement is easily diversified into ruin, so I avoid.
Tohru Nishimura