From: Daisuke Matsuda <dskmtsd@gmail.com>
To: Zhu Yanjun <yanjun.zhu@linux.dev>,
linux-rdma@vger.kernel.org, leon@kernel.org, jgg@ziepe.ca,
zyjzyj2000@gmail.com
Subject: Re: [PATCH for-next v2] RDMA/rxe: Remove redundant page presence check
Date: Thu, 12 Jun 2025 00:12:41 +0900 [thread overview]
Message-ID: <cfb31dfc-723c-4faf-9b71-9aa32be2f173@gmail.com> (raw)
In-Reply-To: <c63d3202-8a5d-448d-b802-f8a7e0275265@linux.dev>
On 2025/06/08 20:23, Zhu Yanjun wrote:
> 在 2025/6/8 11:59, Daisuke Matsuda 写道:
>> hmm_pfn_to_page() does not return NULL. ib_umem_odp_map_dma_and_lock()
>> should return an error in case the target pages cannot be mapped until
>> timeout, so these checks can safely be removed.
>>
>> Signed-off-by: Daisuke Matsuda <dskmtsd@gmail.com>
>> ---
<...>
>
>> - if (!page)
>> - return RESPST_ERR_RKEY_VIOLATION;
>> if (unlikely(page_offset & 0x7)) {
>
> Normally page_offset error handler should be after this line "page_offset = rxe_odp_iova_to_page_offset(umem_odp, iova);"
>
> Why is this error handler after hmm_pfn_to_page?
>
>> rxe_dbg_mr(mr, "iova not aligned\n");
>> @@ -352,10 +348,6 @@ int rxe_odp_flush_pmem_iova(struct rxe_mr *mr, u64 iova,
>> page_offset = rxe_odp_iova_to_page_offset(umem_odp, iova);
>> page = hmm_pfn_to_page(umem_odp->map.pfn_list[index]);
>> - if (!page) {
>> - mutex_unlock(&umem_odp->umem_mutex);
>> - return -EFAULT;
>> - }
>> bytes = min_t(unsigned int, length,
>> mr_page_size(mr) - page_offset);
>> @@ -398,10 +390,7 @@ enum resp_states rxe_odp_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
>> page_offset = rxe_odp_iova_to_page_offset(umem_odp, iova);
>> index = rxe_odp_iova_to_index(umem_odp, iova);
>> page = hmm_pfn_to_page(umem_odp->map.pfn_list[index]);
>> - if (!page) {
>> - mutex_unlock(&umem_odp->umem_mutex);
>> - return RESPST_ERR_RKEY_VIOLATION;
>> - }
>> +
>> /* See IBA A19.4.2 */
>> if (unlikely(page_offset & 0x7)) {
>
> Ditto, page_offset error handler is not after the line "page_offset = rxe_odp_iova_to_page_offset(umem_odp, iova);" ?
That is a sensible question.
I will submit v3 patch to move the error checks.
Thank you,
Daisuke
prev parent reply other threads:[~2025-06-11 15:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-08 9:59 [PATCH for-next v2] RDMA/rxe: Remove redundant page presence check Daisuke Matsuda
2025-06-08 11:23 ` Zhu Yanjun
2025-06-09 7:43 ` Zhu Yanjun
2025-06-11 15:12 ` Daisuke Matsuda [this message]
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=cfb31dfc-723c-4faf-9b71-9aa32be2f173@gmail.com \
--to=dskmtsd@gmail.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=yanjun.zhu@linux.dev \
--cc=zyjzyj2000@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox