linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Renius Chen <reniuschengl@gmail.com>
To: linux-pm@vger.kernel.org, sebastian.reichel@collabora.com,
	rjw@rjwysocki.net
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Ben Chuang <Ben.Chuang@genesyslogic.com.tw>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [v2] mmc: sdhci-pci-gli: Improve Random 4K Read Performance of GL9763E
Date: Tue, 17 Aug 2021 18:30:29 +0800	[thread overview]
Message-ID: <CAJU4x8uX-EG44DTak8447H6Y-RCo1k6+2ufJ_5rrw_RdXtWMwQ@mail.gmail.com> (raw)
In-Reply-To: <CAJU4x8u-GF8usNojgwFho_vhA5aB__3xxbhxNyaErriY485+zg@mail.gmail.com>

Hi PM maintainers,


Thanks for being patient with me.

Do you have any comments or suggestions about the discussions?

Please kindly let me know if you have any thought on how to proceed with this.

Thank you.


Best regards,

Renius

Renius Chen <reniuschengl@gmail.com> 於 2021年8月10日 週二 下午12:23寫道:
>
> Hi,
>
>
> First I'd like to appreciate your time reading this mail.
>
> We had some issues with submitting a patch to MMC and the reviewer
> suggested us to look for some help from the PM mailing list.
>
> GL9763e is a PCIe card reader. During a sequence of random 4K reads,
> due to the long idle period time between read requests, GL9763e will
> enter ASPM L1 very frequently. Hence the performance of random 4K
> reads is very worse.
>
> We tried to enlarge the ASPM L1 entry delay to avoid GL9763e from
> entering ASPM L1 by the idle period time during 4K reads. But such an
> adjustment also affects other use cases. It will reduce the frequency
> of entering ASPM L1 under all conditions so that the battery life will
> be shorter. This will cause the PLT test to fail.
>
> So we develop a patch to balance the performance of 4K reads and the
> battery life. Our purpose is only to improve the performance of 4K
> reads, but not to affect any other use cases. First, we monitor the
> requests, when a sequence of 4K reads is performing, we'll modify the
> value of a vendor specified register in GL9763e to disable ASPM L1 by
> the GL9763e hardware. Then re-enable ASPM L1 after the 4K reads are
> finished.
>
> But MMC reviewers think such behaviors may not be suitable for a MMC
> host driver and believe that there may be some better ways to achieve
> our goals.
>
> So I'm here to ask for your advice. Do you have any ideas for this
> case? Are this scenario and ASPM related to runtime PM? In my
> cognition, the entering and exiting of ASPM L0s and L1 are pure
> hardware behaviors and not handled by software, they are different
> from suspend/resume and runtime PM and D0/D3, right?
>
> Thanks a lot.
>
>
> Best regards,
>
> Renius
>
> Adrian Hunter <adrian.hunter@intel.com> 於 2021年8月4日 週三 下午2:26寫道:
> >
> > On 19/07/21 12:26 pm, Renius Chen wrote:
> > > Adrian Hunter <adrian.hunter@intel.com> 於 2021年7月16日 週五 下午6:27寫道:
> > >>
> > >> On 14/07/21 5:15 am, Renius Chen wrote:
> > >>> Hi Adrain,
> > >>>
> > >>> What do you think of this patch?
> > >>> Or do you have any ideas or suggestions about the modification for
> > >>> Ulf's comments?
> > >>
> > >> Perhaps try to define your power management requirements in terms of
> > >> latencies instead of request size, and then take the issue to the
> > >> power management mailing list and power management maintainers for
> > >> suggestions.  You will probably need to point out why runtime PM doesn't
> > >> met your requirements.
> > >>
> > >
> > > Hi Adrain,
> > >
> > >
> > > Thanks for your advice.
> > >
> > > Our purpose is only to improve the performance of 4K reads, and we
> > > hope that it doesn't affect any other use cases. If we look into the
> > > latencies, it may affect not only 4K reads but also some other use
> > > cases.
> >
> > I just meant that, if you present the problem to people on the power
> > management mailing lists,  you probably need to describe the problem at
> > an engineering level, instead of describing your solution at a
> > programming level.
> >
> > >
> > > Behaviors of ASPM is controlled by circuits of hardware. Drivers only
> > > enable or disable ASPM or set some parameters for ASPM, and are not
> > > able to know when the device enters or exits the L0s/L1 state. So the
> > > PM part of drivers may not suit this case.
> > >
> > > This patch could be simply divided into two parts:
> > > 1. Monitor requests.
> > > 2. Set a vendor specific register of GL9763e.
> > >
> > > The part 2 is no problems we think. And Ulf thinks that the behaviors
> > > of part 1 should not be implemented in sdhci-pci-gli.c. Do you have
> > > any suggestions on where we can implement the monitoring?
> > >
> > > Thank you.
> > >
> > >
> > > Best regards,
> > >
> > > Renius
> > >
> > >>>
> > >>> Thank you.
> > >>>
> > >>>
> > >>> Best regards,
> > >>>
> > >>> Renius
> > >>>
> > >>> Renius Chen <reniuschengl@gmail.com> 於 2021年7月7日 週三 下午9:49寫道:
> > >>>>
> > >>>> Ulf Hansson <ulf.hansson@linaro.org> 於 2021年7月7日 週三 下午8:16寫道:
> > >>>>>
> > >>>>> [...]
> > >>>>>
> > >>>>>>
> > >>>>>> Thanks, I understand what you mean.
> > >>>>>>
> > >>>>>> I simply searched for the keyword "MMC_READ_MULTIPLE_BLOCK" in the
> > >>>>>> drivers/mmc/host folder, and found that in some SD/MMC host controller
> > >>>>>> driver codes such as alcor.c, cavium.c, ...etc, there are also
> > >>>>>> behaviors for monitoring the request in their driver. What's the
> > >>>>>> difference between theirs and ours?
> > >>>>>
> > >>>>> Those checks are there to allow the HWs to be supported properly.
> > >>>>>
> > >>>>>>
> > >>>>>> And if the code that monitors the requstes does not belong the driver,
> > >>>>>> where should I implement the code and how to add some functions only
> > >>>>>> for GL9763e in that place, in your opinion?
> > >>>>>
> > >>>>> Honestly, I am not sure what suits your use case best.
> > >>>>>
> > >>>>> So far we have used runtime PM with a default auto suspend timeout, in
> > >>>>> combination with dev PM Qos. In other words, run as fast as possible
> > >>>>> to complete the requests in the queue then go back to idle and enter a
> > >>>>> low power state. Clearly, that seems not to be sufficient for your use
> > >>>>> case, sorry.
> > >>>>>
> > >>>> Yes, the runtime PM, auto suspend, and PM Qos are all about the
> > >>>> suspend/resume behaviors of the system or related to power states such
> > >>>> as D0/D3 of the device. But these are totally different from the ASPM
> > >>>> L0s/L1 for link states. Entering/exiting the ASPM is pure hardware
> > >>>> behavior on the link layer and is not handled by any codes in
> > >>>> drivers/mmc/core or drivers/mmc/host. We'd like to try to modify the
> > >>>> patch by your opinions, but we are also confused about what or where
> > >>>> suits our use case best. So we wonder how to start the modification
> > >>>> and may need some suggestions to deal with the work, sorry.
> > >>>>
> > >>>> Thank you.
> > >>>>
> > >>>>
> > >>>> Best regards,
> > >>>>
> > >>>> Renius
> > >>>>
> > >>>>
> > >>>>> Kind regards
> > >>>>> Uffe
> > >>
> >

      reply	other threads:[~2021-08-17 10:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05  9:00 [PATCH] [v2] mmc: sdhci-pci-gli: Improve Random 4K Read Performance of GL9763E Renius Chen
2021-07-05 10:02 ` Ulf Hansson
2021-07-05 10:59   ` Renius Chen
2021-07-05 12:50     ` Ulf Hansson
2021-07-05 15:09       ` Renius Chen
2021-07-06  9:16         ` Ulf Hansson
2021-07-06  9:54           ` Renius Chen
2021-07-06 10:08             ` Ulf Hansson
2021-07-06 10:56               ` Renius Chen
2021-07-07 12:15                 ` Ulf Hansson
2021-07-07 13:49                   ` Renius Chen
2021-07-14  2:15                     ` Renius Chen
2021-07-16 10:27                       ` Adrian Hunter
2021-07-19  9:26                         ` Renius Chen
2021-08-04  6:27                           ` Adrian Hunter
2021-08-10  4:23                             ` Renius Chen
2021-08-17 10:30                               ` Renius Chen [this message]

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=CAJU4x8uX-EG44DTak8447H6Y-RCo1k6+2ufJ_5rrw_RdXtWMwQ@mail.gmail.com \
    --to=reniuschengl@gmail.com \
    --cc=Ben.Chuang@genesyslogic.com.tw \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sebastian.reichel@collabora.com \
    --cc=ulf.hansson@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;
as well as URLs for NNTP newsgroup(s).