From owner-freebsd-current Mon Jun 28 13:20:29 1999 Delivered-To: freebsd-current@freebsd.org Received: from flamingo.McKusick.COM (flamingo.mckusick.com [209.31.233.178]) by hub.freebsd.org (Postfix) with ESMTP id 2CEEE14BCF for ; Mon, 28 Jun 1999 13:20:24 -0700 (PDT) (envelope-from mckusick@flamingo.McKusick.COM) Received: from flamingo.McKusick.COM (mckusick@localhost.concentric.net [127.0.0.1]) by flamingo.McKusick.COM (8.9.3/8.9.0) with ESMTP id IAA02733; Mon, 28 Jun 1999 08:59:39 -0700 (PDT) Message-Id: <199906281559.IAA02733@flamingo.McKusick.COM> To: Matthew Dillon Subject: Re: Found the startup panic - ccd ( patch included ) Cc: Peter Wemm , Julian Elischer , Alan Cox , Mike Smith , "John S. Dyson" , dg@root.com, dyson@iquest.net, current@freebsd.org, Greg Lehey In-reply-to: Your message of "Mon, 28 Jun 1999 10:35:21 PDT." <199906281735.KAA23042@apollo.backplane.com> Date: Mon, 28 Jun 1999 08:59:38 -0700 From: Kirk McKusick Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Date: Mon, 28 Jun 1999 10:35:21 -0700 (PDT) From: Matthew Dillon To: Peter Wemm Cc: Kirk McKusick , Julian Elischer , Alan Cox , Mike Smith , "John S. Dyson" , dg@root.com, dyson@iquest.net, current@FreeBSD.ORG, Greg Lehey Subject: Re: Found the startup panic - ccd ( patch included ) References: <19990628165738.E590283@overcee.netplex.com.au> :Certain places use B_CALL and have biodone() from the b_iodone routine, :so we can't reliably use B_ASYNC as an indicator of needing to reassign :to LK_KERNPROC. We have to do it on a case-by-case basis. : :It's easier to do cluster_head processing at the point it's gathered :rather than in BUF_KERNPROC(). : :vfs_cluster.c is confusing, but I think I've figured out how to get it :right. I'm not 100% sure about checking for B_CALL in both cases prior :to VOP_STRATEGY(), and maybe reqbp needs to be considered for the first :... There has got to be a better way to do this. This is unbelievably messy. Please, guys. I am all for stabilizing what was committed but I just spent a month removing fragility from the buffer cache code, and this is adding it right back in. This stuff is just too fragile. Even if we fix it now, it is only going to cause serious problems in the future. It looks to me that these hacks exist to get around potential problems with exclusive lock recursion. We are not *doing* any exclusive lock recursion right now. I am fairly confident that Kirk can implement the new softupdates-related elements without having to resort to exclusive lock recursion, with only a little thought on the matter. Can we please get rid of the lock reassign junk that only exists to support exclusive lock recusion and instead go with something simpler? That way we can remove all of these BUF_KERNPROC calls which have been strewn all over the code. We have the luxury of time here, can we please do this implementation right instead of rushing through making design mistakes? -Matt You are right that the buffer cache is very tricky. It is hard to change it in ways that preserves functionality and performance. The port of my buffer locking code from BSD/OS has caused problems largely because of a different buffer cache implementation and especially SMP models between the two systems (BSD/OS has no spl's for example). However, this is not a half baked idea that I have come up with and thrown in without thinking. Recursive locking is *required* to get stacking filesystems like union and loopback working reliably. As they currently stand they are full of code to try and track locks at layers all up and down the stack. This code is really nasty and in many cases broken (leading to deadlocks or crashes). The snapshot code also is most easily implemented with recursive locking, the alternative being to put lock monitoring all through bmap and block allocation code. So yes, it would be wonderful if the world could be simple, and I am not a huge fan of the complexity of the buffer locking code. But, I have considered the alternatives and they are worse. Kirk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message