Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp30987pxf; Wed, 24 Mar 2021 19:58:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrfDuF5Bjnu4W2biXhywgYssm0kIYqk2R3P0i/Lr0Iqt2S3c9YDB1XrwSOaAk5TQD2KkMr X-Received: by 2002:a17:906:3295:: with SMTP id 21mr6939103ejw.88.1616641112158; Wed, 24 Mar 2021 19:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616641112; cv=none; d=google.com; s=arc-20160816; b=kcv/hhVZiaEx6b0mkqMSHUMfAltcr/SHxA7miXK4oLtI6DDPrLstHQwuGBEDR6hbZr 3had3LRnEF5kxHGsUIO2D7XVACJ/CP2K+V7E+3njLKZ1rbtSMtZnnXMRpdFNL3wPt0JH ukg6f4x1SAQ610By6fTFtwA/xv6weTb6+y9t0A5rkyeqV9aVKrVIyGaLMzCv8Db6UBAA 9XT76txKY1MEGM5xL3Zs69DccmB9bjvkCqz0Ajlk9BE2+JO7YOOTYEFj/kcORpY24Jln PRvD+WTKeoKLzevmsg4C1MpvcX1ESWDVfAdak24IPu55Ko+0GBAOtDmTXy1jJXJqCcKl 4SuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=KEThvGs8mhCJUE7NWLOhItOB7I4hTptrR+HW935IQCk=; b=GwUkAKIcqMo1ZtMJbbj9Ktoha2Rfm4ff4d9bYEJkwumDtHNDwHbw8302VbJemaM4iX 7mbp5R5qEP6dbV8rZozZEC5/tCiiveA3O91lNhpFdbYBIeYH+vjV8OAfOiN7+x3xNpwY 2U0MX/S36mMkZ7jTnS9MGACxl5FhlLXgplVxZOg0NPhhGkv2mGMdxQikIoykAfdCNmhT NUqligJ9VABLiKvp4tJxYaB/t6zrccxaaY8hIFpmvnJf/z1oyUSSnnT2D0HaMTGs96mb XzmM9rpAWH78sBk8lcsmorN9JS1e32i4gFXHn/wFbVe1i836+4l/O4dAXqkkCxwBqzK9 DbYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=L9mnu1wu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si3122077eje.367.2021.03.24.19.58.01; Wed, 24 Mar 2021 19:58:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=L9mnu1wu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231833AbhCXLfm (ORCPT + 99 others); Wed, 24 Mar 2021 07:35:42 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:53626 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbhCXLe0 (ORCPT ); Wed, 24 Mar 2021 07:34:26 -0400 Date: Wed, 24 Mar 2021 11:33:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1616585642; bh=KEThvGs8mhCJUE7NWLOhItOB7I4hTptrR+HW935IQCk=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=L9mnu1wusvlo5z/k8/W0m0vwLz+p+blybKZ5aTd459zOPr+cU5ol0BWJ86Fb5vceH jQ+uOkJgO10PoK82Yql8YQFGFHYIWAi6FqbuavWlRjtg/dTKdClXvX9kO8JZ9uMv/w I2jmLOer8UwjQdjZ47KXlh9lCzLg+4FLYHvVsT61fIacfY9GHkcNHP2rM+IP5BMMID 029uIUgE13CqYFGiJSrOjzm73NG57pEW6agvHoA/xs99stxLEgiwAb2Z4tr0iSWDLV SVevpCXD06gWTBJmhnMBvQE2OcWT5cRFgvQAjB1vHq4dzJjpvaPHBmONdNzK6a3qQv Hrnr0I5Wr8JjQ== To: =?utf-8?Q?Krzysztof_Wilczy=C5=84ski?= From: Alexander Lobakin Cc: Alexander Lobakin , Lorenzo Pieralisi , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Rob Herring , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: Re: [PATCH RESEND] PCI: dwc: put struct dw_pcie::{ep,pp} into a union to reduce its size Message-ID: <20210324113259.2809-1-alobakin@pm.me> In-Reply-To: References: <20210312140116.9453-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Wilczy=C5=84ski Date: Wed, 24 Mar 2021 02:31:42 +0100 > Hi Alexander, Hi! > Thank you for sending the patch over! > > > A single dw_pcie entity can't be a root complex and an endpoint at > > the same time. > > Nice catch! > > A small nitpick: this would be Root Complex and Endpoint, as it's > customary to capitalise these. > > Also, if you could capitalise the subject line - it could also perhaps > be simplified to something like, for example: > > Optimize struct dw_pcie to reduce its size > > Feel free to ignore both suggestions, as these are just nitpicks. They are both correct, so I can send a v2 if this one wont't be picked to the tree, let's say, this week. > > We can use this to reduce the size of dw_pcie by 80, from 280 to 200 > > bytes (on x32, guess more on x64), by putting the related embedded > > structures (struct pcie_port and struct dw_pcie_ep) into a union. > > [...] > > -=09struct pcie_port=09pp; > > -=09struct dw_pcie_ep=09ep; > > +=09union { > > +=09=09struct pcie_port=09pp; > > +=09=09struct dw_pcie_ep=09ep; > > +=09}; > [...] > > How did you measure the difference? Often, people include pahole output > for the "before" and "after", so to speak, to showcase the difference > and/or improvement. Do you have something like that handy? I didn't use pahole to measure the difference, just printed sizeofs for the structures "before" and "after". But I can get pahole's output and include it in v2 to make commit message more useful. > Krzysztof Thanks! Al