From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1998C4727C for ; Wed, 30 Sep 2020 05:17:44 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22D952072E for ; Wed, 30 Sep 2020 05:17:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KZ7v7KkO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22D952072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9D6818647A; Wed, 30 Sep 2020 05:17:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FsFfz7s3UCJQ; Wed, 30 Sep 2020 05:17:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 391038610B; Wed, 30 Sep 2020 05:17:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1D05AC0889; Wed, 30 Sep 2020 05:17:43 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4E776C0051 for ; Wed, 30 Sep 2020 05:17:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 342A48638F for ; Wed, 30 Sep 2020 05:17:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kDPwRywaeUxC for ; Wed, 30 Sep 2020 05:17:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id 924958610B for ; Wed, 30 Sep 2020 05:17:40 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id x16so370619pgj.3 for ; Tue, 29 Sep 2020 22:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZnhBSpvB3/nQLS/vGQDEpF/3T8Iv4KFvzWHc0eI0OQY=; b=KZ7v7KkOGfVhjPCvwHb67JzHK/6tszBCzc3LgQFBgi5TvGDv2y0j6xiHTGidravuJL KbtF1gnnV2JIVqyuBddkzsqpc95dlCN73klCiV2YvoEKUN3/Y92+PvgoZfwb45qsn8Wj UZAEfBGrGep+e0Cur9PE8kc0ju4mBryrB+gKKngJ5lxj5LbBhr5fyjmsHOW3nyuVOx7R XHJ7HYsS+fq/49FXh98g6qF89HKnISTh8DJrBuP7JgVNK3v243BNnlpJPL1akWvv2HCt mjhS9tjBal/Qtxx0dxNR6jvBEgqSmpO89hKzgINeCw1NT2EUQpCCKEy9Jkaxh6JCrhzv kqAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZnhBSpvB3/nQLS/vGQDEpF/3T8Iv4KFvzWHc0eI0OQY=; b=KQo98p2r0qwKu9tPG8TIYruFLt83WAK6K+s6KIkU99ev21WfrOyt2oamCVs1Vaed0W kR5RIolNdWYbvlNyLnLB6M102aQn5jGhfgzrVzFNDp8lHxKYNGmwW0DDMzEA7C+MGoDg zY5ub0F3MNzzS9gcdyxozuoPAHtSrcPsEcEW35p6co8PTuN+4DocFuhCzvzyZEctSTAS 2vwDXbRUC0gTmmZTleo8GJ4ZWgNVWMJhTOChzdAtbXAU1ZdZd/0RkyycWnlJU4iGNI1j pnkHy8fUdKved6RnoIeUc+JfY4pgbOJU0/j7OfFki9tihUOaa5dc/1NF9cH2GoaDm3a1 BXzw== X-Gm-Message-State: AOAM533Stbbhry3iRXjbjfcMjRiXY3QAWOF0N7QVvLQttMXhkOrpFP1M kYvbS4GlNWSGsUtHgKJ/KLM= X-Google-Smtp-Source: ABdhPJxO94xHOft5zzV+L+Cm/yDieJuAT8EYKrRQxwsGxbw45yVgWmc7FmEh/QrkzovQtjhpGTBkoQ== X-Received: by 2002:a65:46c6:: with SMTP id n6mr818457pgr.328.1601443060046; Tue, 29 Sep 2020 22:17:40 -0700 (PDT) Received: from localhost.localdomain ([49.207.218.220]) by smtp.gmail.com with ESMTPSA id gm17sm633432pjb.46.2020.09.29.22.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 22:17:38 -0700 (PDT) From: Anant Thazhemadam To: mst@redhat.com, jasowang@redhat.com, davem@davemloft.net, kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com Date: Wed, 30 Sep 2020 10:47:20 +0530 Message-Id: <20200930051722.389587-1-anant.thazhemadam@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Cc: Anant Thazhemadam , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, bpf@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [Linux-kernel-mentees] [PATCH 0/2] reorder members of structures in virtio_net for optimization X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" The structures virtnet_info and receive_queue have byte holes in middle, and their members could do with some rearranging (order-of-declaration wise) in order to overcome this. Rearranging the members helps in: * elimination the byte holes in the middle of the structures * reduce the size of the structure (virtnet_info) * have more members stored in one cache line (as opposed to unnecessarily crossing the cacheline boundary and spanning different cachelines) The analysis was performed using pahole. These patches may be applied in any order. Anant Thazhemadam (2): net: reorder members of virtnet_info for optimization net: reorder members of receive_queue in virtio_net for optimization drivers/net/virtio_net.c | 44 +++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 21 deletions(-) -- 2.25.1 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees