On Wed, Oct 16, 2019 at 11:37:37AM -0700, Sean Christopherson wrote: > Drop mmap_sem, which needs to be held for read across EADD, prior to > doing EEXTEND on the newly added page to avoid holding mmap_sem for an > extended duration. EEXTEND doesn't access user pages and holding > encl->lock without mmap_sem is perfectly ok, while EEXTEND is a _slow_ > operation, to the point where it operates on 256-byte chunks > instead of 4k pages to maintain a reasonable latency for a single > instruction. > > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> Locks should be always freed in the opposite order for any piece of code. /Jarkko