Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1659471 > unrolled thread
| Started by | Kai-Heng Feng <kai.heng.feng@canonical.com> |
|---|---|
| First post | 2017-06-07 09:30 +0200 |
| Last post | 2017-06-07 17:30 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 1/2] nvme: only consider exit latency when choosing useful non-op power states Kai-Heng Feng <kai.heng.feng@canonical.com> - 2017-06-07 09:30 +0200
[PATCH 2/2] nvme: relax APST default max latency to 100ms Kai-Heng Feng <kai.heng.feng@canonical.com> - 2017-06-07 09:30 +0200
Re: [PATCH 1/2] nvme: only consider exit latency when choosing useful non-op power states Christoph Hellwig <hch@lst.de> - 2017-06-07 10:30 +0200
Re: [PATCH 1/2] nvme: only consider exit latency when choosing useful non-op power states Andy Lutomirski <luto@kernel.org> - 2017-06-07 17:30 +0200
| From | Kai-Heng Feng <kai.heng.feng@canonical.com> |
|---|---|
| Date | 2017-06-07 09:30 +0200 |
| Subject | [PATCH 1/2] nvme: only consider exit latency when choosing useful non-op power states |
| Message-ID | <tPDzH-3vN-7@gated-at.bofh.it> |
When a NVMe is in non-op states, the latency is exlat.
The latency will be enlat + exlat only when the NVMe tries to transit
from operational state right atfer it begins to transit to
non-operational state, which should be a rare case.
Therefore, as Andy Lutomirski suggests, use exlat only when deciding power
states to trainsit to.
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
drivers/nvme/host/core.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 0f9cc0c55e15..c07d8d4e18c9 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1342,7 +1342,7 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl)
* transitioning between power states. Therefore, when running
* in any given state, we will enter the next lower-power
* non-operational state after waiting 50 * (enlat + exlat)
- * microseconds, as long as that state's total latency is under
+ * microseconds, as long as that state's exit latency is under
* the requested maximum latency.
*
* We will not autonomously enter any non-operational state for
@@ -1387,7 +1387,7 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl)
* lowest-power state, not the number of states.
*/
for (state = (int)ctrl->npss; state >= 0; state--) {
- u64 total_latency_us, transition_ms;
+ u64 total_latency_us, exit_latency_us, transition_ms;
if (target)
table->entries[state] = target;
@@ -1408,12 +1408,15 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl)
NVME_PS_FLAGS_NON_OP_STATE))
continue;
- total_latency_us =
- (u64)le32_to_cpu(ctrl->psd[state].entry_lat) +
- + le32_to_cpu(ctrl->psd[state].exit_lat);
- if (total_latency_us > ctrl->ps_max_latency_us)
+ exit_latency_us =
+ (u64)le32_to_cpu(ctrl->psd[state].exit_lat);
+ if (exit_latency_us > ctrl->ps_max_latency_us)
continue;
+ total_latency_us =
+ exit_latency_us +
+ le32_to_cpu(ctrl->psd[state].entry_lat);
+
/*
* This state is good. Use it as the APST idle
* target for higher power states.
--
2.13.0
[toc] | [next] | [standalone]
| From | Kai-Heng Feng <kai.heng.feng@canonical.com> |
|---|---|
| Date | 2017-06-07 09:30 +0200 |
| Subject | [PATCH 2/2] nvme: relax APST default max latency to 100ms |
| Message-ID | <tPDzH-3vN-11@gated-at.bofh.it> |
| In reply to | #1659471 |
Christoph Hellwig suggests we should to make APST work out of the box.
Hence relax the the default max latency to make them able to enter
deepest power state on default.
Here are id-ctrl excerpts from two high latency NVMes:
vid : 0x14a4
ssvid : 0x1b4b
mn : CX2-GB1024-Q11 NVMe LITEON 1024GB
ps 3 : mp:0.1000W non-operational enlat:5000 exlat:5000 rrt:3 rrl:3
rwt:3 rwl:3 idle_power:- active_power:-
ps 4 : mp:0.0100W non-operational enlat:50000 exlat:100000 rrt:4 rrl:4
rwt:4 rwl:4 idle_power:- active_power:-
vid : 0x15b7
ssvid : 0x1b4b
mn : A400 NVMe SanDisk 512GB
ps 3 : mp:0.0500W non-operational enlat:51000 exlat:10000 rrt:0 rrl:0
rwt:0 rwl:0 idle_power:- active_power:-
ps 4 : mp:0.0055W non-operational enlat:1000000 exlat:100000 rrt:0 rrl:0
rwt:0 rwl:0 idle_power:- active_power:-
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
drivers/nvme/host/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index c07d8d4e18c9..903d5813023a 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -56,7 +56,7 @@ MODULE_PARM_DESC(max_retries, "max number of retries a command may have");
static int nvme_char_major;
module_param(nvme_char_major, int, 0);
-static unsigned long default_ps_max_latency_us = 25000;
+static unsigned long default_ps_max_latency_us = 100000;
module_param(default_ps_max_latency_us, ulong, 0644);
MODULE_PARM_DESC(default_ps_max_latency_us,
"max power saving latency for new devices; use PM QOS to change per device");
--
2.13.0
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@lst.de> |
|---|---|
| Date | 2017-06-07 10:30 +0200 |
| Subject | Re: [PATCH 1/2] nvme: only consider exit latency when choosing useful non-op power states |
| Message-ID | <tPEvL-47A-19@gated-at.bofh.it> |
| In reply to | #1659471 |
Thanks Kai-Heng, I'll add both patches to the nvme-4.12 branch.
[toc] | [prev] | [next] | [standalone]
| From | Andy Lutomirski <luto@kernel.org> |
|---|---|
| Date | 2017-06-07 17:30 +0200 |
| Subject | Re: [PATCH 1/2] nvme: only consider exit latency when choosing useful non-op power states |
| Message-ID | <tPL4d-8ou-3@gated-at.bofh.it> |
| In reply to | #1659471 |
On Wed, Jun 7, 2017 at 12:25 AM, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote: > + exit_latency_us = > + (u64)le32_to_cpu(ctrl->psd[state].exit_lat); Trivial nit: the case is no longer necessary.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web