On Mon, Oct 21, 2019 at 10:52:06AM +0100, Filipe Manana wrote: > On Sat, Oct 19, 2019 at 10:05 AM Goldwyn Rodrigues <rgoldwyn@xxxxxxx> wrote: > > We are checking PagePrivate twice, once with lock and once without. > > Perform the check only once. > > Have you checked if there's some performance degradation after > removing the check? > My guess is it's there to avoid taking the lock, as the lock can be > heavily used on a system under heavy load (maybe even if it's not too > heavy, since we generate a lot of dirty metadata due to cow). > The page may have been released after locking the mapping, that's why > we check it twice, and after unlocking we are sure it can not be > released due to taking a reference on the extent buffer. That's my understanding as well, so the duplicate unlocked check should stay.
