]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Properly handle registration of on-demand paging MRs after dereg
authorHaggai Eran <haggaie@mellanox.com>
Tue, 6 Jan 2015 11:56:02 +0000 (13:56 +0200)
committerRoland Dreier <roland@purestorage.com>
Wed, 18 Feb 2015 06:14:56 +0000 (22:14 -0800)
commit1f4a7fb86c2d6b5ead2bf849ec943660bb68562a
treed2a4ba21782bad0263a96ef738a1187319c8a36c
parent06ea150ab855210b9c8803c1b392cc8e5bfb3c59
IB/core: Properly handle registration of on-demand paging MRs after dereg

When the last on-demand paging MR is released the notifier count is
left non-zero so that concurrent page faults will have to abort. If a
new MR is then registered, the counter is reset. However, the decision
is made to put the new MR in the list waiting for the notifier count
to reach zero, before the counter is reset. An invalidation or another
MR registration can release the MR to handle page faults, but without
such an event the MR can wait forever.

The patch fixes this issue by adding a check whether the MR is the
first on-demand paging MR when deciding whether it is ready to handle
page faults. If it is the first MR, we know that there are no mmu
notifiers running in parallel to the registration.

Fixes: 22c3a1615e44 ("IB/core: Implement support for MMU notifiers regarding on demand paging regions")
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Shachar Raindel <raindel@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/core/umem_odp.c