Re: [PATCH] 2.5: ewrk3 cli/sti removal by VDA

From: Adam Kropelin (akropel1@rochester.rr.com)
Date: Fri Oct 25 2002 - 17:54:50 EST


On Fri, Oct 25, 2002 at 06:45:04PM -0400, Jeff Garzik wrote:
> Adam Kropelin wrote:
> >
> > /* Wait a little while */
> > spin_unlock_irqrestore(&lp->hw_lock, flags);
> >- ret = delay;
> >- __wait_event_interruptible_timeout(wait, 0, ret);
> >+ set_current_state(TASK_INTERRUPTIBLE);
> >+ ret = schedule_timeout(HZ>>2);
> >
>
> close -- if schedule_timeout() returns greater than zero, that number is
> the remaining jiffies that schedule_timeout _should_ have slept, but did
> not. Ideally you need to call it in a loop, that decrements a variable
> based on schedule_timeout return code.

My assumption was that the only case in which schedule_timeout() would
return without completing the sleep is if the process was delivered a
signal. So I break the loop immediately in that case. I presume from
your explanation that schedule_timeout() may return for some other reason
(out of curiousity, what?)...and in that case I need to check for a
pending signal, exit if there is one, otherwise schedule_timeout() for
the remaining time. Am I getting warmer?

--Adam

-
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/



This archive was generated by hypermail 2b29 : Thu Oct 31 2002 - 22:00:29 EST