From: Maor Gottlieb <maorg@nvidia.com>
To: Christoph Hellwig <hch@infradead.org>, Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
<linux-kernel@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
"Mike Marciniszyn" <mike.marciniszyn@cornelisnetworks.com>,
Yishai Hadas <yishaih@nvidia.com>,
Zhu Yanjun <zyjzyj2000@gmail.com>
Subject: Re: [PATCH rdma-next v1 1/2] lib/scatterlist: Fix wrong update of orig_nents
Date: Wed, 30 Jun 2021 12:14:04 +0300 [thread overview]
Message-ID: <2134e949-0569-c495-cb0b-f0324c5920df@nvidia.com> (raw)
In-Reply-To: <YNwaVTT0qmQdxaZz@infradead.org>
On 6/30/2021 10:16 AM, Christoph Hellwig wrote:
> On Wed, Jun 30, 2021 at 10:02:11AM +0300, Leon Romanovsky wrote:
>> Another possible solution is to change __sg_alloc_table()/__sg_alloc_table_from_pages
>> to return total_nents and expect from the users to store it internally and pass
>> it later to the __sg_free_table().
>>
>> Something like that.
> Yes, that sounds pretty reasonable.
OK. So we have two options
1. Add another argument (output) to __sg_alloc_table_from_pages and
__sg_free_table.
The thing is that __sg_free_table gets free_fn as argument while
__sg_alloc_table_from_pages doesn't get alloc function. Users will pass
NULL as free_fn and scatterlist internally will use sg_kfree.
2. Have dedicated functions to the appending allocations -
sg_alloc_table_from_pages_append and sg_free_table_append. With this
approach users that use __sg_alloc_table_from_pages not for appending
allocation don't need to maintain the new argument.
Christoph, what do you prefer? do you see a better option?
next prev parent reply other threads:[~2021-06-30 9:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-29 8:40 [PATCH rdma-next v1 0/2] SG fix together with update to RDMA umem Leon Romanovsky
2021-06-29 8:40 ` [PATCH rdma-next v1 1/2] lib/scatterlist: Fix wrong update of orig_nents Leon Romanovsky
2021-06-30 5:59 ` Christoph Hellwig
2021-06-30 6:29 ` Leon Romanovsky
2021-06-30 6:33 ` Christoph Hellwig
2021-06-30 7:02 ` Leon Romanovsky
2021-06-30 7:16 ` Christoph Hellwig
2021-06-30 9:14 ` Maor Gottlieb [this message]
[not found] ` <CGME20210630111227eucas1p2212b63f5d9da6788e57319c35ce9eaf4@eucas1p2.samsung.com>
2021-06-30 11:12 ` Marek Szyprowski
2021-06-30 11:16 ` Leon Romanovsky
2021-06-30 17:44 ` Thierry Reding
2021-06-30 17:49 ` Leon Romanovsky
2021-06-29 8:40 ` [PATCH rdma-next v1 2/2] RDMA: Use dma_map_sgtable for map umem pages Leon Romanovsky
2021-06-29 23:08 ` [PATCH rdma-next v1 0/2] SG fix together with update to RDMA umem 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=2134e949-0569-c495-cb0b-f0324c5920df@nvidia.com \
--to=maorg@nvidia.com \
--cc=dennis.dalessandro@cornelisnetworks.com \
--cc=dledford@redhat.com \
--cc=hch@infradead.org \
--cc=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mike.marciniszyn@cornelisnetworks.com \
--cc=yishaih@nvidia.com \
--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
all inboxes | Powered by JetHome®