Re: [patch] remove the BKL (Big Kernel Lock), this time for real

From: Linus Torvalds
Date: Wed Sep 15 2004 - 10:43:36 EST




On Wed, 15 Sep 2004, Ingo Molnar wrote:
>
> the attached patch is a new approach to get rid of Linux's Big Kernel
> Lock as we know it today.

I really think this is wrong.

Maybe not from a conceptual standpoint, but that implementation with the
scheduler doing "reaquire_kernel_lock()" and doing a down() there is just
wrong, wrong, wrong.

If we're going to do a down() and block immediately after being scheduled,
I don't think we should have been picked in the first place.

Yeah, yeah, you have all that magic to not recurse by setting lock-depth
negative before doing the down(), but it still feels fundamentally wrong
to me. There's also the question whether this actually _helps_ anything,
since it may well just replace the spinning with lots of new scheduler
activity.

And you make schedule() a lot more expensive for kernel lock holders by
copying the CPU map. You may have tested it on a machine where the CPU map
is just a single word, but what about the big machines?

Spinlocks really _are_ cheaper. Wouldn't it be nice to just continue
removing kernel lock users and keeping a very _simple_ kernel lock for
legacy issues?

In other words, I'd _really_ like to see some serious numbers for this.

Linus
-
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/