From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 D6E7334F48A for ; Wed, 19 Nov 2025 14:13:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763561589; cv=none; b=JmO8fNkZoMMKAEcdrsHNTPyq/QLeNnOfau7eOU8004SCnfyLWLnVRbf50lz5/lRWaa091Cw40bP4LelVfN37pZe/3Mx9q/MNO4di3+rjbqEdpLj76bLKhaFTu7GJ3rYXUIzMHjBsQE1ykli0HnMjtDXPdaKnTcda0tiztGMI2p4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763561589; c=relaxed/simple; bh=Z1Z7q1ac2+gy8DVlTXkfsVfycrNnZK4yyj/tSUXz1Cg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oYvmkgRVamaoEvrCNqTYYzi7SmO2P/AzHms+VayNyBQrTIA3PHeGNWaS1Zl5PRjEqzl2FKOrB9vrRx26W2Plie0Ds37KFwZRBOTkUIIhOihhNdWUjt+0MYjIPn6hwQBIbcPxY0lURTx0LDo12PP8W6JVha/WFd0YHgYVx9FwfnI= 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=kFBhr/r0; arc=none smtp.client-ip=209.85.128.44 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="kFBhr/r0" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-47775fb6cb4so49303765e9.0 for ; Wed, 19 Nov 2025 06:13:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763561583; x=1764166383; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=S7aP8W+Aeaqnc8t5oPu3wVtzhhr1g6oARpgSmq5CAOE=; b=kFBhr/r0XLnUdrOln1WexVHp6ChFVXgc6rOPgLic5GpwbEdKkhBcwfebjEEQBu+t8n 96W24pCeAG5m95vHbgcG9pI/LA6UwQP/GFBgcMzfU1uf6v2KuzXuCxrv9ktuWUzZLlPv 1TyqzlwuIGa0K3QIJ40KgXhU1MEzBpYw0TUGy/8/FhnWBevNXnhtfXeKUStIDBvTQeED pKrHQlBj7S6lpmyPB8V1CFW0zBe6+psscyOjyiz1JJisWLtgYwkXcOT+rFaiQnI5wAv2 N90temWyTq9A70+GrwAvn905Md5HjglbVq7hjPAyV2mS93UJDaC2JrawF18iX3Jq6DPc n/Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763561583; x=1764166383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=S7aP8W+Aeaqnc8t5oPu3wVtzhhr1g6oARpgSmq5CAOE=; b=Rn3c5rnFygl4aC94Pc2mTFmD6IUHROKKPbx/hBMoZGooyOXDXEl11JpUG4gNDmtDdG C7bWRrsBSziQTkdGg33DLKaf4obd9JLyteNAn/jVkVNzYQnfFyv5+mXGsfgiJbP6Y1qH JqK6vX+8APbe/74pN1nYa0P16SKcSuWyaO6/+genjEJkK6IiN3LQVCfTSZsUpjcDlTxp gxQMwkhKxRKlhrFSjM+KmxyH+vtFkQP12tsUJV7OpRY4TEPDANDMzrx6wbKiTlsCFcKO 26RYYC+gcMP6mPt0EqUMPRPqK6RPmWp1XnbWp189rvZwdGeMgEMck2hDrtd4fp+dFwf3 +0Mw== X-Forwarded-Encrypted: i=1; AJvYcCXCCBqaB7tt1FVSjwiVbpxTymqRTiTVQN3CrzpCnyZRuko95MmsRBov0NY6jOEQNVpIJyaJ14WcliOuPTQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxA8/Cr5gN+pb8FmOCfsONrxt0wNBxIyvMXjFrCGa6KSYnfqEpE czHFIHJKemHO0n/zlFiF0JYQ9RzL8MR6JN40DIV9WJ8zBLphnjiRRwCjO7CbUQ== X-Gm-Gg: ASbGnctqVYpSwqT5Vps7wRmLN4pKA0iGIlxEuFlIP9+RzQFxuuEpRm77XmEC4OiKdcm k51KXNd72qxcC+sLKVYeHCloHad/RwIk9jmIO9azUzrKY1B6dz6Wu42nmjqzkG5WITieqnPRiU0 2JnMgpo8eoDQ4lntQ4UCX54u0ikVz98iCgmucaTBTGRhTph295CEVj+rqx8AeHnZMkeXmkxi8Vq aW5I/JBKCQBn7Hsjh7A5E841K5CTQnNsoP0vyXqg6W8gq3tTFC5CvXzn0xgA+IfT/pFoZ+HCuDv tjnyQB8Ps31dacxZhryDd7fOzFIz73yqPxTmgTf0KCt020XmI//v2g8OffUlBSY+1HLtc6K5Ole l2nzG4aEW3ZoPeLGBbHh7HuDyohSV6z8844v7Pa0e/HumnFfvCI8PoTT6uQ+z24Bj0DohUzHrfl iAtGwVMjydCdfVtnd7E55yFuQyjWyRTQvbs+Ej+4z8t8Y3pxipf5XP X-Google-Smtp-Source: AGHT+IEtVM7lrLxA2BQPvt9R5nz+4TxPuoPf0muPqE8Gc4OLySQB28IfuFlpBF7XjUUBcohtoZ0Sgg== X-Received: by 2002:a05:600c:3b19:b0:475:daba:d03c with SMTP id 5b1f17b1804b1-4778fe62088mr167939805e9.13.1763561582690; Wed, 19 Nov 2025 06:13:02 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e85cc0sm39416229f8f.17.2025.11.19.06.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 06:13:02 -0800 (PST) Date: Wed, 19 Nov 2025 14:13:00 +0000 From: David Laight To: Leon Romanovsky Cc: Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Chaitanya Kulkarni Subject: Re: [PATCH v2 1/2] nvme-pci: Use size_t for length fields to handle larger sizes Message-ID: <20251119141300.2209ea72@pumpkin> In-Reply-To: <20251119135821.GH18335@unreal> References: <20251117-nvme-phys-types-v2-0-c75a60a2c468@nvidia.com> <20251117-nvme-phys-types-v2-1-c75a60a2c468@nvidia.com> <20251118050311.GA21569@lst.de> <20251119095516.GA13783@unreal> <20251119133615.2eefb7db@pumpkin> <20251119135821.GH18335@unreal> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: 7bit On Wed, 19 Nov 2025 15:58:21 +0200 Leon Romanovsky wrote: > On Wed, Nov 19, 2025 at 01:36:15PM +0000, David Laight wrote: > > On Wed, 19 Nov 2025 11:55:16 +0200 > > Leon Romanovsky wrote: > > > > > On Tue, Nov 18, 2025 at 06:03:11AM +0100, Christoph Hellwig wrote: > > > > On Mon, Nov 17, 2025 at 09:22:43PM +0200, Leon Romanovsky wrote: > > > > > From: Leon Romanovsky > > > > > > > > > > This patch changes the length variables from unsigned int to size_t. > > > > > Using size_t ensures that we can handle larger sizes, as size_t is > > > > > always equal to or larger than the previously used u32 type. > > > > > > > > > > Originally, u32 was used because blk-mq-dma code evolved from > > > > > scatter-gather implementation, which uses unsigned int to describe length. > > > > > This change will also allow us to reuse the existing struct phys_vec in places > > > > > that don't need scatter-gather. > > > > > > > > > > Signed-off-by: Leon Romanovsky > > > > > Reviewed-by: Chaitanya Kulkarni > > > > > --- > > > > > block/blk-mq-dma.c | 8 ++++++-- > > > > > drivers/nvme/host/pci.c | 4 ++-- > > > > > 2 files changed, 8 insertions(+), 4 deletions(-) > > > > > > > > > > diff --git a/block/blk-mq-dma.c b/block/blk-mq-dma.c > > > > > index e9108ccaf4b0..e7d9b54c3eed 100644 > > > > > --- a/block/blk-mq-dma.c > > > > > +++ b/block/blk-mq-dma.c > > > > > @@ -8,7 +8,7 @@ > > > > > > > > > > struct phys_vec { > > > > > phys_addr_t paddr; > > > > > - u32 len; > > > > > + size_t len; > > > > > }; > > > > > > > > So we're now going to increase memory usage by 50% again after just > > > > reducing it by removing the scatterlist? > > > > > > It is slightly less. > > > > > > Before this change: 96 bits > > > > Did you actually look? > > No, I simply performed sizeof(phys_addr_t) + sizeof(size_t). > > > There will normally be 4 bytes of padding at the end of the structure. > > > > About the only place where it will be 12 bytes is a 32bit system with > > 64bit phyaddr that aligns 64bit items on 32bit boundaries - so x86. > > So does it mean that Christoph's comment about size increase is not correct? Correct - ie there is no size increase. > > Thanks > > > > > David > > > > > After this change (on 64bits system): 128 bits. > > > > > > It is 33% increase per-structure. > > > > > > So what is the resolution? Should I drop this patch or not? > > > > > > Thanks > > > > >