Hi, knowing less that diddly squat about the code being discussed.
I would like to mention that I usually use some little macro's
to get rid of code like:
lock( my_lock);
if ( exp) {
unlock( my_lock);
/* do fancy stuph */
} else
unlock( my_lock);
and make it look like this:
#define LOCK_EXP_F( exp, lock, f_lock, f_unlock) \
({ typeof( exp) e; \
f_lock( lock); \
e = (exp); \
f_unlock( lock); \
e; })
#define PAGELOCK_EXP( exp, page) \
LOCK_EXP_F( exp, page, pte_chain_lock, pte_chain_unlock)
if ( PAGELOCK_EXP( !page->pte_chain &&
(!page->buffers || do_flushpage( page, 0)), page))
lru_cache_del( page);
If this is a not accepted coding style, so be it.
Another little thing I've been wondering about is why keep using
LRU style caches. Has anybody ever thought about using LRU-K
caches? I know, they aren't O(1), but O(log(n)) isn't that bad
agains the advantages:
- easier to make concurrent (no head contention)
- better caching properties (takes low frequency
entries and cache sweeps into account)
just my 2ct.
Regards,
Peter Zijlstra
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/