drivers/infiniband/hw/mthca/mthca_allocator.c: alloc->last left unchanged in mthca_alloc, which has impact on performance of function find_next_zero_bit in mthca_alloc. Signed-off-by: kangning <kangning18z@xxxxxxxxx> --- I squashed two commits into one in this version. drivers/infiniband/hw/mthca/mthca_allocator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c index aef1d274a14e..1141695093e7 100644 --- a/drivers/infiniband/hw/mthca/mthca_allocator.c +++ b/drivers/infiniband/hw/mthca/mthca_allocator.c @@ -51,6 +51,9 @@ u32 mthca_alloc(struct mthca_alloc *alloc) } if (obj < alloc->max) { + alloc->last = obj + 1; + if (alloc->last == alloc->max) + alloc->last = 0; set_bit(obj, alloc->table); obj |= alloc->top; } else -- 2.17.1