archive mirror
 help / color / mirror / Atom feed
From: Sagi Grimberg <>
To: Eduard Hasenleithner <>,
Subject: Re: [RFC PATCH] Workaround for discard on non-conformant nvme devices
Date: Wed, 6 Nov 2019 08:52:20 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

> As documented in 
> there are lots of Linux nvme users which get IO-MMU related errors when 
> performing discard on nvme. So far analysis suggests that the errors are 
> caused by non-conformat nvme devices which are reading beyond the end of 
> the buffer containing the segments to be discarded.
> Until now two different variants of this behavior have been observed: 
> The controller found on an Intel 660p always reads a multiple of 512 
> bytes. If the last chunk exceeds a page it continues with the subsequent 
> page. For a Corsair MP510 the situation is even worse: The controller 
> always reads a full page (4096) bytes. Then when the address is not 
> aligned to 4096 it will continue reading at the address given in PRP2 
> (which is most of the time 0).
> This patch makes the nvme_setup_discard function always request a 
> multiple of a page size (4096) from the kernel for storing the segment 
> array. Since this makes the buffer always page-aligned the device 
> reading beyond end of a page is avoided.

This needs to come with a quirk for it.

Linux-nvme mailing list

  reply	other threads:[~2019-11-06 16:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 21:47 [RFC PATCH] Workaround for discard on non-conformant nvme devices Eduard Hasenleithner
2019-11-06 16:52 ` Sagi Grimberg [this message]
2019-11-06 18:23   ` Keith Busch
2019-11-06 20:22     ` Eduard Hasenleithner
2019-11-06 20:43       ` Keith Busch
2019-11-06 21:10         ` Eduard Hasenleithner
2019-11-06 21:34           ` Keith Busch

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).