Re: [PATCH RFC] BKL not necessary in cpuid_open

From: Sven-Thorsten Dietrich
Date: Wed Oct 07 2009 - 16:01:39 EST


On Wed, 2009-10-07 at 21:31 +0200, John Kacur wrote:
>
> On Wed, 7 Oct 2009, Sven-Thorsten Dietrich wrote:
>
> > On Wed, 2009-10-07 at 20:19 +0200, John Kacur wrote:
> > > I've been staring at the BKL lock in cpuid_open, and I can't see what it
> > > is protecting. However, I may have missed something - even something
> > > obvious, so comments are welcome.
> >
> > I have been using this patch to first see if the BKL is being used
> > simply as mutex, which would allow easier break-down.
> >
> > Sven
> >

> Cool! Seems like an excellent experiment. However this is a separate patch
> from the one initially proposed in this thread. I'm willing to risk just
> removing it in this case without any intermediary step. However, if anyone
> points out to me why I'm a knuckle head and missed something obvious - I'll
> listen. Otherwise, let's use your patch as a separate tactic to kill BKL.
>

Yes, I meant to send this out as RFC Monday, but got side-tracked with
catch-up work, so you prompted me to just reply to your patch.

I was also looking at the cycle_kernel_lock() call in
arch/x86/kernel/microcode_core.c, which is not obvious to me.

I converted that to cycle_kernel_mutex() using the patch I sent earlier,
but have not had time to actually boot and test.

In any case, I see bkl accesses all over various driver open() and
ioctl() calls.

I think that a number of these are safe to remove, as I still fail to
understand why its necessary to take BKL during any driver open()
routing.

So if its fine for the cpuid_open() call, then I would assume its ok for
others.

Sven


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/