x86/mem_sharing: reorder when pages are unlocked and released
authorTamas K Lengyel <tamas@tklengyel.com>
Fri, 19 Jul 2019 11:47:17 +0000 (13:47 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 19 Jul 2019 11:47:17 +0000 (13:47 +0200)
commitc2c6f8b68c082caa14c49c2a02ed527e8cf0f327
tree66f24bd4176861079af1f0207e515f5650cc1c94
parentaf4acbc7a5f705417729e413f7678ae090688a1e
x86/mem_sharing: reorder when pages are unlocked and released

Calling _put_page_type while also holding the page_lock for that page
can cause a deadlock. There may be code-paths still in place where this
is an issue, but for normal sharing purposes this has been tested and
works.

Removing grabbing the extra page reference at certain points is done
because it is no longer needed, a reference is held till necessary with
this reorder thus the extra reference is redundant.

The comment being dropped is incorrect since it's now out-of-date.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm/mem_sharing.c