From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D5152DE6F9 for ; Fri, 2 Jan 2026 13:02:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767358968; cv=none; b=ri+qxJfnCMk1oyAEARbNM6QXCwgRzcgwlr4RtS57w8AD0AntJSAKT4N3Mg52DI9EtU9dqc0I17Hzw0TWdR12ZRXwU2VyVfxqybyZaEdjzVdnNbqP/4IQdAlxVxVcPNlXKwnxaDC3/P1SnITIVijHApoHZcONER2+PMleor4zrmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767358968; c=relaxed/simple; bh=MzslOykd8x14UYRASjqMHG8WwlyrJUbVhQ0wOUaMEeA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GJLJP0PCgJCeY7PWlejVbBNj9u4utGHWaj1Nt4QSK2ss9zmEQNnMN4L1NwY2/CEbiAZFRsAOW8kDhwmfe06zZuT/UshRwW9ZQjB/0cdjeQE6nXcnkfF9hicVSQjXCTxnPrCUoYJamDuuWK8JCcws7OBomZHfhN+h572EIc2juTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=g9S+/CyK; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ruf3khPa; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="g9S+/CyK"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ruf3khPa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767358965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WmDmlKfsEAT3FFZsP/TiPm94jNR+IqB/SohCa4X10es=; b=g9S+/CyK1C6JJBWcQlwwzsZIwfK62SPGUZh7f5sbj77vHDL5uN8LOA36f43ptn1rw4ex14 APaY+8v7XatQxmHpqtwe2Xz3CaZ2QPcjwItZ8DHf0xmW96SeB5iIZjtpiPn0WblNPiNOcS EFVvXgjHs5oR1+jFRo5nrAWeWBw8Nfk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-9jhKsxzlMZyCykiglWlXfA-1; Fri, 02 Jan 2026 08:02:44 -0500 X-MC-Unique: 9jhKsxzlMZyCykiglWlXfA-1 X-Mimecast-MFC-AGG-ID: 9jhKsxzlMZyCykiglWlXfA_1767358963 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-47a97b719ccso71928515e9.2 for ; Fri, 02 Jan 2026 05:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1767358962; x=1767963762; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=WmDmlKfsEAT3FFZsP/TiPm94jNR+IqB/SohCa4X10es=; b=Ruf3khPaNH8M9NxijcWmnqF1uGroWh2HoBxkyeczM+hJb4+uD/NOyRdvR+09ZwKHGJ burTy8fRY0gU/FLGFYWteU53mqULab/AUNyMBvoFqWMBrfCjdzymDZqlVLYp1lHifqfb HIcacXAF2RW6LIv9nwPSChhLRmIrO/gWssbsZlfD33VuDHNaZqwEq6i6fFRR0K9mej/b OFXwWJq/Hbo10sp18oOp2rvNyt2Dnqzk6jO7c6vjCRCIM5StfFKx3BecQIvBSjVY85eV IzC3xUDPskmvLiYurzGloEs4xsX8mInpc3Sdx8e52cskh8+aFahgk2EDs5E7Kibg354S Zfug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767358962; x=1767963762; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WmDmlKfsEAT3FFZsP/TiPm94jNR+IqB/SohCa4X10es=; b=LVsqJdMW8AbB7PtL2wTPaJrTjqyl+Q90DkszSs4Gcs0jmymugpgge+m77hfsi5KSDm 4IU3Tg3dcuanN4s80Te7L2tdicWgFTV1auRfdquESv0KjmGMM2SA91QT0aySOeSosUzS BCcaYJn0Pkvu9zHlVl94WJEtDDBo9rEFOqu9UszORra06kYcRugM7KzxkCMLB7cuJ1a3 oUdXjOoQTThsLYAK5NlYcEBcAaUwITpY3Tglg55H4pfv6wSTGmWFCpnvoxn8UVlR5J1K HsHts6x2QbRkX390eXl53v5Ok3Zpxv/IhnS2rVcnGruOb8PIeM2n7QHeP+8eeyMEZyk8 vADQ== X-Gm-Message-State: AOJu0YyPkpysAUWknHKl7rKxjERRrL0ekqiC29kxdECBjFBXWBGsfaQy Naw0R7Vpe+dR9agiMnq2J5l6tMkDU3u/Malu3SZwE5pxyA5ftfMqSWZuAbmeOiD1dMvJ/2mI9V9 nEIqn64WSrhYNCOQf/WD40SkP+Y4rYkiOsaCQuJ/KaDEtXiaxiUaS/+rFdvStWpidHrifxyrysy Zx X-Gm-Gg: AY/fxX5dn9yTi6Ti8zMPmWUd8M3LyFaHunUep9mwMl9EiIOaRdShwQhQfZJkoQULp6x hWcRIf1tkaIMo0n4t1b+/qctWHFXLHLbKUkIkDAM8rHs+318vCzyhJqp0r59WEgk2ebP8P5ZG2W W5R7hzvOUVxBXLznqVqDYxv+DBx8jJph9ofl7mLmAvnF6y5UjQlxYQIfP29C6kgKys2D4RdNh2t f1v6c62hYskn8BDt5sbv6s9vBlmQhHADuL+CVqGAuITWig71MqroFBgAc8xnIwcSS3a/X5uddG+ 1ZMdP0iPtfjB5ohOvacfTikFuEdHi/6Vtt9dU7+3RcgovrxHb/T+SNJ2F5x9h39yzl8LJaH2qLV cuQ6p6QrIWb1Jcek6/ddKw4LuHTB5Uct4HA== X-Received: by 2002:a05:600c:3508:b0:477:1bb6:17de with SMTP id 5b1f17b1804b1-47d19590bbemr512374985e9.30.1767358962156; Fri, 02 Jan 2026 05:02:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBPpH0ihQmD8Y4wAGqUXdjbUDmUwQhrGC4bvR7Khhg9b0D8Nv1fILL/X18iGX7aRdaW+Lc0w== X-Received: by 2002:a05:600c:3508:b0:477:1bb6:17de with SMTP id 5b1f17b1804b1-47d19590bbemr512374585e9.30.1767358961687; Fri, 02 Jan 2026 05:02:41 -0800 (PST) Received: from redhat.com (IGLD-80-230-31-118.inter.net.il. [80.230.31.118]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d193d4e91sm720685835e9.13.2026.01.02.05.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 05:02:40 -0800 (PST) Date: Fri, 2 Jan 2026 08:02:36 -0500 From: "Michael S. Tsirkin" To: Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, Cong Wang , Jonathan Corbet , Olivia Mackall , Herbert Xu , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Eugenio =?iso-8859-1?Q?P=E9rez?= , "James E.J. Bottomley" , "Martin K. Petersen" , Gerd Hoffmann , Xuan Zhuo , Marek Szyprowski , Robin Murphy , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Petr Tesarik , Leon Romanovsky , Jason Gunthorpe , linux-doc@vger.kernel.org, linux-crypto@vger.kernel.org, virtualization@lists.linux.dev, linux-scsi@vger.kernel.org, iommu@lists.linux.dev, kvm@vger.kernel.org, netdev@vger.kernel.org, "Enrico Weigelt, metux IT consult" , Viresh Kumar , Linus Walleij , linux-gpio@vger.kernel.org Subject: Re: [PATCH RFC 15/13] gpio: virtio: reorder fields to reduce struct padding Message-ID: <20260102080135-mutt-send-email-mst@kernel.org> References: <55e9351282f530e2302e11497c6339c4a2e74471.1767112757.git.mst@redhat.com> 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: On Fri, Jan 02, 2026 at 12:47:04PM +0000, Bartosz Golaszewski wrote: > On Tue, 30 Dec 2025 17:40:33 +0100, "Michael S. Tsirkin" said: > > Reorder struct virtio_gpio_line fields to place the DMA buffers (req/res) > > last. This eliminates the need for __dma_from_device_aligned_end padding > > after the DMA buffer, since struct tail padding naturally protects it, > > making the struct a bit smaller. > > > > Size reduction estimation when ARCH_DMA_MINALIGN=128: > > - request is 8 bytes > > - response is 2 bytes > > - removing _end saves up to 128-6=122 bytes padding to align rxlen field > > > > Signed-off-by: Michael S. Tsirkin > > --- > > drivers/gpio/gpio-virtio.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpio/gpio-virtio.c b/drivers/gpio/gpio-virtio.c > > index 32b578b46df8..8b30a94e4625 100644 > > --- a/drivers/gpio/gpio-virtio.c > > +++ b/drivers/gpio/gpio-virtio.c > > @@ -26,12 +26,11 @@ struct virtio_gpio_line { > > struct mutex lock; /* Protects line operation */ > > struct completion completion; > > > > + unsigned int rxlen; > > + > > __dma_from_device_aligned_begin > > struct virtio_gpio_request req; > > struct virtio_gpio_response res; > > - > > - __dma_from_device_aligned_end > > - unsigned int rxlen; > > }; > > > > struct vgpio_irq_line { > > -- > > MST > > > > > > Acked-by: Bartosz Golaszewski Thanks! There's a new API as suggested by Petr so these patches got changed, but the same idea. Do you want me to carry your ack or you prefer to re-review? -- MST