From owner-cvs-all Sat Sep 14 17:42:32 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ECC3937B400; Sat, 14 Sep 2002 17:42:30 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6166643E6A; Sat, 14 Sep 2002 17:42:30 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g8F0gRPQ053918; Sat, 14 Sep 2002 17:42:27 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g8F0gPF8053917; Sat, 14 Sep 2002 17:42:25 -0700 (PDT) (envelope-from dillon) Date: Sat, 14 Sep 2002 17:42:25 -0700 (PDT) From: Matthew Dillon Message-Id: <200209150042.g8F0gPF8053917@apollo.backplane.com> To: Poul-Henning Kamp Cc: Bruce Evans , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/kern vfs_bio.c src/sys/sys bio.h References: <56929.1032030798@critter.freebsd.dk> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :> :> Well, the buffer is owned at the time of the BIO_DONE and you have :> a lock structure sitting right there, why not simply use the :> lock structure's interlock? Note I said 'interlock' here, not the :> main lock. : :struct bio != struct buf : :-- :Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 Well, so? struct bio has access to struct buf via _bio_buf. Another alternative would be to use a pool mutex, e.g. mtx_pool_lock(bio), mtx_pool_unlock(bio). Another alternative would be to add a mutex pointer field to the bio that the device can assign, allowing the device to use a mutex that it already needs to use anyway (again to reduce the L1 cache impact). The buf's lockmgr lock's interlock would also probably have less impact on the L1 cache then (another) random pool lock. I do not think a timeout is a good solution. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message