lkml.org 
[lkml]   [1997]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectwaiting and scheduling: is this OK?

The Coda filesystem passes requests to a user level cache manager and
waits for answers. I tried to imitate things like "soft" and "hard"
mounting from NFS but added a timeout for signals so that "short" calls
(like stat, which programs like to complete) will not normally be
interrupted in kernel mode.

When coda waits for a message it executes the routine below? Is this
OK? I am asking because the routines interruptible_sleep_on etc are much
more careful, but I don't understand the details there.

Thanks for any help!

- Peter -

(ps this is not in 2.1.73 yet, I'll send a patch tomorrow or so).


static inline void coda_waitfor_upcall(struct vmsg *vmp)
{
struct wait_queue wait = { current, NULL };

vmp->vm_posttime = jiffies;

add_wait_queue(&vmp->vm_sleep, &wait);
for (;;) {
if ( coda_hard == 0 )
current->state = TASK_INTERRUPTIBLE;
else
current->state = TASK_UNINTERRUPTIBLE;

if ( vmp->vm_flags & VM_WRITE )
break;
if (signal_pending(current) &&
(jiffies > vmp->vm_posttime + coda_timeout * HZ) )
break;
schedule();
}
remove_wait_queue(&vmp->vm_sleep, &wait);
current->state = TASK_RUNNING;

return;
}



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