LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Renius Chen <reniuschengl@gmail.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ben Chuang <Ben.Chuang@genesyslogic.com.tw>
Subject: Re: [PATCH] [v2] mmc: sdhci-pci-gli: Improve Random 4K Read Performance of GL9763E
Date: Tue, 6 Jul 2021 18:56:57 +0800	[thread overview]
Message-ID: <CAJU4x8t+aOqq82EJMUNDpWiE3GPeyZkjFhy=AkmctcDE3mx6fA@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFpvCFYQVEp77hiRHY6CVDej-ffF5UE=LH=HSGcqMZA02w@mail.gmail.com>

Ulf Hansson <ulf.hansson@linaro.org> 於 2021年7月6日 週二 下午6:08寫道:
>
> [...]
>
> > > > Thanks for your explanation.
> > > >
> > > > I think there may be some misunderstandings here.
> > >
> > > I fully understand what you want to do.
> > >
> > > >
> > > > Our purpose is to avoid our GL9763e from entering ASPM L1 state during
> > > > a sequence of 4K read requests. So we don't have to consider about the
> > > > behavior/performance of the eMMC/SD card and what eMMC/SD card that is
> > > > being used. We just need to know what kind of requests we are
> > > > receiving now from the PCIe root port.
> > > >
> > > > Besides, the APSM L1 is purely hardware behavior in GL9763e and has no
> > > > corresponding relationship with runtime PM. It's not activated by
> > > > driver and the behaviors are not handled by software. I think runtime
> > > > PM is used to handle the behaviors of D0/D3 of the device, but not the
> > > > link status of ASPM L0s, L1, etc.
> > >
> > > Maybe runtime PM isn't the perfect fit for this type of use case.
> > >
> > > That still doesn't matter to to me, I will not accept this kind of
> > > governor/policy based code for use cases, in drivers. It doesn't
> > > belong there.
> > >
> >
> > Hi Ulf,
> >
> > The behavior of this patch is to set the value of a GL9763e vendor
> > specified register. Why it doesn't belong to GL9763e driver but other
> > common codes?
>
> Let me try one more time.
>
> The code that is needed to put the GL9763e HW into low power state
> (writing to GL9763e specific register) certainly belongs in the
> driver.
>
> The code that monitors for a specific use case does not.
>
> >
> > > >
> > > > I agree that the policy of balancing performance vs the energy cost is
> > > > a generic problem that all mmc drivers share. But our driver of
> > > > GL9763e is a host driver, the setting in this patch is also only for
> > > > GL9763e, could not be used by other devices. It depends on our
> > > > specific hardware design so that it is not a generic solution or
> > > > policy. So I think to implement such a patch in our specific GL9763e
> > > > driver to execute the specific actions just for our hardware design is
> > > > reasonable.
> > >
> > > From the use case point of view, the GL9763e hardware design isn't at
> > > all specific.
> > >
> > > In many cases, controllers/platforms have support for low power states
> > > that one want to enter to avoid wasting energy. The difficult part is
> > > to know *when* it makes sense to enter a low power state, as it also
> > > introduces a latency when the power needs to be restored for the
> > > device, to allow it to serve a new request.
> > >
> > > To me, it sounds like you may have been too aggressive on avoid
> > > wasting energy. If I understand correctly the idle period you use is
> > > 20/21 us, while most other drivers use 50-100 ms as idle period.
> > >
> >
> > Yes, according to our customer's test for the GL9763e, if the ASPM L1
> > entry delay of GL9763e, which is the idle period you mentioned, is
> > larger than 20/21 us, it will not pass the PLT test. The PLT is
> > requested by Google for evaluating the product's battery life. The
> > product won't be accepted by Google if it fails the PLT test. So we
> > set the ASPM L1 entry delay to 20/21us.
> >
> > With such a short idle period, during 4K reads, the idle time between
> > the read requests will be larger than 20/21us, so GL9763e will enter
> > ASPM L1 very frequently to impact the performance.
> >
> > The bad performance of 4K reads was highlighted by Google, too. Our
> > customer has to pass both the PLT test and 4K read performance test by
> > Google's request. So after some discussions with our customer and
> > Google, we decided to submit such a patch to get the best balance to
> > satisfy Google's requiremnet.
> >
> > The function and the register is vendor specified of GL9763e, so we
> > access it in the vendor driver of GL9763e. Add some functions in other
> > mmc general codes to do something only for GL9763e and can not be
> > applied by other devices might be a little bit strange and difficult
> > to implement and design?
>
> I haven't said implementation need to be easy, but suggest a few
> options to move forward.
>
> What did state and I am not going to change my opinion on this, is the
> governor code that monitors for use cases, don't belong in the driver.
>

Hi Ulf,


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?

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?

Thanks for clarifying my questions.


Best regards,

Renius

> Kind regards
> Uffe

  reply	other threads:[~2021-07-06 10:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05  9:00 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 [this message]
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

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='CAJU4x8t+aOqq82EJMUNDpWiE3GPeyZkjFhy=AkmctcDE3mx6fA@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=ulf.hansson@linaro.org \
    --subject='Re: [PATCH] [v2] mmc: sdhci-pci-gli: Improve Random 4K Read Performance of GL9763E' \
    /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

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).