[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090324171927.724da2f5@bike.lwn.net>
Date: Tue, 24 Mar 2009 17:19:27 -0600
From: Jonathan Corbet <corbet@....net>
To: Greg KH <gregkh@...e.de>
Cc: stoyboyker@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/13] [staging] changed ioctls to unlocked
On Tue, 24 Mar 2009 15:01:36 -0700
Greg KH <gregkh@...e.de> wrote:
> Hm, why? What does this patch accomplish becides just pushing the
> lock_kernel into the driver? Shouldn't you fix the code to not need
> the lock_kernel at all instead?
Having done a lot of this myself, I can attest to what is going on
here. If you're trying to push the BKL out of the core, there's not
much choice except to shove it down into the drivers and such below
it. In very simple cases you can tell that the lock isn't needed.
But going messing around with the locking in random drivers is a sure
way to create nasty subtle problems.
So, if a specific driver's situation is not obvious, or if it's clear
that some sort of fix is required, it's generally best to just make the
lock_kernel() (which has always been there) explicit. Then people who
actually know the driver and have the hardware to test changes can
eliminate it at their leisure. Pushing the BKL down gets it out of the
core, keeps the semantics the same, and sticks a red flag on code which
needs examination by suitably clueful maintainers.
I've not looked in depth at this series of patches, but I understand
where it's coming from. Stoyan, if you want, I'd be happy to take
these through the BKL-removal tree once the maintainers are happy with
it. OTOH, it looks like the locked ioctl() isn't going anywhere
anytime soon, so it might be best to just send these individually
through the appropriate subsystem trees.
jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists