]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sif: mmu/fmr: Fix check for page table reusability
authorKnut Omang <knut.omang@oracle.com>
Mon, 8 Aug 2016 04:43:04 +0000 (06:43 +0200)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Fri, 12 Aug 2016 19:18:10 +0000 (12:18 -0700)
The FMR mapping logic attempts to reuse the page table if memory layout is
sufficiently similar. Currently this optimization is for simplicity
limited to very similar memory layouts and does not handle changes
in the page table level (base page size).

The test for this only considered page sizes going from small to larger
and not the opposite.

This scenario is triggered by NFSoRDMA if the previous use was in
huge page mappable memory and the current use is in more
fragmented memory.

Orabug: 21835309

Signed-off-by: Knut Omang <knut.omang@oracle.com>
drivers/infiniband/hw/sif/sif_mmu.c

index ba4f1a0ba88f1aa9153dee2e87b6e387fc7832c0..a0ad6a27cdbd6b40da8ca179bc33e57f03626ee0 100644 (file)
@@ -377,7 +377,7 @@ int sif_map_fmr_ctx(struct sif_dev *sdev,
        leaf_level = hw_leaf_level(hw_ctx->page_size);
 
        /* Now page sizes may have changed too, if so we cannot reuse the page table, delete it: */
-       if (ctx->pt && page_shift > ctx->pt->page_shift) {
+       if (ctx->pt && page_shift != ctx->pt->page_shift) {
                sif_pt_free(ctx->pt);
                ctx->pt = NULL;
        }