Re: [2.4.17/18pre] VM and swap - it's really unusable

From: Robert Love (rml@tech9.net)
Date: Mon Jan 14 2002 - 15:05:23 EST


On Mon, 2002-01-14 at 09:35, Rik van Riel wrote:
> OK, suppose you have three tasks.
>
> A is a SCHED_FIFO task
> B is a nice 0 SCHED_OTHER task
> C is a nice +19 SCHED_OTHER task
>
> Task B is your standard CPU hog, running all the time, task C has
> grabbed an inode semaphore (no spinlock), task A wakes up, preempts
> task C, tries to grab the inode semaphore and goes back to sleep.
>
> Now task A has to wait for task B to give up the CPU before task C
> can run again and release the semaphore.
>
> Without preemption task C would not have been preempted and it would
> have released the lock much sooner, meaning task A could have gotten
> the resource earlier.
>
> Using the low latency patch we'd insert some smart code into the
> algorithm so task A also releases the lock before rescheduling.
>
> Before you say this thing never happens in practice, I ran into
> this thing in real life with the SCHED_IDLE patch. In fact, this
> problem was so severe it convinced me to abandon SCHED_IDLE ;))

This isn't related. The problem you described can happen nearly as
easily on a non-preemptible system. We have plenty of semaphores held
across schedules and there is no reason to single out ones that acquire
and release the semaphore in short, non-preemptible, sequences. We
always have this "problem."

SCHED_IDLE is much different, as you know, because the SCHED_IDLE task
holding the lock can _never_ get scheduled if there is a CPU hog on the
system! With the preemptive case, we only worry about an increase in
this period, which is at the expense of fairness in running higher
priority tasks. But I think you know this ...

        Robert Love

-
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 : Tue Jan 15 2002 - 21:00:47 EST