WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: you patch "block: push down BKL into .open and .release"

To: Jens Axboe <jaxboe@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: you patch "block: push down BKL into .open and .release" and its changes to xen-blkfront.c
From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Wed, 25 Aug 2010 13:28:26 +0200
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>, Daniel Stodden <daniel.stodden@xxxxxxxxxx>
Delivery-date: Thu, 26 Aug 2010 10:40:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C74F831.3040400@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4C7513AB0200007800012130@xxxxxxxxxxxxxxxxxx> <4C74F831.3040400@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.12.2 (Linux/2.6.35-16-generic; KDE/4.3.2; x86_64; ; )
On Wednesday 25 August 2010, Jens Axboe wrote:
> 
> On 2010-08-25 12:59, Jan Beulich wrote:
> > Arnd,
> > 
> > what was the point of adding {,un}lock_kernel() to blkif_open() and
> > blkif_release()? Afaict, the associated bdev is protected by a mutex
> > anyway, so even without Daniel's addition of a mutex to these
> > paths I don't see the need for the BKL here.
> 
> I'll let Arnd answer for himself, but at least in general it's
> much easier to let this sort of auditing and final cleanup
> be done my the maintainer(s) of the driver in question, as they
> are best positioned to verify that the BKL in fact isn't
> really necessary in that path anymore.

Traditionally, we were holding the BKL in common code while calling
block device open/release functions. In order to remove the BKL from
the block layer itself, I blindly pushed it into all the block
device drivers to make sure I don't break any driver that has a
hidden dependency on being called under a global lock.

The next step is to go through all drivers one by one and remove
the BKL from them, either by replacing it with a mutex or dropping
it entirely.

The only reason why you might need it is that you might be accessing
global state of the driver that is not protected by the per-device
mutex. If you know that this is not the case for a driver, then please
submit a patch to remove the BKL there.

        Arnd

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>