linux-mips
[Top] [All Lists]

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

To: linux-mips@linux-mips.org
Subject: Preemption in do_cpu (Re: [PATCH]Preemption patch for 2.6)
From: Pavel Kiryukhin <vksavl@cityline.ru>
Date: Mon, 18 Apr 2005 13:32:46 +0400
Cc: Manish Lachwani <mlachwani@mvista.com>
In-reply-to: <1098468403.4266.42.camel@prometheus.mvista.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1098468403.4266.42.camel@prometheus.mvista.com>
Reply-to: Pavel Kiryukhin <vksavl@cityline.ru>
Sender: linux-mips-bounce@linux-mips.org
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.

--
Thank you,
Pavel Kiryukhin                   mailto:vksavl@cityline.ru



Friday, October 22, 2004, 10:06:43 PM, you wrote:

ML> Hello !

ML> The attached patch incorporates preemption enable/disable in some parts
ML> of the kernel. I have tested this on the Broadcom Sibyte. Please review
ML> ...

ML> Thanks
ML> Manish Lachwani


<skip>

ML> Index: linux-2.6.8.1/arch/mips/kernel/traps.c
ML> ===================================================================
ML> --- linux-2.6.8.1.orig/arch/mips/kernel/traps.c
ML> +++ linux-2.6.8.1/arch/mips/kernel/traps.c

<skip>

ML>  case 1:
ML> +preempt_disable();
ML> +
ML>  own_fpu();
ML>  if (current->used_math) {  /* Using the FPU again.  */
ML>  restore_fp(current);
ML> @@ -674,6 +690,8 @@
ML>  force_sig(sig, current);
ML>  }
 
ML> +preempt_enable();
ML> +
ML>  return;
 
ML>  case 2:

<skip>





<Prev in Thread] Current Thread [Next in Thread>