From: Jason Gunthorpe <jgg@nvidia.com>
To: Shiraz Saleem <shiraz.saleem@intel.com>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org,
Mike Marciniszyn <mike.marciniszyn@intel.com>
Subject: Re: [PATCH v2 for-rc 1/3] RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz
Date: Wed, 29 Nov 2023 16:40:07 -0400 [thread overview]
Message-ID: <20231129204007.GA1389974@nvidia.com> (raw)
In-Reply-To: <20231129202143.1434-2-shiraz.saleem@intel.com>
On Wed, Nov 29, 2023 at 02:21:41PM -0600, Shiraz Saleem wrote:
> be arbitrary, but for 64k pages, the VA may be offset by some
> number of HCA 4k pages and followed by some number of HCA 4k
> pages.
>
> The current iterator doesn't account for either the preceding
> 4k pages or the following 4k pages.
>
> Fix the issue by extending the ib_block_iter to contain
> the number of DMA pages like comment [1] says and by using
> __sg_advance to start the iterator at the first live HCA page.
>
> The changes are contained in a parallel set of iterator start
> and next functions that are umem aware and specfic to umem
> since there is one user of the rdma_for_each_block() without
> umem.
>
> These two fixes prevents the extra pages before and after the
> user MR data.
>
> Fix the preceding pages by using the __sq_advance field to start
> at the first 4k page containing MR data.
>
> Fix the following pages by saving the number of pgsz blocks in
> the iterator state and downcounting on each next.
>
> This fix allows for the elimination of the small page crutch noted
> in the Fixes.
>
> Fixes: 10c75ccb54e4 ("RDMA/umem: Prevent small pages from being returned by ib_umem_find_best_pgsz()")
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/rdma/ib_umem.h#n91 [1]
> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
> drivers/infiniband/core/umem.c | 6 ------
> include/rdma/ib_umem.h | 9 ++++++++-
> include/rdma/ib_verbs.h | 1 +
> 3 files changed, 9 insertions(+), 7 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
I admit this fix looks so easy and simple I wonder if there was some
tricky reason why I didn't do it back then.. Oh well, I've forgotten,
I guess we will find out!
Jason
next prev parent reply other threads:[~2023-11-29 20:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 20:21 [PATCH v2 for-rc 0/3] Fixes for 64K page size support Shiraz Saleem
2023-11-29 20:21 ` [PATCH v2 for-rc 1/3] RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz Shiraz Saleem
2023-11-29 20:40 ` Jason Gunthorpe [this message]
2023-11-29 20:21 ` [PATCH v2 for-rc 2/3] RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned Shiraz Saleem
2023-11-29 20:21 ` [PATCH v2 for-rc 3/3] RDMA/irdma: Fix support for 64k pages Shiraz Saleem
2023-12-04 23:54 ` [PATCH v2 for-rc 0/3] Fixes for 64K page size support Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231129204007.GA1389974@nvidia.com \
--to=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mike.marciniszyn@intel.com \
--cc=shiraz.saleem@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.