From: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org,
gregkh@linuxfoundation.org, quic_bkumar@quicinc.com,
linux-kernel@vger.kernel.org, quic_chennak@quicinc.com,
dri-devel@lists.freedesktop.org, arnd@arndb.de
Subject: Re: [PATCH v2 4/5] misc: fastrpc: Add polling mode support for fastRPC driver
Date: Thu, 20 Mar 2025 21:27:42 +0530 [thread overview]
Message-ID: <e46be95c-ca8d-48ce-a616-5f068bd28ebc@oss.qualcomm.com> (raw)
In-Reply-To: <2k6573yrw3dyn3rpwqz4asdpx3nlmj4ornm7kmxv3f4jlc6hzg@qkwn7gqduwri>
On 3/20/2025 7:45 PM, Dmitry Baryshkov wrote:
> On Thu, Mar 20, 2025 at 07:19:31PM +0530, Ekansh Gupta wrote:
>>
>> On 1/29/2025 4:10 PM, Dmitry Baryshkov wrote:
>>> On Wed, Jan 29, 2025 at 11:12:16AM +0530, Ekansh Gupta wrote:
>>>>
>>>> On 1/29/2025 4:59 AM, Dmitry Baryshkov wrote:
>>>>> On Mon, Jan 27, 2025 at 10:12:38AM +0530, Ekansh Gupta wrote:
>>>>>> For any remote call to DSP, after sending an invocation message,
>>>>>> fastRPC driver waits for glink response and during this time the
>>>>>> CPU can go into low power modes. Adding a polling mode support
>>>>>> with which fastRPC driver will poll continuously on a memory
>>>>>> after sending a message to remote subsystem which will eliminate
>>>>>> CPU wakeup and scheduling latencies and reduce fastRPC overhead.
>>>>>> With this change, DSP always sends a glink response which will
>>>>>> get ignored if polling mode didn't time out.
>>>>> Is there a chance to implement actual async I/O protocol with the help
>>>>> of the poll() call instead of hiding the polling / wait inside the
>>>>> invoke2?
>>>> This design is based on the implementation on DSP firmware as of today:
>>>> Call flow: https://github.com/quic-ekangupt/fastrpc/blob/invokev2/Docs/invoke_v2.md#5-polling-mode
>>>>
>>>> Can you please give some reference to the async I/O protocol that you've
>>>> suggested? I can check if it can be implemented here.
>>> As with the typical poll() call implementation:
>>> - write some data using ioctl
>>> - call poll() / select() to wait for the data to be processed
>>> - read data using another ioctl
>>>
>>> Getting back to your patch. from you commit message it is not clear,
>>> which SoCs support this feature. Reminding you that we are supporting
>>> all kinds of platforms, including the ones that are EoLed by Qualcomm.
>>>
>>> Next, you wrote that in-driver polling eliminates CPU wakeup and
>>> scheduling. However this should also increase power consumption. Is
>>> there any measurable difference in the latencies, granted that you
>>> already use ioctl() syscall, as such there will be two context switches.
>>> What is the actual impact?
>> Hi Dmitry,
>>
>> Thank you for your feedback.
>>
>> I'm currently reworking this change and adding testing details. Regarding the SoC
>> support, I'll add all the necessary information.
> Please make sure that both the kernel and the userspace can handle the
> 'non-supported' case properly.
Yes, I will include changes to handle in both userspace and kernel.
>
>> For now, with in-driver
>> polling, we are seeing significant performance improvements for calls
>> with different sized buffers. On polling supporting platform, I've observed an
>> ~80us improvement in latency. You can find more details in the test
>> results here:
>> https://github.com/quic/fastrpc/pull/134/files#diff-7dbc6537cd3ade7fea5766229cf585db585704e02730efd72e7afc9b148e28ed
> Does the improvement come from the CPU not goint to idle or from the
> glink response processing?
Although both are contributing to performance improvement, the major
improvement is coming from CPU not going to idle state.
Thanks,
Ekansh
>
>> Regarding your concerns about power consumption, while in-driver polling
>> eliminates CPU wakeup and scheduling, it does increase power consumption.
>> However, the performance gains seem to outweigh this increase.
>>
>> Do you think the poll implementation that you suggested above could provide similar
>> improvements?
> No, I agree here. I was more concentrated on userspace polling rather
> than hw polling.
>
next prev parent reply other threads:[~2025-03-20 15:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 4:42 [PATCH v2 0/5] misc: fastrpc: Add invokeV2 to support new features Ekansh Gupta
2025-01-27 4:42 ` [PATCH v2 1/5] misc: fastrpc: Move fdlist to invoke context structure Ekansh Gupta
2025-01-27 15:37 ` Dmitry Baryshkov
2025-01-27 4:42 ` [PATCH v2 2/5] misc: fastrpc: Introduce context params structure Ekansh Gupta
2025-01-27 15:43 ` Dmitry Baryshkov
2025-01-29 4:57 ` Ekansh Gupta
2025-01-29 10:29 ` Dmitry Baryshkov
2025-01-27 4:42 ` [PATCH v2 3/5] misc: fastrpc: Add CRC support using invokeV2 request Ekansh Gupta
2025-01-29 10:41 ` Dmitry Baryshkov
2025-01-27 4:42 ` [PATCH v2 4/5] misc: fastrpc: Add polling mode support for fastRPC driver Ekansh Gupta
2025-01-28 23:29 ` Dmitry Baryshkov
2025-01-29 5:42 ` Ekansh Gupta
2025-01-29 10:40 ` Dmitry Baryshkov
2025-03-20 13:49 ` Ekansh Gupta
2025-03-20 14:15 ` Dmitry Baryshkov
2025-03-20 15:57 ` Ekansh Gupta [this message]
2025-03-21 10:18 ` Ekansh Gupta
2025-03-21 11:17 ` Dmitry Baryshkov
2025-03-21 13:13 ` Ekansh Gupta
2025-01-27 4:42 ` [PATCH v2 5/5] misc: fastrpc: Modify context id mask to support polling mode Ekansh Gupta
2025-01-28 23:30 ` Dmitry Baryshkov
2025-01-29 5:43 ` Ekansh Gupta
2025-01-29 11:23 ` Dmitry Baryshkov
2025-02-10 9:05 ` Ekansh Gupta
2025-02-10 10:35 ` Dmitry Baryshkov
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=e46be95c-ca8d-48ce-a616-5f068bd28ebc@oss.qualcomm.com \
--to=ekansh.gupta@oss.qualcomm.com \
--cc=arnd@arndb.de \
--cc=dmitry.baryshkov@linaro.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_bkumar@quicinc.com \
--cc=quic_chennak@quicinc.com \
--cc=srinivas.kandagatla@linaro.org \
/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®