* RE: [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation [not found] <1af16ff8-5706-45e5-9737-05da39957c95@arm.com> @ 2023-10-24 8:09 ` Arnaud POULIQUEN 0 siblings, 0 replies; 6+ messages in thread From: Arnaud POULIQUEN @ 2023-10-24 8:09 UTC (permalink / raw) To: Divin Raj, linux-kernel, Xiang Xiao, wendy.liang, Ohad Ben Cohen, Bjorn Andersson, xiang xiao, Tanmay Shah Cc: Diego.Sueiro, Rahul.Singh Hello Divin, This development is currently on hold, but several people seem interested in it. I suggest that you reply directly to the email thread to continue the discussion and address the remoteproc mailing list Regards, Arnaud >From: Divin Raj <divin.raj@arm.com> >Sent: Monday, October 23, 2023 12:44 PM >To: linux-kernel@vger.kernel.org; Xiang Xiao <xiaoxiang@xiaomi.com>; wendy.liang@xilinx.com; Ohad Ben Cohen <ohad@wizery.com>; Bjorn Andersson <bjorn.andersson@linaro.org>; Arnaud >POULIQUEN <arnaud.pouliquen@st.com>; xiang xiao <xiaoxiang781216@gmail.com> >Cc: Diego.Sueiro@arm.com; Rahul.Singh@arm.com >Subject: Re: [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation >Hello all, >I am reaching out with reference to the patch discussed here: https://lore.kernel.org/all/CAH2Cfb-sv3SAL8bcczC-Dc3_r58MYZCS7s7zGtn1Qfo3mmBqVg@mail.gmail.com/ >I've been keenly following the developments around enhancing buffer allocation strategies, especially those focused on dynamic buffer sizing and the considerations for systems under varying memory >constraints. This work is highly relevant to several projects I am involved in, and I am quite interested in its progression. May I kindly request an update on the current phase of these initiatives? >Additionally, I am eager to know if there would be an opportunity for me to contribute to enhancing the patch, possibly by working on improvements or assisting in verification processes. >Furthermore, if there are any condensed resources, summaries, or specific threads that encapsulate recent advancements or discussions on this topic, I would be grateful to receive directions to them. >I appreciate everyone's dedicated efforts and invaluable contributions to this area of development. Looking forward to the updates. >Regards Divin >IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not >disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. ST Restricted ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation @ 2019-01-31 15:41 Xiang Xiao 2019-06-05 4:34 ` Bjorn Andersson 0 siblings, 1 reply; 6+ messages in thread From: Xiang Xiao @ 2019-01-31 15:41 UTC (permalink / raw) To: ohad, bjorn.andersson, wendy.liang, arnaud.pouliquen, linux-remoteproc, linux-kernel Cc: Xiang Xiao Hi, This series enhance the buffer allocation by: 1.Support the different buffer number in rx/tx direction 2.Get the individual rx/tx buffer size from config space Here is the related OpenAMP change: https://github.com/OpenAMP/open-amp/pull/155 Xiang Xiao (3): rpmsg: virtio_rpmsg_bus: allow the different vring size for send/recv rpmsg: virtio_rpmsg_bus: allocate rx/tx buffer separately rpmsg: virtio_rpmsg_bus: get buffer size from config space drivers/rpmsg/virtio_rpmsg_bus.c | 127 +++++++++++++++++++++++--------------- include/uapi/linux/virtio_rpmsg.h | 24 +++++++ 2 files changed, 100 insertions(+), 51 deletions(-) create mode 100644 include/uapi/linux/virtio_rpmsg.h -- 2.7.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation 2019-01-31 15:41 Xiang Xiao @ 2019-06-05 4:34 ` Bjorn Andersson 2019-06-05 7:33 ` Arnaud Pouliquen 0 siblings, 1 reply; 6+ messages in thread From: Bjorn Andersson @ 2019-06-05 4:34 UTC (permalink / raw) To: Xiang Xiao Cc: ohad, wendy.liang, arnaud.pouliquen, linux-remoteproc, linux-kernel, Xiang Xiao On Thu 31 Jan 07:41 PST 2019, Xiang Xiao wrote: > Hi, > This series enhance the buffer allocation by: > 1.Support the different buffer number in rx/tx direction > 2.Get the individual rx/tx buffer size from config space > > Here is the related OpenAMP change: > https://github.com/OpenAMP/open-amp/pull/155 > This looks pretty reasonable, but can you confirm that it's possible to use new firmware with an old Linux kernel when introducing this? But ever since we discussed Loic's similar proposal earlier I've been questioning if the fixed buffer size isn't just an artifact of how we preallocate our buffers. The virtqueue seems to support arbitrary sizes of buffers and I see that the receive function in OpenAMP has been fixed to put back the buffer of the size that was received, rather than 512 bytes. So it seems like Linux would be able to send whatever size messages to OpenAMP it would handle it. The question is if we could do the same in the other direction, perhaps by letting the OpenAMP side do it's message allocation when it's sending, rather than Linux pushing inbufs to be filled by the remote. This would remove the problem of always having suboptimal buffer sizes. Regards, Bjorn > Xiang Xiao (3): > rpmsg: virtio_rpmsg_bus: allow the different vring size for send/recv > rpmsg: virtio_rpmsg_bus: allocate rx/tx buffer separately > rpmsg: virtio_rpmsg_bus: get buffer size from config space > > drivers/rpmsg/virtio_rpmsg_bus.c | 127 +++++++++++++++++++++++--------------- > include/uapi/linux/virtio_rpmsg.h | 24 +++++++ > 2 files changed, 100 insertions(+), 51 deletions(-) > create mode 100644 include/uapi/linux/virtio_rpmsg.h > > -- > 2.7.4 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation 2019-06-05 4:34 ` Bjorn Andersson @ 2019-06-05 7:33 ` Arnaud Pouliquen 2019-06-05 8:35 ` xiang xiao 2019-07-01 6:13 ` Bjorn Andersson 0 siblings, 2 replies; 6+ messages in thread From: Arnaud Pouliquen @ 2019-06-05 7:33 UTC (permalink / raw) To: Bjorn Andersson, Xiang Xiao Cc: ohad, wendy.liang, linux-remoteproc, linux-kernel, Xiang Xiao Hi Bjorn, On 6/5/19 6:34 AM, Bjorn Andersson wrote: > On Thu 31 Jan 07:41 PST 2019, Xiang Xiao wrote: > >> Hi, >> This series enhance the buffer allocation by: >> 1.Support the different buffer number in rx/tx direction >> 2.Get the individual rx/tx buffer size from config space >> >> Here is the related OpenAMP change: >> https://github.com/OpenAMP/open-amp/pull/155 >> > > This looks pretty reasonable, but can you confirm that it's possible to > use new firmware with an old Linux kernel when introducing this? > > > But ever since we discussed Loic's similar proposal earlier I've been > questioning if the fixed buffer size isn't just an artifact of how we > preallocate our buffers. The virtqueue seems to support arbitrary sizes > of buffers and I see that the receive function in OpenAMP has been fixed > to put back the buffer of the size that was received, rather than 512 > bytes. So it seems like Linux would be able to send whatever size > messages to OpenAMP it would handle it. > > The question is if we could do the same in the other direction, perhaps > by letting the OpenAMP side do it's message allocation when it's > sending, rather than Linux pushing inbufs to be filled by the remote. IMHO, both could be useful and could be not correlated. On-the fly buffer allocation seems more efficient but needs an allocator.This can be a generic allocator (with a va to da) for system where large amount of memories are accessible from both side. Now what about system with small shared memory? In this case you have to deal with a limited/optimized memory chunk. To avoid memory fragmentation the allocator should have a pre-reserved buffers pool(so similar to existing implementation). This serie seems useful to optimize the size of the pre-reserved pool. > > This would remove the problem of always having suboptimal buffer sizes. > > Regards, > Bjorn > >> Xiang Xiao (3): >> rpmsg: virtio_rpmsg_bus: allow the different vring size for send/recv >> rpmsg: virtio_rpmsg_bus: allocate rx/tx buffer separately >> rpmsg: virtio_rpmsg_bus: get buffer size from config space >> >> drivers/rpmsg/virtio_rpmsg_bus.c | 127 +++++++++++++++++++++++--------------- >> include/uapi/linux/virtio_rpmsg.h | 24 +++++++ >> 2 files changed, 100 insertions(+), 51 deletions(-) >> create mode 100644 include/uapi/linux/virtio_rpmsg.h >> >> -- >> 2.7.4 >> -- Regards, Arnaud ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation 2019-06-05 7:33 ` Arnaud Pouliquen @ 2019-06-05 8:35 ` xiang xiao 2019-07-01 6:13 ` Bjorn Andersson 1 sibling, 0 replies; 6+ messages in thread From: xiang xiao @ 2019-06-05 8:35 UTC (permalink / raw) To: Arnaud Pouliquen Cc: Bjorn Andersson, Ohad Ben Cohen, wendy.liang, linux-remoteproc, linux-kernel, Xiang Xiao On Wed, Jun 5, 2019 at 3:33 PM Arnaud Pouliquen <arnaud.pouliquen@st.com> wrote: > > Hi Bjorn, > > On 6/5/19 6:34 AM, Bjorn Andersson wrote: > > On Thu 31 Jan 07:41 PST 2019, Xiang Xiao wrote: > > > >> Hi, > >> This series enhance the buffer allocation by: > >> 1.Support the different buffer number in rx/tx direction > >> 2.Get the individual rx/tx buffer size from config space > >> > >> Here is the related OpenAMP change: > >> https://github.com/OpenAMP/open-amp/pull/155 > >> > > > > This looks pretty reasonable, but can you confirm that it's possible to > > use new firmware with an old Linux kernel when introducing this? > > > > > > But ever since we discussed Loic's similar proposal earlier I've been > > questioning if the fixed buffer size isn't just an artifact of how we > > preallocate our buffers. The virtqueue seems to support arbitrary sizes > > of buffers and I see that the receive function in OpenAMP has been fixed > > to put back the buffer of the size that was received, rather than 512 > > bytes. So it seems like Linux would be able to send whatever size > > messages to OpenAMP it would handle it. > > > > The question is if we could do the same in the other direction, perhaps > > by letting the OpenAMP side do it's message allocation when it's > > sending, rather than Linux pushing inbufs to be filled by the remote. > > IMHO, both could be useful and could be not correlated. > On-the fly buffer allocation seems more efficient but needs an > allocator.This can be a generic allocator (with a va to da) for system > where large amount of memories are accessible from both side. > > Now what about system with small shared memory? In this case you have to > deal with a limited/optimized memory chunk. To avoid memory > fragmentation the allocator should have a pre-reserved buffers pool(so > similar to existing implementation). This serie seems useful to optimize > the size of the pre-reserved pool. > Maybe we can reuse rxbuf_size/txbuf_size to trigger the different allocation policy: 1.If buf_size equal 0xfffffff, turn on the dynamic allocator 2.If buf_size equall 0, turn on the fixed allocator with the default buffer size 3.otherwise, turn on the fixed allocator with the configed buffer size So, both requirement could be satisfied without breaking the compatibility. > > > > This would remove the problem of always having suboptimal buffer sizes. > > > > Regards, > > Bjorn > > > >> Xiang Xiao (3): > >> rpmsg: virtio_rpmsg_bus: allow the different vring size for send/recv > >> rpmsg: virtio_rpmsg_bus: allocate rx/tx buffer separately > >> rpmsg: virtio_rpmsg_bus: get buffer size from config space > >> > >> drivers/rpmsg/virtio_rpmsg_bus.c | 127 +++++++++++++++++++++++--------------- > >> include/uapi/linux/virtio_rpmsg.h | 24 +++++++ > >> 2 files changed, 100 insertions(+), 51 deletions(-) > >> create mode 100644 include/uapi/linux/virtio_rpmsg.h > >> > >> -- > >> 2.7.4 > >> > > -- > > Regards, > Arnaud ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation 2019-06-05 7:33 ` Arnaud Pouliquen 2019-06-05 8:35 ` xiang xiao @ 2019-07-01 6:13 ` Bjorn Andersson 1 sibling, 0 replies; 6+ messages in thread From: Bjorn Andersson @ 2019-07-01 6:13 UTC (permalink / raw) To: Arnaud Pouliquen Cc: Xiang Xiao, ohad, wendy.liang, linux-remoteproc, linux-kernel, Xiang Xiao On Wed 05 Jun 00:33 PDT 2019, Arnaud Pouliquen wrote: > Hi Bjorn, > > On 6/5/19 6:34 AM, Bjorn Andersson wrote: > > On Thu 31 Jan 07:41 PST 2019, Xiang Xiao wrote: > > > >> Hi, > >> This series enhance the buffer allocation by: > >> 1.Support the different buffer number in rx/tx direction > >> 2.Get the individual rx/tx buffer size from config space > >> > >> Here is the related OpenAMP change: > >> https://github.com/OpenAMP/open-amp/pull/155 > >> > > > > This looks pretty reasonable, but can you confirm that it's possible to > > use new firmware with an old Linux kernel when introducing this? > > > > > > But ever since we discussed Loic's similar proposal earlier I've been > > questioning if the fixed buffer size isn't just an artifact of how we > > preallocate our buffers. The virtqueue seems to support arbitrary sizes > > of buffers and I see that the receive function in OpenAMP has been fixed > > to put back the buffer of the size that was received, rather than 512 > > bytes. So it seems like Linux would be able to send whatever size > > messages to OpenAMP it would handle it. > > > > The question is if we could do the same in the other direction, perhaps > > by letting the OpenAMP side do it's message allocation when it's > > sending, rather than Linux pushing inbufs to be filled by the remote. > > IMHO, both could be useful and could be not correlated. > On-the fly buffer allocation seems more efficient but needs an > allocator.This can be a generic allocator (with a va to da) for system > where large amount of memories are accessible from both side. > > Now what about system with small shared memory? In this case you have to > deal with a limited/optimized memory chunk. To avoid memory > fragmentation the allocator should have a pre-reserved buffers pool(so > similar to existing implementation). This serie seems useful to optimize > the size of the pre-reserved pool. > Having an implementation that uses small fixed size buffers seems very reasonable and I'm in favour of making the message size configurable. I would however prefer to have this implemented in a way where the remote side should not be receiving messages in a way that's based on the remote side's allocation parameters. I don't think this series prevents the introduction of such isolation, but it would render this code unnecessary. Regards, Bjorn ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-24 8:09 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <1af16ff8-5706-45e5-9737-05da39957c95@arm.com> 2023-10-24 8:09 ` [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation Arnaud POULIQUEN 2019-01-31 15:41 Xiang Xiao 2019-06-05 4:34 ` Bjorn Andersson 2019-06-05 7:33 ` Arnaud Pouliquen 2019-06-05 8:35 ` xiang xiao 2019-07-01 6:13 ` Bjorn Andersson
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).