From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964931AbcIPQUk (ORCPT ); Fri, 16 Sep 2016 12:20:40 -0400 Received: from mail-vk0-f54.google.com ([209.85.213.54]:36449 "EHLO mail-vk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935973AbcIPQUc (ORCPT ); Fri, 16 Sep 2016 12:20:32 -0400 MIME-Version: 1.0 In-Reply-To: <20160916165431.1f2e6df5@lxorguk.ukuu.org.uk> References: <20160916165431.1f2e6df5@lxorguk.ukuu.org.uk> From: Andy Lutomirski Date: Fri, 16 Sep 2016 09:20:10 -0700 Message-ID: Subject: Re: Should drivers like nvme let userspace control their latency via dev_pm_qos? To: One Thousand Gnomes Cc: Andy Lutomirski , "linux-pm@vger.kernel.org" , "Rafael J. Wysocki" , Keith Busch , Jens Axboe , linux-nvme@lists.infradead.org, "linux-kernel@vger.kernel.org" , J Freyensee , Christoph Hellwig Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 16, 2016 at 8:54 AM, One Thousand Gnomes wrote: > On Fri, 16 Sep 2016 08:26:03 -0700 > Andy Lutomirski wrote: > >> I'm adding power management to the nvme driver, and I'm exposing >> exactly one knob via sysfs: the maximum permissible latency. This >> isn't a power domain issue, and it has no dependencies -- it's >> literally just the maximum latency that the driver may impose on I/O >> for power saving purposes. > > Why is this in the driver. Surely the latency is a property of the > request queue and the requests being made. Now it may well be that its > implement as min(list-of-queues) but a device sysfs node seems a strange > place to stick it. > I'm not sure what you mean. The whole device can be programmed to take a nap when fully idle. The driver can limit how deep that nap is and thus how long the next request can be delayed while the device wakes back up. Unlike the very small number of in-tree users of this type of mechanism that I can find, there are no busses or hard tolerances involved. The only effect is a power consumption vs I/O performance tradeoff. --Andy