From: Jens Axboe <axboe@fb.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: <linux-nvme@lists.infradead.org>,
Keith Busch <keith.busch@intel.com>,
Christoph Hellwig <hch@lst.de>, stable <stable@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer
Date: Fri, 26 Aug 2016 09:06:31 -0600 [thread overview]
Message-ID: <8f272cfe-6cc9-0699-6613-49dc09152c65@fb.com> (raw)
In-Reply-To: <CALCETrV+ndPPGhoO5zwQWC5knvrRF8NKtk2hx0CgCqg60=vGmQ@mail.gmail.com>
On 08/26/2016 08:31 AM, Andy Lutomirski wrote:
> On Aug 25, 2016 4:20 PM, "Jens Axboe" <axboe@fb.com> wrote:
>>
>> On 08/25/2016 01:54 AM, Andy Lutomirski wrote:
>>>
>>> On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig <hch@lst.de> wrote:
>>>>
>>>> Ooops, yes.
>>>>
>>>> Are you looking into new nvme_set_features users? Another thing
>>>> we need to tackle is either replacing dma_addr argument with a
>>>> a real kernel pointer (or just kill it until users show up)
>>>
>>>
>>> I am, and I have a patch to do the former (and to add a length
>>> argument). But that's not -stable material.
>>>
>>> While I have your attention: the new use is to enable APST (power
>>> saving). In theory, it seems like I should integrate with dev_pm_qos
>>> so that the standard interface for setting a latency limit will work,
>>> but, on brief inspection, there are literally no drivers in the entire
>>> tree that do this. Am I missing something? My current draft patch
>>> just adds a sysfs attribute. (It saves a *lot* of power on my laptop,
>>> so supporting APST is worth doing.)
>>
>>
>> Care to send out what you have? I'd be interested in seeing how much I
>> can save on my laptop, haven't played with APST yet.
>
> https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/log/?h=nvme/power
>
> There are some todos:
>
> - Default to a nonzero latency (e.g. 7ms? My SSD needs 5.5ms for max
> power saving.) To test it, write something like 7000000 to
> apst_max_latency_ns.
>
> - Add a real changelog.
>
> - Optionally add a sysfs binfile or other interface to allow
> uploading an entire custom table.
>
> - Consider *deleting* the SCSI translation layer's power saving code.
> It looks almost entirely bogus to me. It has an off-by-one in its
> NPSS handling, it hardcodes power state indices which is total BS, it
> ignores the distinction between operational and non-operational states
> (which I think matters for non-APST usage). It also seems likely to
> be that it's never been used, since it's one of the formerly
> crashy-looking set_features users.
>
> You can inspect what it's doing with something like:
>
> # nvme get-feature -f 0x0c -H -s 0 /dev/nvme0
>
> if you have nvme-cli installed.
Thanks, I'll give it a whirl. One issue in a previous patch - you have
nvme_set_features() take a const buffer, which makes sense. But then you
pass it to __nvme_submit_sync_cmd(), which of course takes both
read/write commands, and hence the buffer isn't const.
--
Jens Axboe
prev parent reply other threads:[~2016-08-26 15:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-24 10:52 Andy Lutomirski
2016-08-24 11:04 ` Sagi Grimberg
2016-08-24 14:11 ` Jens Axboe
2016-08-25 7:38 ` Christoph Hellwig
2016-08-25 7:54 ` Andy Lutomirski
2016-08-25 8:27 ` Christoph Hellwig
2016-08-25 14:20 ` Jens Axboe
2016-08-26 14:31 ` Andy Lutomirski
2016-08-26 14:35 ` Christoph Hellwig
2016-08-26 15:17 ` Keith Busch
2016-08-26 15:12 ` Jens Axboe
2016-08-26 15:06 ` Jens Axboe [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=8f272cfe-6cc9-0699-6613-49dc09152c65@fb.com \
--to=axboe@fb.com \
--cc=hch@lst.de \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=luto@amacapital.net \
--cc=stable@vger.kernel.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
all inboxes | Powered by JetHome®