Re: Preemption in do_cpu (Re: [PATCH]Preemption patch for 2.6)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jun Sun wrote:

On Mon, Apr 18, 2005 at 01:32:46PM +0400, Pavel Kiryukhin wrote:


Hi,
the preempt_disable/preempt_enable sequence in do_cpu() [traps.c]
exists quite long (patch submitted in Oct. 2004), so it should be nothing
wrong there.

Can somebody please comment why use of preempt_disable/enable in do_cpu
will not result in "scheduling while atomic" for fpu-less cpu (with enabled
preemption).

The sequence looks like

do_cpu()
| preempt_disable()
| fpu_emulator_cop1Handler()
| | cond_reshed()
| | | schedule()  <------ scheduling while atomic


The proposed patch was tested for Sibyte, but it has fpu (AFAIK) and has no fpu_emulator_cop1Handler called.




fpu_emulator maintains global variables and in general is dangerous to be preempted in the middle of processing.

The quick fix for this problem is probably to move preemption disabling/
enabling inside fpu_emulator_cop1Handler().

Better fix is probably to modify fpu emulator so that it is preemption
safe overall.

Jun


Missed this one ! I had a patch that enables preemption before the cond_resched and disables right after it. I forgot to send it to linux-mips though. But, I needed it to work on fpu-less CPU. My bad.

Thanks
Manish Lachwani



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux