2014-11-13 17:46:10

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCHv2] rpmsg: compute number of buffers to allocate from vrings

Hi Ohad,

On 09/16/2014 01:33 PM, Suman Anna wrote:
> The buffers to be used for communication are allocated during the
> rpmsg virtio driver's probe, and the total number of buffers is
> currently hard-coded to 512. The vring configuration can vary from
> one platform to another or between different remote processors. The
> setup of the receive buffers will throw a WARN_ON if the associated
> vrings are configured with less than 256 buffers (in each direction).
> So, adjust this hard-coded value to rely on the number of buffers the
> virtqueue vring is setup with, but also limit to use 256 buffers at
> most in each direction to avoid wacky resource tables consuming up
> unreasonable memory.
>
> NOTE: The number of buffers is already assumed to be symmetrical
> in each direction, and that logic is not unchanged.
>
> Signed-off-by: Suman Anna <[email protected]>
> ---
> v2 changes:
> - add upper limit on buffers and update comments
> - revise patch description

Any comments on this one, if not can you pick this up for 3.19?

regards
Suman


2014-11-26 16:52:27

by Ohad Ben Cohen

[permalink] [raw]
Subject: Re: [PATCHv2] rpmsg: compute number of buffers to allocate from vrings

Hi Suman,

On Thu, Nov 13, 2014 at 7:46 PM, Suman Anna <[email protected]> wrote:
> Hi Ohad,
>
> On 09/16/2014 01:33 PM, Suman Anna wrote:
>> The buffers to be used for communication are allocated during the
>> rpmsg virtio driver's probe, and the total number of buffers is
>> currently hard-coded to 512. The vring configuration can vary from
>> one platform to another or between different remote processors. The
>> setup of the receive buffers will throw a WARN_ON if the associated
>> vrings are configured with less than 256 buffers (in each direction).
>> So, adjust this hard-coded value to rely on the number of buffers the
>> virtqueue vring is setup with, but also limit to use 256 buffers at
>> most in each direction to avoid wacky resource tables consuming up
>> unreasonable memory.
>>
>> NOTE: The number of buffers is already assumed to be symmetrical
>> in each direction, and that logic is not unchanged.
>>
>> Signed-off-by: Suman Anna <[email protected]>
>> ---
>> v2 changes:
>> - add upper limit on buffers and update comments
>> - revise patch description
>
> Any comments on this one, if not can you pick this up for 3.19?

Did some small changes - untested, not even compiled - can you please
make sure it works for you?

Thanks,
Ohad.


Attachments:
0001-rpmsg-use-less-buffers-when-vrings-are-small.patch (5.68 kB)

2014-11-26 22:30:55

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCHv2] rpmsg: compute number of buffers to allocate from vrings

Hi Ohad,

>
> On Thu, Nov 13, 2014 at 7:46 PM, Suman Anna <[email protected]> wrote:
>> Hi Ohad,
>>
>> On 09/16/2014 01:33 PM, Suman Anna wrote:
>>> The buffers to be used for communication are allocated during the
>>> rpmsg virtio driver's probe, and the total number of buffers is
>>> currently hard-coded to 512. The vring configuration can vary from
>>> one platform to another or between different remote processors. The
>>> setup of the receive buffers will throw a WARN_ON if the associated
>>> vrings are configured with less than 256 buffers (in each direction).
>>> So, adjust this hard-coded value to rely on the number of buffers the
>>> virtqueue vring is setup with, but also limit to use 256 buffers at
>>> most in each direction to avoid wacky resource tables consuming up
>>> unreasonable memory.
>>>
>>> NOTE: The number of buffers is already assumed to be symmetrical
>>> in each direction, and that logic is not unchanged.
>>>
>>> Signed-off-by: Suman Anna <[email protected]>
>>> ---
>>> v2 changes:
>>> - add upper limit on buffers and update comments
>>> - revise patch description
>>
>> Any comments on this one, if not can you pick this up for 3.19?
>
> Did some small changes - untested, not even compiled - can you please
> make sure it works for you?

Yep, I have reviewed and verified the changes, it is good to go.

Thanks,
Suman

2014-11-28 15:18:45

by Ohad Ben Cohen

[permalink] [raw]
Subject: Re: [PATCHv2] rpmsg: compute number of buffers to allocate from vrings

On Thu, Nov 27, 2014 at 12:30 AM, Suman Anna <[email protected]> wrote:
> Yep, I have reviewed and verified the changes, it is good to go.

Applied, thanks!