From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58752C433E2 for ; Wed, 2 Sep 2020 09:24:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27636208DB for ; Wed, 2 Sep 2020 09:24:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599038647; bh=/Y5/ncA4+fnNzq1qLhBRcreHjYHv6iLV1oFlGIQDEhU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=qxWyOkVYCMXXkg9i1/TMKasuaolLbH+3q3vAFL3DbdFZkIuK30UkV7Gs41EX4q/gZ ICy6W9qnH4kbCnmt54QIsiElkHuJcc7bR64x0WtRPYi7ErhRHhZO9MSj8UZSieH3e2 ol14iWvqKBHV1NVbtNkB9jAglGsgTzLDQyIc1Dcw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726167AbgIBJYG (ORCPT ); Wed, 2 Sep 2020 05:24:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:46928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726140AbgIBJYF (ORCPT ); Wed, 2 Sep 2020 05:24:05 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE9F520773; Wed, 2 Sep 2020 09:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599038644; bh=/Y5/ncA4+fnNzq1qLhBRcreHjYHv6iLV1oFlGIQDEhU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r0cW4pSiiCuA3KcYxKjgNceq+LsfKSYMsbU3WiC0mPr/Up6ILiAm7VJT2Wz9CIdiI yAk4xi7zbjTroUoiYdbqoVDQAt2M5k/ZeYKxWAY4FnjKHfNJdaVQmZCJJpXhv7RXUu SCrGJXFS9l1NyYOFSQ+QB0XW9rFzkzXQU1q506VQ= Date: Wed, 2 Sep 2020 12:24:00 +0300 From: Leon Romanovsky To: Jason Gunthorpe Cc: Doug Ledford , linux-rdma@vger.kernel.org, Shiraz Saleem Subject: Re: [PATCH 01/14] RDMA/umem: Fix ib_umem_find_best_pgsz() for mappings that cross a page boundary Message-ID: <20200902092400.GG59010@unreal> References: <0-v1-00f59ce24f1f+19f50-umem_1_jgg@nvidia.com> <1-v1-00f59ce24f1f+19f50-umem_1_jgg@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1-v1-00f59ce24f1f+19f50-umem_1_jgg@nvidia.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Tue, Sep 01, 2020 at 09:43:29PM -0300, Jason Gunthorpe wrote: > It is possible for a single SGL to span an aligned boundary, eg if the SGL > is > > 61440 -> 90112 > > Then the length is 28672, which currently limits the block size to > 32k. With a 32k page size the two covering blocks will be: > > 32768->65536 and 65536->98304 > > However, the correct answer is a 128K block size which will span the whole > 28672 bytes in a single block. > > Instead of limiting based on length figure out which high IOVA bits don't > change between the start and end addresses. That is the highest useful > page size. > > Fixes: 4a35339958f1 ("RDMA/umem: Add API to find best driver supported page size in an MR") > Signed-off-by: Jason Gunthorpe > --- > drivers/infiniband/core/umem.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky