Locking comment on shrink_caches()

Marcelo Tosatti
2001-09-25T19:50:42Z

Andrea,

Do you really need to do this ?

if (unlikely(!spin_trylock(&pagecache_lock))) {
/* we hold the page lock so the page cannot go away from under us */
spin_unlock(&pagemap_lru_lock);

spin_lock(&pagecache_lock);
spin_lock(&pagemap_lru_lock);
}

Have you actually seen bad hold times of pagecache_lock by
shrink_caches() ?

Its just that I prefer clear locking without those "tricks". (easier to
understand and harder to miss subtle details)