linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Disable task rescheduling
@ 2005-06-20 13:12 Garcia Jérémie
  2005-06-20 18:22 ` Eugene Surovegin
  0 siblings, 1 reply; 2+ messages in thread
From: Garcia Jérémie @ 2005-06-20 13:12 UTC (permalink / raw)
  To: linuxppc-dev

Hi everybody, as teh object of this mail tells, I'd like to know if =
there is an easy way
to disable task rescheduling in the kernel.
I explain: I'm writing a device driver and so, I use the ioctl.
In one of my ioctl's, I'd like to have a non-interruptible part =
processed.

int Hscx_ioctl(        struct inode *inode,
                       struct file *file,
                       unsigned int ioctl_num,     /* Number of the =
ioctl to call    */
                       unsigned long argP)         /* Paramater to pass =
to the ioctl */
{
   [...]
   switch(ioctl_num)
   {
         case GET_LIST:
        =20
             disable_task_rescheduling();  // what to use???
             disable_interrupt();          // spin_lock_irqsave should =
be enough isn't it?

             execute_critical_code();

             enable_task_rescheduling();   // what to use???
             enable_interrupt();           // spin_unlock_irqrestore =
should be enough isn't it?
             break;
   }
}

Could you give me a tip cause I've browsed the web and technical books =
and I can't find a solution.
Tks a lot

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Disable task rescheduling
  2005-06-20 13:12 Disable task rescheduling Garcia Jérémie
@ 2005-06-20 18:22 ` Eugene Surovegin
  0 siblings, 0 replies; 2+ messages in thread
From: Eugene Surovegin @ 2005-06-20 18:22 UTC (permalink / raw)
  To: Garcia J?r?mie; +Cc: linuxppc-dev

On Mon, Jun 20, 2005 at 03:12:03PM +0200, Garcia J?r?mie wrote:
> Hi everybody, as teh object of this mail tells, I'd like to know if there is an easy way
> to disable task rescheduling in the kernel.
> I explain: I'm writing a device driver and so, I use the ioctl.
> In one of my ioctl's, I'd like to have a non-interruptible part processed.
> 
> int Hscx_ioctl(        struct inode *inode,
>                        struct file *file,
>                        unsigned int ioctl_num,     /* Number of the ioctl to call    */
>                        unsigned long argP)         /* Paramater to pass to the ioctl */
> {
>    [...]
>    switch(ioctl_num)
>    {
>          case GET_LIST:
>          
>              disable_task_rescheduling();  // what to use???
>              disable_interrupt();          // spin_lock_irqsave should be enough isn't it?
> 
>              execute_critical_code();
> 
>              enable_task_rescheduling();   // what to use???
>              enable_interrupt();           // spin_unlock_irqrestore should be enough isn't it?
>              break;
>    }
> }

Disabling interrupts (with spin_lock_irq) also disables kernel 
preemption (if enabled, if not - kernel won't preempt current task 
anyway when in the driver), so explicitly disable 
(disable_task_rescheduling) isn't needed.

-- 
Eugene

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-20 18:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-20 13:12 Disable task rescheduling Garcia Jérémie
2005-06-20 18:22 ` Eugene Surovegin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).