tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Dynamically allocated locks



>> This patch allows for dynamically allocated locks.
>> 
>> http://www.netbsd.org/~ad/lockobj.diff

My problem with this diff, isn't so much with the diff itself, but that it
relies on CACHE_LINE_SIZE.  On powerpc, we have multiple cache line sizes that
are possible, and using the compiled-in constant CACHE_LINE_SIZE isn't feasable.

I realize however, that this isn't directly what you are trying to fix,
however, up until now, the uses of CACHE_LINE_SIZE were primarily for alignment
reasons, and by picking a least common denominator for that define, we mostly
got away with it on the ppc machines that have 128b/l caches.  Now that you
want to use it to limit a lock to per-line, that will no longer be the case,
and we will end up with multiple locks in a cache line on those cpu's.

I think we need a better solution for that define in general.

---
Tim Rightnour <root%garbled.net@localhost>
NetBSD: Free multi-architecture OS http://www.netbsd.org/
Genecys: Open Source 3D MMORPG: http://www.genecys.org/


Home | Main Index | Thread Index | Old Index