----- Original Message ----- > > + > > + if (!test_bit(GLF_LRU, &gl->gl_flags)) { > > + set_bit(GLF_LRU, &gl->gl_flags); > > atomic_inc(&lru_count); > > + } > > The above may be simplified to something like: > + if (!test_and_set_bit(GLF_LRU, &gl->gl_flags)) > atomic_inc(&lru_count);
Scratch that. Andreas says test_and_set_bit() and similar are much more expensive cpu-wise, and we're already protected from races by the lru_lock, so I guess the original is better after all. Bob Peterson