Re: spin_unlock optimization

Oliver Henning (oliver@henning.com)
Fri, 31 Dec 1999 04:21:48 +0100


Well,

I think such an optimization is worth it at least on high-end machines. And
there is still the possibility of a compile-time option or a patch, right?

I'm no expert, so how can those problematic (old PPro) chips be detected,
btw?

Oliver

> It is technically possible to automate this, using the same trick as
> copy_from_user. spin_unlock generates worst case code and stores the
> start and end of the code in yet another ELF section. Kernel boot code
> decides which version to use, runs the data in the new ELF section and
> patches the code before starting the second processor. insmod does the
> same thing. Cost is extra storage in zImage and modules, the extra
> section would be discarded after loading so it does not bloat the
> running kernel. Binary modules (yuck) compiled with the old
> spin_unlock would not have the optimized code but they would still
> work.
>
> Whether this is a desirable thing to do is another question ;).
>

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