[Top] [All Lists]

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

Subject: Preemption in do_cpu (Re: [PATCH]Preemption patch for 2.6)
From: Pavel Kiryukhin <>
Date: Mon, 18 Apr 2005 13:32:46 +0400
Cc: Manish Lachwani <>
In-reply-to: <>
Original-recipient: rfc822;
References: <>
Reply-to: Pavel Kiryukhin <>
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

The sequence looks like

| 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         

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


ML> Index: linux-
ML> ===================================================================
ML> --- linux-
ML> +++ linux-


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:


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