From patchwork Fri Nov 3 06:51:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 161174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp842262vqu; Thu, 2 Nov 2023 23:52:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVuKIyWLjgAywebOar2fEDpQY/66NcXJbL6fe+V2XFv0d+kKJbzrGd9MBYbiDVdwq15Atz X-Received: by 2002:a05:6a00:2191:b0:6c3:625e:6950 with SMTP id h17-20020a056a00219100b006c3625e6950mr1934609pfi.21.1698994362371; Thu, 02 Nov 2023 23:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698994362; cv=none; d=google.com; s=arc-20160816; b=XLXn9Pl2QEedwyYrVDWBHn26TGUi7b1KEY4/8S0uNgcAEyDxY90eZ3TnvbEC0IZa3z PhNXVpCVSETGQ3PPM8x+hv6r8wKLbaJ6jc3uFIHJYw1mhD1m0dj2yklLq+XdTKDebN9g 9DNvmIeysnip5utVFSJgbTX2efhcEGFGUVc7hv7eXyVdSCaTGcmN+9SXpKqfQs2iZFYy 9q3Amt7DcWHGunI08OMQkIHXlmk0vM8UUHNVLWRgpUAcUTGUrdFsTTSRtx4S9urcK0xr KqJksdVCTe4idcuJI0TFWpwS4zLgjjZRDoPfeDQVv3AdpUhPnTCck1ZzjO0BwvbQiWgx syfQ== 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=n3o0U+wAFJJNSDWSL3836YjnJRjiy8QhH+Wkq/Yn51o=; fh=VaqYdMPeQsLQkgq8I8p7QT+GcDn1BNiibNHp218zxsY=; b=X6iBy3xbBtEOG7/iv2GBgB1gC78khRwdyQ4V8lv+A24FsZEI181y/y443Ieb7bVPPJ xK3EumdTMgpTwus+vdYS461vjgfwMDind4E/HDK5TnjEEkvHJ3ERKoY3p/AFBkzrGbeg dMcrB6V4hTHZw69VYnv33djqDorRmLcErMVrZNvHAYd26BOdtN+itsAGiYQuxNG7QAvF 1kvq/u17iTfIDaVninq02ssP+LvyPTD9h+CLT7TmeyDwSFQ4H7Xf6Jo00wPwMgnosmh8 e3X0EOBZjICCWxIQ/6uwxzsZodVe8hv6UilRPxiS1ZgSGfXEOxgquz0r32P0LuXjqF29 SI1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=diOpSTwX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id e7-20020a6558c7000000b005b96dd10899si957152pgu.852.2023.11.02.23.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 23:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=diOpSTwX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 019ED825EDA0; Thu, 2 Nov 2023 23:52:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232481AbjKCGwY (ORCPT + 36 others); Fri, 3 Nov 2023 02:52:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232674AbjKCGwS (ORCPT ); Fri, 3 Nov 2023 02:52:18 -0400 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC28D62 for ; Thu, 2 Nov 2023 23:52:01 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id yo22qYVa0AjXCyo23qif6F; Fri, 03 Nov 2023 07:51:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698994319; bh=n3o0U+wAFJJNSDWSL3836YjnJRjiy8QhH+Wkq/Yn51o=; h=From:To:Cc:Subject:Date; b=diOpSTwXP/J+BlqjMz2GK0G4WL37Q0A9k7gZjINd9ID5+BcMHrMnLHajr04Y/yaTi 24jR7sPTfQPOYIMXn0xrk4agCJg6SXzuIY2fsB11cMKYTCjB1Iw2R/BTErCj2XEXjJ BEJpvIqdUmL4yU3lD06geJdW86LJOMqflhEl8SUVNueC2ZfZ+UdX+uF5N0AuWavuB7 bOl62rmtodGA6ENCwnGN4w7y+4MYSU56+IRQxl41tcOvkZowuKGrTr5nkMpdUE/NjX jBJFnD597guFynfG3xd+i9CyOmI6u2611RQbGm1hKYDZ3Klq/i/jdCGRSxsiLwfo9+ 3+0SrekV5Q6Ww== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 03 Nov 2023 07:51:59 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: rostedt@goodmis.org, gregkh@linuxfoundation.org, keescook@chromium.org, willy@infradead.org, senozhatsky@chromium.org Cc: list@mail.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] xhci: Shrink struct xhci_interval_bw Date: Fri, 3 Nov 2023 07:51:46 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 02 Nov 2023 23:52:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781524712325495221 X-GMAIL-MSGID: 1781524712325495221 The struct xhci_interval_bw can be reordered to shrink it from 40 to 32 bytes. This makes sense because it is used in struct xhci_interval_bw_table in an array of XHCI_MAX_INTERVAL (i.e. 16) values. So this struct is shrunk by 128 bytes and is more cacheline friendly. On x86_64 we have: struct xhci_interval_bw { unsigned int num_packets; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ struct list_head endpoints; /* 8 16 */ unsigned int overhead[3]; /* 24 12 */ /* size: 40, cachelines: 1, members: 3 */ /* sum members: 32, holes: 1, sum holes: 4 */ /* padding: 4 */ /* last cacheline: 40 bytes */ }; After the change: struct xhci_interval_bw { struct list_head endpoints; /* 0 16 */ unsigned int num_packets; /* 16 4 */ unsigned int overhead[3]; /* 20 12 */ /* size: 32, cachelines: 1, members: 3 */ /* last cacheline: 32 bytes */ }; Signed-off-by: Christophe JAILLET --- drivers/usb/host/xhci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 3ea5c092bba7..0430646a3a05 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -956,13 +956,13 @@ enum xhci_overhead_type { }; struct xhci_interval_bw { - unsigned int num_packets; /* Sorted by max packet size. * Head of the list is the greatest max packet size. */ struct list_head endpoints; /* How many endpoints of each speed are present. */ unsigned int overhead[3]; + unsigned int num_packets; }; #define XHCI_MAX_INTERVAL 16