Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4527663pxv; Tue, 6 Jul 2021 03:10:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ/R8UWbWbBGUt+4evrR/rgutD5QF/mg1A9fGNu6gaFHptZ6RA32D5HWXK/hUaRjiJL489 X-Received: by 2002:a05:6402:128d:: with SMTP id w13mr20867981edv.202.1625566235842; Tue, 06 Jul 2021 03:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625566235; cv=none; d=google.com; s=arc-20160816; b=PJLgWHF9YGMfvZjQNtvfQeuCjVnCx0sBBCJhelDPOKHd51eNgzCO+uDHotftk2dFaD tZz50znbsMU3QzG4zW9gFkpazPDlpHqWGyn4XKG1gnI3XrVKX/oTYo4m9GNGm7eGJfZx /hlEg+l1kV+KITbYVTDZPsAbKvSfORg9YJwlVEsgr2V8jsSSrA7b4lBs6iQtBvOhCG0e gMOLp0Kvu1YSs5PAsd8PGGP+Yr536i3fpfZRfm/WfYor+HfTCmDQuQ6hC0H/4iCyFbC+ UVjfl9SiL+KmTUw8tvHp2gwsN8FH8oBOI2g3YgRGIcZQ1i81l8aJvkWtHg6o+Pz4JnIs UnfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PEeLkirnfCYQuHYnsGsdZPBzkk8jMtMxsiPF74aFxoU=; b=TZwsXW5jG5RV8Os+rJnd8K0FCdh74Gc4ct2bqy81mQoknmpe26UpjW6m/K73NrngUs ouo3MjjP26UQI+GxuWv5rbB1VD05O4zMfggK5BfCZk/h7WdCEl8Ad8H5uDKWcW3oqY/7 dvhFsf1+CDTLGaSooKTfoWUIfVKKdW85U7h2tHLp7HqaBJXnEpmFWubm/0N/YQ7M5nCv pwYA8zi0sBQxVNnsomGSO59wV2lumulGpV+wh+QTPuEevDEwnm5GF0jmbzyhn22e4HsP rWoifWDZMYZ8ZJ+TYy1Ly6MXpck1D1+Opdrot5NxCyCRWAF6SywyRPB46ShEg1sJRpGv Ll+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lV08qaQE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 3si13493603ejl.715.2021.07.06.03.10.12; Tue, 06 Jul 2021 03:10:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lV08qaQE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231284AbhGFKLZ (ORCPT + 99 others); Tue, 6 Jul 2021 06:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231221AbhGFKLZ (ORCPT ); Tue, 6 Jul 2021 06:11:25 -0400 Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16B9FC06175F for ; Tue, 6 Jul 2021 03:08:46 -0700 (PDT) Received: by mail-vs1-xe2e.google.com with SMTP id g24so4117932vsa.10 for ; Tue, 06 Jul 2021 03:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PEeLkirnfCYQuHYnsGsdZPBzkk8jMtMxsiPF74aFxoU=; b=lV08qaQEyrd56tWjENCu7ugufvgUr7HBL7oNTdTFz0/BrRJr1meUQ1LdLQm3dBXuki Z0dpOKR7iFK7UxVMCCBvuKM3DW19IyWJKqMEfc09wqrbrDrmeVymbMJIcZrITV9YZUUf Wlr6Rm0RsRZO++QhT5U6M6fD66yMlGWzCW4d4VRzUUEIKXMCgvDBxYFfiofbfESYgolm GeCtUWklFwr6xz3pOUDO714+v5NgLt5PFcHs+LZACSdYSRePXOVVM+P8gFBb50yoxkio VHvDBDAtM1FSYb/GjzAtwbwT9fIg/YsMrF8vBiKdO56Zs1osEYr6iIHe/p5fm7pmrdaz IJYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PEeLkirnfCYQuHYnsGsdZPBzkk8jMtMxsiPF74aFxoU=; b=PSiqZ5DI7IYgraIhBdOLNX5NrBa+Qvjtue4J+Wq7DcRVfgXImh32secRD4GFdkiTW9 OqBgJVHxjVufU7KAje40A8H2/HhhXYqZN+5ydA3ZkJmjGXkR3gSYB+ej1QO5uwreb6Gh 8FnhOlvU7PpQKMbPqIiKGzZjAS0PFLVQ+XIjlQpdM89o7ujPiJkVodGNzIAmldBcoOwW 8duKSVfUzVwh3MAGwP2Ml2zISquPaub0WOC+Vvjb5fTgYccwdxWrXypUhc91AB9038lJ gyhACkmAqxEEeyX5WUHTPwtxodJ/3yrbJ6WWyqSKDT5yaKVj4Q/TFbuRJh6E6aS4t/2Q MwFA== X-Gm-Message-State: AOAM530t4ERgp2hgMROBuTagUUmH2IayaENyseVF3rYEQ0CIG8awP29p n2s0emtc8ZFBesSUtRNTRgqDKxUw2PXG+WtGxpOf3g== X-Received: by 2002:a67:8095:: with SMTP id b143mr14129643vsd.48.1625566125254; Tue, 06 Jul 2021 03:08:45 -0700 (PDT) MIME-Version: 1.0 References: <20210705090050.15077-1-reniuschengl@gmail.com> In-Reply-To: From: Ulf Hansson Date: Tue, 6 Jul 2021 12:08:08 +0200 Message-ID: Subject: Re: [PATCH] [v2] mmc: sdhci-pci-gli: Improve Random 4K Read Performance of GL9763E To: Renius Chen Cc: Adrian Hunter , linux-mmc , Linux Kernel Mailing List , Ben Chuang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [...] > > > 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. Kind regards Uffe