From patchwork Sun Jun 18 16:24:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 109636 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2555710vqr; Sun, 18 Jun 2023 09:55:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fUlDxMmkDR4/hBml8O3AcRWvFRwlpooCVOpHWgHmHaIUN7p7qkfyi7oBXpGy5LNofEyYm X-Received: by 2002:a17:902:e807:b0:1b3:d33f:917 with SMTP id u7-20020a170902e80700b001b3d33f0917mr6334142plg.49.1687107319192; Sun, 18 Jun 2023 09:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687107319; cv=none; d=google.com; s=arc-20160816; b=S0tmb6ItoJ7+L91v0QiU6nPrhBc++SlAAn1PtHCXuG5p1+WPic1uOrGUk9YqcvOpDY IF95FFE/gS3qhe/1yOVv3/oC0rBnkYlmMkxqmyRNGg/2Ewkf+c7ubuKBUrfKD5YQXOoX wmt3prq1Mt/4i3R+yqMoIeAU/laf3N+3qjmBKO/QcHMXN3kLQ4zJOPiZyef4U9vNw5v7 OuaHXmqB1ma+QsD2S3lj3Phd1wY8JYCkXHMt1uW5ry24vsrEn70F0M+Q66oNuA0ABHm0 bGbsouoPFCrZsfz5J3wZNDaOWU+15lAY1Qw5xexuZQPtH7dVOHICLB56cTXDsmZjnZnp JYAQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=vduJtJTiTmHUwJwzG9QCoqetEOnDC2NYSydhpCqW9gc=; b=rNDjY6g8GcJ4VGtxS/FseJXGDNI5BJ2giOS9j9gJmYBJb7f+lWbpyQ9N1XtNqymW84 zuD0N8liF1kE7aroVYrrxE/LrKsJgV4J7LOHuy9pyzEqA49yaTkkSQd/Q9v7qMUSuG03 NCm2s+F8RR5cUeAzHYpBx2qTRN6jTAWPnQxX3bGMwCTsgmaD32fDVtPGo3FPLoYsJd+/ 2hDWW2BiBPWh2Pc6XW+2YGx2NQteWeKMBVjRNO+WteiqHqYvh2riu1FI33GTLM8rg3MM IyPMk3CdIV9vnKKL4bGV0GEsfYG3nP5fXZm9oK+nlmJU8u2d/jEJXPCGqj+4J2pEL4NH 91yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=NPPoVt20; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a170902cec300b001b25e9a76d7si18140231plg.316.2023.06.18.09.55.06; Sun, 18 Jun 2023 09:55:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=NPPoVt20; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229481AbjFRQZU (ORCPT + 99 others); Sun, 18 Jun 2023 12:25:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjFRQZS (ORCPT ); Sun, 18 Jun 2023 12:25:18 -0400 Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CCED1B4 for ; Sun, 18 Jun 2023 09:25:14 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id AvD8qePgkuHEfAvD8qbYZF; Sun, 18 Jun 2023 18:25:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1687105506; bh=vduJtJTiTmHUwJwzG9QCoqetEOnDC2NYSydhpCqW9gc=; h=From:To:Cc:Subject:Date; b=NPPoVt207fx+2FC33z2MVoeTxXkm9k09DcOPbGD0D3RkNi0f+UxKLDl6X3pYb3hDW SZxE7eyw7r2GUPDUo+9AoERBYNQ7WuMoFJ0jCx9mDdhZmdT3N/GNIkfSZwstPePhoz g8m3bN07KQGcQlye+6qAHKAUFVd7ako43Ic98m3GPo+vDi/O0YdsmzrYSFU2+Uhxpk NECioTiGEm9WvXLNxdKE65oNpUSXJ4osn0O6kLxcrSdhE6xT3gQGUFytANaQQLVaM8 lbzN0hy//t4GqnI54KtGjhHld/wBy21owR9yEMv8FY4DLlQyMnOKye61FwsMz2A+l0 dV4rj+Gf0qUpg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 18 Jun 2023 18:25:06 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pci@vger.kernel.org Subject: [PATCH 1/2] PCI: Reorder some fields in 'struct pci_dev' Date: Sun, 18 Jun 2023 18:24:54 +0200 Message-Id: <407b17c3e56764ef2c558898d4ff4c6c04b2d757.1687105455.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769060244066131990?= X-GMAIL-MSGID: =?utf-8?q?1769060244066131990?= Group some bitfield variables to reduce hole. On x86_64, this shrinks the size of 'struct pci_dev' by 16 bytes when compiled with 'allmodconfig'. This goes from 3576 to 3560. The move related to CONFIG_PCIEASPM depends on the config. But it gives the opportunity to merge to bitfields. Signed-off-by: Christophe JAILLET --- include/linux/pci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/pci.h b/include/linux/pci.h index c69a2cc1f412..106754757279 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -366,8 +366,8 @@ struct pci_dev { pci_power_t current_state; /* Current operating state. In ACPI, this is D0-D3, D0 being fully functional, and D3 being off. */ - unsigned int imm_ready:1; /* Supports Immediate Readiness */ u8 pm_cap; /* PM capability offset */ + unsigned int imm_ready:1; /* Supports Immediate Readiness */ unsigned int pme_support:5; /* Bitmask of states from which PME# can be generated */ unsigned int pme_poll:1; /* Poll device's PME status bit */ @@ -392,9 +392,9 @@ struct pci_dev { #ifdef CONFIG_PCIEASPM struct pcie_link_state *link_state; /* ASPM link state */ + u16 l1ss; /* L1SS Capability pointer */ unsigned int ltr_path:1; /* Latency Tolerance Reporting supported from root to here */ - u16 l1ss; /* L1SS Capability pointer */ #endif unsigned int pasid_no_tlp:1; /* PASID works without TLP Prefix */ unsigned int eetlp_prefix_path:1; /* End-to-End TLP Prefix */ From patchwork Sun Jun 18 16:24:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 109635 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2555600vqr; Sun, 18 Jun 2023 09:55:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hLgtXt4zuvspDa3fQ4/jvdDhi9vG5AYBj9ywtVwDNJYJ9PgeExQwdR2145MFs2IeoB8Hk X-Received: by 2002:a05:6a20:43a4:b0:10e:ff8f:8edc with SMTP id i36-20020a056a2043a400b0010eff8f8edcmr6444772pzl.55.1687107299930; Sun, 18 Jun 2023 09:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687107299; cv=none; d=google.com; s=arc-20160816; b=0Q/UKzrlKgUwd5oaDdCYix+A/wL1R8W9k6vZo8KoJqzqN0AmlXBYWJJi3j0/zIDxIo otTb+vsJ8eVCW5zp/RulLGOmUyyEoPjOxUlHnMl3DxaKTlZ9dGtjk3M1TcZbyJWH5YvM SuGING0BRiAz/aEa7BnzRg++/IC/Dshz8mHov5Hv7pSktLmQOWvpYCbxDLlOrXFVazlD c39mBTF5T6bpW83SjeBfErVu+WDkZVZ46Vv3vSgFY2mjJbuGAUeLEP+tNYYEwxh6agqJ PWU0VdZPYKFuOUdK0KVYPJe6n2WbgoNAje0dtbsPZA1tLb2KChSCo1gnZX22iPWdvRup zVIg== 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:date:subject:cc:to:from :dkim-signature; bh=7JePpIbtyIw6zKN1IPxyCEDxfHQDsi/Aj9GfQW/K8Hs=; b=od6ND4tAA06CXHx/tp6/uUiitH+78JMxRwYVCDN/3z6Sjk32KbXu9uH+dgLQtiV7Ye adGoVd5+7DF79AEHbuAk+s588qdLC/v6ULfhUGDTQuJ2LX+iCFYQJ8+pJBPQNkczMA8X c81PhGQWIQLt42GlobyubpN4OJwe5G/kn52ub0/VXAgOnLPs3AuV69cuLdjal7E3wR3C NUSMYWW6G3hXd9YQWYIngBEi5YuE7bg/nkfkkAN3/Ay34RCNcEOqHdo5tJDzCAidrOAW FLo5E5W0YE4Cd8Q5uBcqa8hDMMtbCW10glRhbg3LP+KoLM3zCW+MoLCVMlrEAqGMu6RP TEZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=rqOcEbLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020a632b0c000000b0054fe20c31e6si8838218pgr.649.2023.06.18.09.54.45; Sun, 18 Jun 2023 09:54:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=rqOcEbLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbjFRQZZ (ORCPT + 99 others); Sun, 18 Jun 2023 12:25:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjFRQZT (ORCPT ); Sun, 18 Jun 2023 12:25:19 -0400 Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D3C3E5F for ; Sun, 18 Jun 2023 09:25:18 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id AvD8qePgkuHEfAvDDqbYZc; Sun, 18 Jun 2023 18:25:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1687105511; bh=7JePpIbtyIw6zKN1IPxyCEDxfHQDsi/Aj9GfQW/K8Hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rqOcEbLeGaNm5DlAC1yLgV2X2Zkc6lGAsqydI1b2ap8LJYmxiW2kVWhBsx+8u5aIp CPikmmCcAmjwA3zNxfMGbmor4ZYzux0QI8truRwPu9S/tioU59HzNq9Fm2IOReYE2n gdaQESUSYTrgpx+jwCBreZbE+E6IiUa/QyWMsNBbAKgrczbHV7y/518k0A9PL4Pbpz jmZ2+iRp705D3hlP2hxY1nl5JyWcIDMy9q7o48kEGI9mlhYkA9uaTpiYczdmC/cZNs SypS8oOGEjk/q5J+xbI3yeSst6nyjDcYszpbw05CzkSAomqLZOeE8Gpu4HcoHW+NT8 9jw5tM5qR73Uw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 18 Jun 2023 18:25:11 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pci@vger.kernel.org Subject: [PATCH 2/2] PCI: Change the type of 'rom_attr_enabled' in 'struct pci_dev' Date: Sun, 18 Jun 2023 18:24:55 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <407b17c3e56764ef2c558898d4ff4c6c04b2d757.1687105455.git.christophe.jaillet@wanadoo.fr> References: <407b17c3e56764ef2c558898d4ff4c6c04b2d757.1687105455.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769060224353459777?= X-GMAIL-MSGID: =?utf-8?q?1769060224353459777?= Make 'rom_attr_enabled' a single bit in a bitfield and move it close to an existing bitfield so that they can be merged. This field is only used in 'drivers/pci/pci-sysfs.c' to store 0 or 1. On x86_64, this shrinks the size of 'struct pci_dev' by 8 bytes. This goes from 3560 to 3552. Signed-off-by: Christophe JAILLET --- include/linux/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/pci.h b/include/linux/pci.h index 106754757279..0ff7500772e6 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -464,12 +464,12 @@ struct pci_dev { unsigned int no_vf_scan:1; /* Don't scan for VFs after IOV enablement */ unsigned int no_command_memory:1; /* No PCI_COMMAND_MEMORY */ unsigned int rom_bar_overlap:1; /* ROM BAR disable broken */ + unsigned int rom_attr_enabled:1; /* Display of ROM attribute enabled? */ pci_dev_flags_t dev_flags; atomic_t enable_cnt; /* pci_enable_device has been called */ u32 saved_config_space[16]; /* Config space saved at suspend time */ struct hlist_head saved_cap_space; - int rom_attr_enabled; /* Display of ROM attribute enabled? */ struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */