From: Knut Omang Date: Mon, 8 Aug 2016 04:43:04 +0000 (+0200) Subject: sif: mmu/fmr: Fix check for page table reusability X-Git-Tag: v4.1.12-92~87^2~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e9c650e30d8b1c0d56066284bb375c56f0120de2;p=users%2Fjedix%2Flinux-maple.git sif: mmu/fmr: Fix check for page table reusability 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 --- diff --git a/drivers/infiniband/hw/sif/sif_mmu.c b/drivers/infiniband/hw/sif/sif_mmu.c index ba4f1a0ba88f1..a0ad6a27cdbd6 100644 --- a/drivers/infiniband/hw/sif/sif_mmu.c +++ b/drivers/infiniband/hw/sif/sif_mmu.c @@ -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; }