linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maor Gottlieb <maorg@nvidia.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
	Doug Ledford <dledford@redhat.com>, <linux-rdma@vger.kernel.org>,
	<intel-gfx@lists.freedesktop.org>,
	"Roland Scheidegger" <sroland@vmware.com>,
	<dri-devel@lists.freedesktop.org>,
	"David Airlie" <airlied@linux.ie>,
	VMware Graphics <linux-graphics-maintainer@vmware.com>,
	Maor Gottlieb <maorg@mellanox.com>
Subject: Re: [Intel-gfx] [PATCH rdma-next v3 1/2] lib/scatterlist: Add support in dynamic allocation of SG table from pages
Date: Fri, 25 Sep 2020 16:39:53 +0300	[thread overview]
Message-ID: <9d69d68d-7868-609b-c703-dfe9fec93a0f@nvidia.com> (raw)
In-Reply-To: <33942b10-8eef-9180-44c5-b7379b92b824@linux.intel.com>


On 9/25/2020 3:33 PM, Tvrtko Ursulin wrote:
>
> On 25/09/2020 13:18, Maor Gottlieb wrote:
>> On 9/25/2020 2:55 PM, Jason Gunthorpe wrote:
>>> On Fri, Sep 25, 2020 at 10:13:30AM +0300, Leon Romanovsky wrote:
>>>>>> diff --git a/tools/testing/scatterlist/main.c 
>>>>>> b/tools/testing/scatterlist/main.c
>>>>>> index 0a1464181226..4899359a31ac 100644
>>>>>> +++ b/tools/testing/scatterlist/main.c
>>>>>> @@ -55,14 +55,13 @@ int main(void)
>>>>>>        for (i = 0, test = tests; test->expected_segments; test++, 
>>>>>> i++) {
>>>>>>            struct page *pages[MAX_PAGES];
>>>>>>            struct sg_table st;
>>>>>> -        int ret;
>>>>>> +        struct scatterlist *sg;
>>>>>>
>>>>>>            set_pages(pages, test->pfn, test->num_pages);
>>>>>>
>>>>>> -        ret = __sg_alloc_table_from_pages(&st, pages, 
>>>>>> test->num_pages,
>>>>>> -                          0, test->size, test->max_seg,
>>>>>> -                          GFP_KERNEL);
>>>>>> -        assert(ret == test->alloc_ret);
>>>>>> +        sg = __sg_alloc_table_from_pages(&st, pages, 
>>>>>> test->num_pages, 0,
>>>>>> +                test->size, test->max_seg, NULL, 0, GFP_KERNEL);
>>>>>> +        assert(PTR_ERR_OR_ZERO(sg) == test->alloc_ret);
>>>>> Some test coverage for relatively complex code would be very 
>>>>> welcomed. Since
>>>>> the testing framework is already there, even if it bit-rotted a 
>>>>> bit, but
>>>>> shouldn't be hard to fix.
>>>>>
>>>>> A few tests to check append/grow works as expected, in terms of 
>>>>> how the end
>>>>> table looks like given the initial state and some different page 
>>>>> patterns
>>>>> added to it. And both crossing and not crossing into sg chaining 
>>>>> scenarios.
>>>> This function is basic for all RDMA devices and we are pretty 
>>>> confident
>>>> that the old and new flows are tested thoroughly.
>>> Well, since 0-day is reporting that __i915_gem_userptr_alloc_pages is
>>> crashing on this, it probably does need some tests :\
>>>
>>> Jason
>>
>> It is crashing in the regular old flow which already tested.
>> However, I will add more tests.
>
> Do you want to take some of the commits from 
> git://people.freedesktop.org/~tursulin/drm-intel sgtest? It would be 
> fine by me. I can clean up the commit messages if you want.

I will very appreciate it. Thanks
>
> https://cgit.freedesktop.org/~tursulin/drm-intel/commit/?h=sgtest&id=79102f4d795c4769431fc44a6cf7ed5c5b1b5214 
> - this one undoes the bit rot and makes the test just work on the 
> current kernel.
>
> https://cgit.freedesktop.org/~tursulin/drm-intel/commit/?h=sgtest&id=b09bfe80486c4d93ee1d8ae17d5b46397b1c6ee1 
> - this one you probably should squash in your patch. Minus the zeroing 
> of struct sg_stable since that would hide the issue.
>
> https://cgit.freedesktop.org/~tursulin/drm-intel/commit/?h=sgtest&id=97f5df37e612f798ced90541eece13e2ef639181 
> - final commit is optional but I guess handy for debugging.
>
> Regards,
>
> Tvrtko

  reply	other threads:[~2020-09-25 13:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  8:39 [PATCH rdma-next v3 0/2] Dynamicaly allocate SG table from the pages Leon Romanovsky
2020-09-22  8:39 ` [PATCH rdma-next v3 1/2] lib/scatterlist: Add support in dynamic allocation of SG table from pages Leon Romanovsky
2020-09-23  5:42   ` Christoph Hellwig
     [not found]   ` <118a03ef-d160-e202-81cc-16c9c39359fc@linux.intel.com>
2020-09-25  7:13     ` [Intel-gfx] " Leon Romanovsky
2020-09-25 11:55       ` Jason Gunthorpe
2020-09-25 12:18         ` Maor Gottlieb
2020-09-25 12:33           ` Tvrtko Ursulin
2020-09-25 13:39             ` Maor Gottlieb [this message]
2020-09-25 13:54               ` Tvrtko Ursulin
     [not found]       ` <adff5752-582c-2065-89e2-924ef732911a@linux.intel.com>
2020-09-25 11:58         ` Jason Gunthorpe
2020-09-25 12:29           ` Tvrtko Ursulin
2020-09-25 12:34             ` Jason Gunthorpe
2020-09-25 12:13         ` Maor Gottlieb
2020-09-22  8:39 ` [PATCH rdma-next v3 2/2] RDMA/umem: Move to allocate " Leon Romanovsky

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=9d69d68d-7868-609b-c703-dfe9fec93a0f@nvidia.com \
    --to=maorg@nvidia.com \
    --cc=airlied@linux.ie \
    --cc=dledford@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@mellanox.com \
    --cc=sroland@vmware.com \
    --cc=tvrtko.ursulin@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).