public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: Christoph Hellwig <hch@lst.de>, Mikulas Patocka <mpatocka@redhat.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Alasdair Kergon <agk@redhat.com>, DMML <dm-devel@lists.linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Snitzer <snitzer@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND PATCH] dm-ebs: Mark full buffer dirty even on partial write
Date: Thu, 20 Nov 2025 13:08:57 +0100	[thread overview]
Message-ID: <aR8E2ZZtOi0RZt06@pc636> (raw)
In-Reply-To: <20251120062146.GA29990@lst.de>

On Thu, Nov 20, 2025 at 07:21:46AM +0100, Christoph Hellwig wrote:
> On Wed, Nov 19, 2025 at 06:26:13PM +0100, Mikulas Patocka wrote:
> > 
> > 
> > On Wed, 19 Nov 2025, Christoph Hellwig wrote:
> > 
> > > On Tue, Nov 18, 2025 at 06:21:56PM +0100, Mikulas Patocka wrote:
> > > > OK - I accepted Uladzislau's patch. As logical block size and physical 
> > > > block size seem to be unreliable, it's better to set the size in dm-ebs.
> > > 
> > > logical and physical block size are reliable.  Uladzislau just seems
> > > to have a completely broken device that needs fixing, because it will
> > 
> > He created a qemu-emulated NVMe device with physical and logical block 
> > size 8192 in a virtual machine. And logical block size was reported as 512 
> > in the guest kernel - so it is either a qemu bug or a kernel bug.
> 
> No, that's not the case.  If you use his command line you'll see a qemu
> device with 8192 logical blocks assuming you have support for large
> folios, or a completely unusuable device that claims to have 512
> byte blocks for compatibility, but also a capacity of zero so that no
> one can use it for anything but passthrough.
> 
> > in nvme_update_disk_info there is this piece of code:
> >         if (blk_validate_block_size(bs)) {
> >                 bs = (1 << 9);
> >                 valid = false;
> >         }
> 
> Yes, that's what I mentioned above.  The valid=false sets the capacity
> to zero, so you're not actually going to be able to use this device.
> 
> > So, the valid block size depends on whether CONFIG_TRANSPARENT_HUGEPAGE is 
> > defined, which is quite weird.
> 
> And also the page size, and none of that is too weird.  You need support
> efficiently allocating large order folios to support a
> block size > PAGE_SIZE and currently CONFIG_TRANSPARENT_HUGEPAGE is
> the guard for that.  There was some talk of lifting that, but that
> requires a bit of work.
> 
Could you please check below? Is the last one is correctly reported?
I have enabled the CONFIG_TRANSPARENT_HUGEPAGE option. If i specify,
8192, 8192 first case, reports are what i set. Second variant 512, 8129
shows 512, 512:

CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set

-device nvme,drive=drv0,serial=foo,logical_block_size=8192,physical_block_size=8192
urezki@pc638:~$ sudo nvme list
Node                  Generic               SN                   Model                                    Namespace Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            foo                  QEMU NVMe Ctrl                           1           8.49  GB /   8.49  GB      8 KiB +  0 B   10.0.6
urezki@pc638:~$ sudo cat /sys/block/nvme0n1/queue/logical_block_size
8192
urezki@pc638:~$ sudo cat /sys/block/nvme0n1/queue/physical_block_size
8192
urezki@pc638:~$


-device nvme,drive=drv0,serial=foo,logical_block_size=512,physical_block_size=8192
urezki@pc638:~$ sudo nvme list
Node                  Generic               SN                   Model                                    Namespace Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            foo                  QEMU NVMe Ctrl                           1           8.49  GB /   8.49  GB    512   B +  0 B   10.0.6
urezki@pc638:~$ sudo cat /sys/block/nvme0n1/queue/physical_block_size
512
urezki@pc638:~$ sudo cat /sys/block/nvme0n1/queue/logical_block_size
512
urezki@pc638:~$

Is that what should be reported?

--
Uladzislau Rezki

  reply	other threads:[~2025-11-20 12:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 10:59 [RESEND PATCH] dm-ebs: Mark full buffer dirty even on partial write Uladzislau Rezki (Sony)
2025-11-17 20:48 ` Mikulas Patocka
2025-11-18 11:39   ` Uladzislau Rezki
2025-11-18 12:00     ` Mikulas Patocka
2025-11-18 12:40       ` Uladzislau Rezki
2025-11-18 12:46         ` Christoph Hellwig
2025-11-18 14:15       ` Benjamin Marzinski
2025-11-18 17:21         ` Mikulas Patocka
2025-11-19  5:46           ` Christoph Hellwig
2025-11-19  8:43             ` Uladzislau Rezki
2025-11-19  8:53               ` Christoph Hellwig
2025-11-19  8:57                 ` Uladzislau Rezki
2025-11-19  9:00                   ` Christoph Hellwig
2025-11-19  9:01                     ` Uladzislau Rezki
2025-11-19  9:05                       ` Christoph Hellwig
2025-11-19  9:13                         ` Uladzislau Rezki
2025-11-19  9:17                           ` Christoph Hellwig
2025-11-19 17:26             ` Mikulas Patocka
2025-11-20  6:21               ` Christoph Hellwig
2025-11-20 12:08                 ` Uladzislau Rezki [this message]
2025-11-20 12:40                   ` Uladzislau Rezki
2025-11-21  7:25                     ` Christoph Hellwig
2025-11-21  7:24                   ` Christoph Hellwig
2025-11-21 13:21                     ` Uladzislau Rezki
2025-11-21 16:48                       ` Benjamin Marzinski
2025-11-24 10:43                         ` Uladzislau Rezki
2025-11-24 14:30                       ` Christoph Hellwig
2025-11-24 15:30                         ` Uladzislau Rezki
2025-11-24 17:00                           ` Christoph Hellwig
2025-11-24 18:05                             ` Uladzislau Rezki
  -- strict thread matches above, loose matches on Subject: below --
2025-10-14 14:47 Uladzislau Rezki (Sony)
2025-10-16 19:59 ` Andrew Morton
2025-10-17 15:55   ` Uladzislau Rezki

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=aR8E2ZZtOi0RZt06@pc636 \
    --to=urezki@gmail.com \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@redhat.com \
    /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