]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sif: pt: Add support for single thread modified page tables
authorKnut Omang <knut.omang@oracle.com>
Fri, 14 Oct 2016 11:27:26 +0000 (13:27 +0200)
committerKnut Omang <knut.omang@oracle.com>
Fri, 11 Nov 2016 16:36:57 +0000 (17:36 +0100)
commit3f02ea4f2e305b6f1ce8eab0bd92a0949dc5463f
treedc9de2acc71bbf2302b15f022794d4aa99fca0d3
parentc4cc97a581e18156308f375d21d632f686601b43
sif: pt: Add support for single thread modified page tables

Modifications to the page tables in sif_pt is protected by
a lock to allow multiple threads to add and subtract regions
to/from the page table in parallel. This functionality is
currently only needed/used by the special sq_cmpl page table
handling. In the future we might however need this also for
other cases, for instance to optimize further on page table
memory usage.

The kernel documentation for infiniband midlayer locking
requires that map_phys_fmr should be callable from any context.
This prevents us from blocking on a lock, something that happens
if there are contention for the lock (eg. more than one thread
involved in modifying the page table)

Implement another flag: thread_safe in a pt that determines
if a page table is going to need to be modified from multiple
threads simultaneously. For now keep a BUG_ON if the code
is attempted accessed in parallel for memory types
that should not ever see parallel access.

Orabug: 24836269

Signed-off-by: Knut Omang <knut.omang@oracle.com>
Reviewed-by: Francisco Trivino-Garcia <francisco.trivino@oracle.com>
drivers/infiniband/hw/sif/sif_mmu.c
drivers/infiniband/hw/sif/sif_pt.c
drivers/infiniband/hw/sif/sif_pt.h