Disable task rescheduling

2 messages, 2 authors, 2005-06-20 · open the first message on its own page

Disable task rescheduling

From: Garcia Jérémie <hidden>
Date: 2005-06-20 13:12:06

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

Re: Disable task rescheduling

From: Eugene Surovegin <hidden>
Date: 2005-06-20 18:22:44

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help