Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 14 Jan 2002 15:04:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 14 Jan 2002 15:03:07 -0500 Received: from zero.tech9.net ([209.61.188.187]:54532 "EHLO zero.tech9.net") by vger.kernel.org with ESMTP id ; Mon, 14 Jan 2002 15:02:30 -0500 Subject: Re: [2.4.17/18pre] VM and swap - it's really unusable From: Robert Love To: Rik van Riel Cc: Roman Zippel , Alan Cox , yodaiken@fsmlabs.com, Daniel Phillips , Arjan van de Ven , linux-kernel@vger.kernel.org In-Reply-To: In-Reply-To: Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0.1 Date: 14 Jan 2002 15:05:23 -0500 Message-Id: <1011038724.4603.11.camel@phantasy> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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/