Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp174116pxf; Wed, 24 Mar 2021 02:12:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1Bbso5Wm8WAC0NOrAzqVO10R9VQtuTMOTJ7pwqSuxqUuQo+h+AL3N0W/gIwAw2hOk9J6A X-Received: by 2002:a17:907:7014:: with SMTP id wr20mr2602197ejb.179.1616577141852; Wed, 24 Mar 2021 02:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616577141; cv=none; d=google.com; s=arc-20160816; b=ZfnHFlW2KsMvU6q0mrH0GO8FLuBkS76ozSiDo3Xg0m3fkKpWW30jhfebdnfO4e40pH VGOayt9D1vzyb7SjSxvhjmN5rhHsjCNoNSyCtxpNWiXQCLagnhr0MW4S+4Cm61AKL+Qg UzVWzoLZ/W4FRzIDZHIBif+4dPqg5D6gfBgkXkBN5dXCXeAao0dcfgdglGSOoIvmU+Xw lyIpn2X/WS8KchHSjm3zo+xmG6VediDJyunc6m0Uy8f2lVCtXyv7fJLVeT+46wdgAZLd zov7wQS3luJNLzdAZW6Vtby5s8g24D/1p3GD0zOGxn333gcdvSrz/jTw2wo9HX6xC4gF MACg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=VxiNq12BBkrbM53aTNkI6bHyLip/3/EfWfu40n01gwI=; b=rIgAS8Aonx+ZSySON9HEe4ZlLYa3ChHLYSAERMK2Qs1Ljhc/XUmc8JLujcp4L6+Fk3 EM5oZOOnGps1n/rH2EDNrBWkPmjPMOxPFvgl1L8o1o9Ii5MoxwX+dCCj4roXp9uY36DW gRzIdPEIeFXyGks9s2QcQGshLIUiIQNpFrmKPa96owdFK8PJUNf+T3JCx5cPvjF7OMup c8VlHtGiudr4Deu7e5TuwempBEMdLS2TQgwUK5c+656DnDMUN6Wb3oIa6i7dM6WDBbRL 1iIlVNZRyFOc/VfXwgWdGZyIABzt/kt8ypn1NyCa/ZcN9f2R/xZ7DoAiolLgW5tjE/J6 LUyQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx8si1331911edb.517.2021.03.24.02.11.59; Wed, 24 Mar 2021 02:12:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234708AbhCXBcS (ORCPT + 99 others); Tue, 23 Mar 2021 21:32:18 -0400 Received: from mail-lf1-f42.google.com ([209.85.167.42]:39772 "EHLO mail-lf1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234543AbhCXBbp (ORCPT ); Tue, 23 Mar 2021 21:31:45 -0400 Received: by mail-lf1-f42.google.com with SMTP id b4so5585588lfi.6; Tue, 23 Mar 2021 18:31:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VxiNq12BBkrbM53aTNkI6bHyLip/3/EfWfu40n01gwI=; b=I5ofrO43zpTmAPNMOWxXiQ/rryE4psbG+w/gCtwsoJCIy1RHEDtZ3kHf2FnKweoHEn MJPliRAcaIn1ozvpWSpqtaKfvz18pIflWp15F6zEbR9g6o16W6Gnm8i/0ZY1zzVLRfrM e2KkVC/ptpFU0OCDVn7LqFrbQsGG1MyYgpaLlmdzlgtDdHd9Px8QOi/aaoX3wpT8Bdfy 08ZmfAXX3zhYwBzBN7bolbahTtrAYNdVU8uNZxuw96jCqp+/2f9NzNTqpi3O9iClkkFt drbIhTwlOVrLuUTSvJYrVr1/CJ484bdyOQZ6pqKd4l1aRNTqMlfw8lZ5bHphfO11j1rq DiQA== X-Gm-Message-State: AOAM530l+lEhv2r1RgGrXc+x5kmP2s9v8VU0/lJgWWhoaZcVOQxoNJCM e7DDG/O21U5gKA6F6Tm8OsI= X-Received: by 2002:a19:98a:: with SMTP id 132mr479464lfj.139.1616549504215; Tue, 23 Mar 2021 18:31:44 -0700 (PDT) Received: from rocinante ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id f9sm95975ljg.115.2021.03.23.18.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 18:31:43 -0700 (PDT) Date: Wed, 24 Mar 2021 02:31:42 +0100 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Alexander Lobakin Cc: Lorenzo Pieralisi , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Rob Herring , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND] PCI: dwc: put struct dw_pcie::{ep,pp} into a union to reduce its size Message-ID: References: <20210312140116.9453-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210312140116.9453-1-alobakin@pm.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexander, 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. > 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. [...] > - struct pcie_port pp; > - struct dw_pcie_ep ep; > + union { > + struct pcie_port pp; > + struct dw_pcie_ep ep; > + }; [...] 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? Krzysztof