From patchwork Fri Mar 1 17:22:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10835763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49EB81575 for ; Fri, 1 Mar 2019 17:22:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AAC530045 for ; Fri, 1 Mar 2019 17:22:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E5F530055; Fri, 1 Mar 2019 17:22:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6A0C30045 for ; Fri, 1 Mar 2019 17:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387795AbfCARWl (ORCPT ); Fri, 1 Mar 2019 12:22:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:43306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728290AbfCARWl (ORCPT ); Fri, 1 Mar 2019 12:22:41 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BDB1720850; Fri, 1 Mar 2019 17:22:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551460961; bh=H5f/lf+oxIPE58nmYwdbjX+9OAfW0YHT1bg/n2dtB9A=; h=Date:From:To:Subject:From; b=unc05N2KxQmX90x1OC4rNyERr77b07yzNF26c/6aOVYpCkQGAPpm+R6r/jYo4E1QV Z3RCwDFSoBpin9FIAPQhCc6Naw/ixvw7iU23VIJxQL+K1j7N8qm0NQ+7qbw7Qj1zVg S2vYB1bDzh6Wc+dEEnKCyrdL8sPStV5T2ZmcoEZI= Date: Fri, 1 Mar 2019 18:22:38 +0100 From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Subject: [PATCH] USB: usb.h: tweak struct urb to remove wasted space Message-ID: <20190301172238.GA23800@kroah.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP By moving one field around in 'struct urb' we reduce the size of the structure by 8 bytes. Before the patch on x86_64 the overall size of the structure as reported by pahole was: /* size: 192, cachelines: 3, members: 30 */ /* sum members: 184, holes: 2, sum holes: 8 */ After the patch we now have: /* size: 184, cachelines: 3, members: 30 */ /* last cacheline: 56 bytes */ Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/usb.h b/include/linux/usb.h index 5e49e82c4368..4229eb74bd2c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -1545,10 +1545,10 @@ typedef void (*usb_complete_t)(struct urb *); struct urb { /* private: usb core and host controller only fields in the urb */ struct kref kref; /* reference count of the URB */ + int unlinked; /* unlink error code */ void *hcpriv; /* private data for host controller */ atomic_t use_count; /* concurrent submissions counter */ atomic_t reject; /* submissions will fail */ - int unlinked; /* unlink error code */ /* public: documented fields in the urb that can be used by drivers */ struct list_head urb_list; /* list head for use by the urb's