public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Thorsten Leemhuis <regressions@leemhuis.info>
Cc: Adrian Huang <ahuang12@lenovo.com>,
	Christoph Hellwig <hch@lst.de>,
	Linux kernel regressions list <regressions@lists.linux.dev>,
	linux-nvme@lists.infradead.org, Jens Axboe <axboe@fb.com>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Regression] File corruptions on SSD in 1st M.2 socket of AsRock X600M-STX
Date: Wed, 8 Jan 2025 08:07:28 -0700	[thread overview]
Message-ID: <Z36UsE5dj6j5HhkX@kbusch-mbp> (raw)
In-Reply-To: <401f2c46-0bc3-4e7f-b549-f868dc1834c5@leemhuis.info>

On Wed, Jan 08, 2025 at 03:38:53PM +0100, Thorsten Leemhuis wrote:
> [side note TWIMC: regression tracking is sadly kinda dormant temporarily
> (hopefully this will change again soon), but this was brought to my
> attention and looked kinda important]
> 
> Hi, Thorsten here, the Linux kernel's regression tracker.
> 
> Adrian, Christoph I noticed a report about a regression in
> bugzilla.kernel.org that appears to be caused by a change you too
> handled a while ago -- or it exposed an earlier problem:
> 
> 3710e2b056cb92 ("nvme-pci: clamp max_hw_sectors based on DMA optimized
> limitation") [v6.4-rc3]

...
 
> > The bug is triggered by the patch "nvme-pci: clamp max_hw_sectors
> > based on DMA optimized limitation" (see https://lore.kernel.org/linux-
> > iommu/20230503161759.GA1614@lst.de/ ) introduced in 6.3.7
> > 
> > To examine the situation, I added this debug info (all files are
> > located in `drivers/nvme/host`):
> > 
> >> --- core.c.orig       2025-01-03 14:27:38.220428482 +0100
> >> +++ core.c    2025-01-03 12:56:34.503259774 +0100
> >> @@ -3306,6 +3306,7 @@
> >>               max_hw_sectors = nvme_mps_to_sectors(ctrl, id->mdts);
> >>       else
> >>               max_hw_sectors = UINT_MAX;
> >> +     dev_warn(ctrl->device, "id->mdts=%d,  max_hw_sectors=%d, 
> >> ctrl->max_hw_sectors=%d\n", id->mdts, max_hw_sectors, ctrl->max_hw_sectors);
> >>       ctrl->max_hw_sectors =
> >>               min_not_zero(ctrl->max_hw_sectors, max_hw_sectors);
> > 
> > 6.3.6 (last version w/o mentioned patch and w/o data corruption) says:
> > 
> >> [  127.196212] nvme nvme0: id->mdts=7,  max_hw_sectors=1024, 
> >> ctrl->max_hw_sectors=16384
> >> [  127.203530] nvme nvme0: allocated 40 MiB host memory buffer.
> > 
> > 6.3.7 (first version w/ mentioned patch and w/ data corruption) says:
> > 
> >> [   46.436384] nvme nvme0: id->mdts=7,  max_hw_sectors=1024, 
> >> ctrl->max_hw_sectors=256
> >> [   46.443562] nvme nvme0: allocated 40 MiB host memory buffer.

It should always be okay to do smaller transfers as long as everything
stays aligned the logical block size. I'm guessing the dma opt change
has exposed some other flaw in the nvme controller. For example, two
consecutive smaller writes are hitting some controller side caching bug
that a single larger trasnfer would have handled correctly. The host
could have sent such a sequence even without the patch reverted, but
happens to not be doing that in this particular test.


  reply	other threads:[~2025-01-08 15:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08 14:38 [Regression] File corruptions on SSD in 1st M.2 socket of AsRock X600M-STX Thorsten Leemhuis
2025-01-08 15:07 ` Keith Busch [this message]
2025-01-09  8:28   ` Christoph Hellwig
2025-01-09  8:52     ` Thorsten Leemhuis
2025-01-09 15:44       ` [Bug 219609] File corruptions on SSD in 1st M.2 socket of AsRock X600M-STX + Ryzen 8700G Stefan
2025-01-10 11:17         ` Bruno Gravato
2025-01-15  6:37         ` Bruno Gravato
2025-01-15  8:40           ` Thorsten Leemhuis
2025-01-16 17:29             ` Thorsten Leemhuis
2025-01-17  8:05             ` Christoph Hellwig
2025-01-17  9:51               ` Thorsten Leemhuis
2025-01-17  9:55                 ` Christoph Hellwig
2025-01-17 10:30                   ` Thorsten Leemhuis
2025-02-04  6:26                     ` Christoph Hellwig
2025-01-17 13:36                 ` Bruno Gravato
2025-01-20 14:31                 ` Thorsten Leemhuis
2025-01-28  7:41                   ` Christoph Hellwig
2025-01-28 12:00                     ` Stefan
2025-01-28 12:52                       ` Dr. David Alan Gilbert
2025-01-28 14:24                         ` Stefan
2025-02-02  8:32                           ` Bruno Gravato
2025-02-04  6:12                             ` Christoph Hellwig
2025-02-04  9:12                               ` Bruno Gravato
2025-02-03 18:48                           ` Stefan
2025-02-06 15:58                             ` Stefan
2025-01-17 21:31               ` Stefan
2025-01-18  1:03                 ` Keith Busch
2025-01-15 10:47           ` Stefan
2025-01-15 13:14             ` Bruno Gravato
2025-01-15 16:26               ` Stefan
2025-01-10  0:10     ` [Regression] File corruptions on SSD in 1st M.2 socket of AsRock X600M-STX 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:
  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=Z36UsE5dj6j5HhkX@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=ahuang12@lenovo.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    /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