From owner-freebsd-hackers Mon Feb 22 1:24:20 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id 06C0C1162B for ; Mon, 22 Feb 1999 01:23:31 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id JAA57510; Mon, 22 Feb 1999 09:22:48 GMT (envelope-from dfr@nlsystems.com) Date: Mon, 22 Feb 1999 09:22:48 +0000 (GMT) From: Doug Rabson To: Terry Lambert Cc: dillon@apollo.backplane.com, freebsd-hackers@freebsd.org Subject: Re: Panic in FFS/4.0 as of yesterday In-Reply-To: <199902220534.WAA01171@usr07.primenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 22 Feb 1999, Terry Lambert wrote: > > > > I think promoting directory writes (and directory reads probably) might be > > > > the simplest solution. > > > > > > OK, here's code to add the ability to expedite placement of async > > > writes. It' doesn't insert them in order behind other expedited > > > writes, so it turns the expedited stuff LIFO. This is probably > > > suboptimal, but can't happen in dependent operations, so what the > > > heck... > > > > > > When you use the code, be sure to *not* set the flag if soft updates > > > are in effect (I think that's a caller issue, not a callee issue, since > > > it would complicate the bdwrite code, probably unacceptably. > > > > I don't think this will do the job at all. The buffers in question are > > not delayed writes, so all this patch will do is change the order of the > > LOCKED and LRU lists, probably pessimising the reuse of those buffers. > > Check the code paths and look for B_ASYNC getting unset. I believe this > is the correct patch. As I said before, the reads and writes in question are not delayed writes. The reason I have a problem is that the i/o queue in the driver has grown to an obscene length, increasing latency to unreasonable levels. Changing the order of processing delayed writes is irrelavent to this problem. > > > I think the flag needs to be implemented in the driver. The driver should > > check for the EXPEDITE flag and either maintain two queues for the two > > possible priorities or place the buffer at the front of a single work > > queue. > > This has some serious flaws. > > The first is, you have to get it right in more than one driver. This > is really like the "wakeup" character change I did to the serial > drivers to allow for unanticipated "hotchar" in binary only drivers > from third parties, like E.T. Inc.. The driver changes would be small and the code can be arranged so that a a driver doesn't have to change at all to keep functioning, just to improve perceived performance. > > The second is that the lock cascade occurs because of locked vnodes > over an operation queued through this code, and only completion > notification will get rid of the lock. > > The third is that, however you do it, it needs to be harmless to > disk integrity in the soft updates and standard mount cases. The > standard mount case comes for free, by not using the B_ASYNC flag; > but the soft updates case is harder. You won't be able to add an > assert check at the queue-to-driver level to make sure the code is > right, since the buffer is no longer associated with the structure > that contains the soft dependency active/inactive information. > > Look at the cases where the I/O call is actually made in the UFS code, > and trace the function calls down. I'm willing to be wrong. I've been looking at the UFS code all day, trying to make it set B_EXPEDITE for all reads and writes for directories with only limited success. I no longer think this is the correct solution and I am starting to try a priority based scheme which uses a number similar to p->p_estcpu to identify processes which are performing large amounts of i/o and to penalise them by placing their subsequent i/o requests behind processes with a lower i/o priority. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message