lkml.org 
[lkml]   [2001]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectPossible race in interruptible_sleep_on_timeout()

I lifted the following kernel-thread code from
../linux/drivers/net/8139too.c, just added a procedure to call.

static int gpib_thread(void *unused)
{
unsigned long timeout;

daemonize();
spin_lock_irq(&current->sigmask_lock);
sigemptyset(&current->blocked);
recalc_sigpending(current);
spin_unlock_irq(&current->sigmask_lock);
memcpy(current->comm, task_name, sizeof(task_name));
for(;;)
{
timeout = 0x02;
do {
timeout = interruptible_sleep_on_timeout(&info->twait, timeout);
} while (!signal_pending(current)&&(timeout > 0));
if(signal_pending(current))
up_and_exit(&info->quit, 0);
tinker(info->what_to_do);
}
}

It has been observed that, given the conditions of little or no
CPU activity except `top`, procedure "tinker()" will never get
executed because interruptible_sleep_on_timeout returns the
same timeout value it received.

This is on kernel version 2.4.1. Maybe this race has been found and
fixed?


Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:53    [W:0.205 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site