From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E537F331A6A for ; Thu, 20 Nov 2025 12:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763640545; cv=none; b=FX1Vnt/I88drVKs8gmuwvmGudZ3ez+OUXlpwVUgrIekRma/nTeDyyHwPj6i3iPh9PR38QTyf3iuWkr9AJrpgBy+FVP2udy12Ys8I5lFl/7//wcSTlOCxnnCHG8eVxlz4Aw6RxcHEREWeVmeWezkAfLQdEkRgHqnEfkCJRarGTgo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763640545; c=relaxed/simple; bh=seHnSyCooazZojpELWr+OQKHQURWhqUl4F7yf606yN4=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FfK0v0E/9TWcj8T1KQFGMLKMHcIupRNmTeccQTshgh0z4JX3WBCKkYhZmpGFMNQGTaTylcT7639+WicKj3QVJHEI40NHoSgfx+m1tNZiTaRo1+r4nKg/m34d1jf78w6FfVyBhrNbQWz+Ac4RySn35XDhWbnmzKxY15LZW0XpdR8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=leA5mRxW; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="leA5mRxW" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-376466f1280so8855611fa.0 for ; Thu, 20 Nov 2025 04:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763640541; x=1764245341; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=/g8fBDnEE2On46nmgx0El4PG4kANQXkHhXEGlkgHyMQ=; b=leA5mRxWu0RtVkVdcqPoaxKmsEluGoUfUN2RP7ZWHLv2fYELuUt3f8miD7PfjY3pFC b9O8Xt9PozbpBLZulVEcD589+m5WgnNzFEvy/2UZ1dB9XloZQNzz2hisvMqhdThfKD5c C+rRr8UubD7xhnycsPJR0Nm7NFOm59plCPE20ewgGrIw2Gc+ZaQq3gePApCXMouEXBP9 kBkSYr7nWWBN9kY16oUGkycE1ilxKDlocb0ulgu7U/PAt62WgIYCOkqJTNST1RRW8Dkd oiJ/LTd4oJ8kvsjdlf7yuSXRG36Fqu68ow8tZT+B8twnEyOzO3zgLTF5Qv0p7pVQWCiu MQMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763640541; x=1764245341; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/g8fBDnEE2On46nmgx0El4PG4kANQXkHhXEGlkgHyMQ=; b=Q4BB93LX0qWiGX0zL1Lf8kpwkXXqficfhHR52uYrR5arorJMNz513ppCW5UjPjETA4 VpQkdlogasB0d35UUpF5CcOPXAAQ2ZK1mwLUp9WPvgMxmjqAWkq24m840iDa9/98sHTq 2qKHzOQtW/zZ8WJTnBw1BwArvpeK7YXyiHLSndmRMgboXLdoPuK93CBKEa2eVHNrJvXb dsoxncluFgZ86PF+IrJO5ixk5O5j9znlXcmApWsRbShzy1VK/Kpwrl5gRGU9AKpOQtPJ ax3VDkbOdY3P2hrFnuQjUECGkmQ/baRXURCAt6iILVKV6ZMskzKrIk+8I2C4SmLfvQ/3 qBFQ== X-Forwarded-Encrypted: i=1; AJvYcCVgp8AWT8D1o8T8o2uvu/odiCiQ5sSuqMcp4NLSQbxCjdYA/TDfdqFNbZs6Yn5yEz098zlyz9pqC8VLE7E=@vger.kernel.org X-Gm-Message-State: AOJu0Yz2ZBDl03YpxM30uULfWwQeftcEfHTWRz+/RjSL3T/YuZDpaEzu INwT55kvnr6F1ktT0Ms3R+NO+Cy66PUxblt7kRKNkSVBp61qSxLaaJ9Z X-Gm-Gg: ASbGncsI8gTS/qP5dJpoB2NOubhDTYACmX3i5oirxux3yMY5qPXZl16paPP97NyvpNo acyi/n+GhY2OhksLU+VrM+xFGtwJgt0ZCziJNYdiyp3HZa9cI2JeuaickvnihCYBd+gf5KHm4VL UElye5bBgnRcuyKT/0DDpIGfZTf2a3LKSRnYdIJamRa89Sd7H09ElBmgGudWdlAJZysleCfZIek d2GMBZJoloCEJkTEKiLJJYvCwBNNyHJhNNgyF+is+V5V3RlJaNVGXBvi9WiAw/JXa9pfiN9ssxX SYkLOmjHXCB1srlIzD2qEcfyYma3I+S/69emmuRWlhyt3LMJCwIvKUz4ws8oSj02HPrphoFvDeJ NP03pB5dqnO3vgS/rAADyOv1WzYW/KrLrW1dUEEH7WYD5TlB4F/QKD6rFY1DY7wnSJKU3ZAGR0s lIYDxxuHMuQ50QVZ7/iR2R0smJagIt8O+AfH+dylRF/R6um1WSBPw= X-Google-Smtp-Source: AGHT+IH6oLGUmNcb+t1bqpnM0vD2fk9qo9xK+6M/p0pM/CHJg4xnZXTEiSw1dg9aOFH3t89ZrfUkYQ== X-Received: by 2002:a05:6512:398b:b0:595:83c6:222a with SMTP id 2adb3069b0e04-5969f234ddfmr690540e87.0.1763640540326; Thu, 20 Nov 2025 04:09:00 -0800 (PST) Received: from pc636 (host-90-233-212-127.mobileonline.telia.com. [90.233.212.127]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5969db89319sm649975e87.36.2025.11.20.04.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 04:08:59 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 20 Nov 2025 13:08:57 +0100 To: Christoph Hellwig , Mikulas Patocka Cc: Mikulas Patocka , Benjamin Marzinski , Uladzislau Rezki , Alasdair Kergon , DMML , Andrew Morton , Mike Snitzer , LKML Subject: Re: [RESEND PATCH] dm-ebs: Mark full buffer dirty even on partial write Message-ID: References: <20251117105945.10179-1-urezki@gmail.com> <73556fc8-5fbf-37cb-26b9-7cdb88f69720@redhat.com> <230baa83-cd79-f232-5fb8-1476115e1ae7@redhat.com> <20251119054635.GB19993@lst.de> <20251120062146.GA29990@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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