lkml.org 
[lkml]   [2010]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched: add wait_for_completion_killable_timeout
On Sat, 29 May 2010, Peter Zijlstra wrote:
> On Fri, 2010-05-28 at 12:16 -0700, Sage Weil wrote:
> > Hi-
> >
> > Do I need an ACK on this, or should I just send this to Linus with the
> > Ceph fix? It's a pretty trivial fixup.
>
> > > --- a/kernel/sched.c
> > > +++ b/kernel/sched.c
> > > @@ -4161,6 +4161,23 @@ int __sched wait_for_completion_killable(struct completion *x)
> > > EXPORT_SYMBOL(wait_for_completion_killable);
> > >
> > > /**
> > > + * wait_for_completion_killable_timeout: - waits for completion of a task (w/(to,killable))
> > > + * @x: holds the state of this particular completion
> > > + * @timeout: timeout value in jiffies
> > > + *
> > > + * This waits for either a completion of a specific task to be
> > > + * signaled or for a specified timeout to expire. It can be
> > > + * interrupted by a kill signal. The timeout is in jiffies.
> > > + */
> > > +unsigned long __sched
> > > +wait_for_completion_killable_timeout(struct completion *x,
> > > + unsigned long timeout)
> > > +{
> > > + return wait_for_common(x, timeout, TASK_KILLABLE);
> > > +}
> > > +EXPORT_SYMBOL(wait_for_completion_killable_timeout);
> > > +
> > > +/**
> > > * try_wait_for_completion - try to decrement a completion without blocking
> > > * @x: completion structure
> > > *
>
> I guess its ok, although I have an intrinsic suspicion of all things
> timeout, but since we have plenty of those interfaces around I can't
> object too much ;-)
>
> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

Agreed (about timeouts). In this case the timeout is only used during
mount so that we don't hang indefinitely if the server is unreachable.

Thanks :)
sage


\
 
 \ /
  Last update: 2010-05-29 18:17    [W:0.059 / U:0.216 seconds]
©2003-2014 Jasper Spaans. Advertise on this site