From patchwork Sun Nov 2 14:00:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 405890 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1CF861400A0 for ; Mon, 3 Nov 2014 01:00:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752282AbaKBOAQ (ORCPT ); Sun, 2 Nov 2014 09:00:16 -0500 Received: from mail-ig0-f176.google.com ([209.85.213.176]:59922 "EHLO mail-ig0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbaKBOAP (ORCPT ); Sun, 2 Nov 2014 09:00:15 -0500 Received: by mail-ig0-f176.google.com with SMTP id l13so3696424iga.9 for ; Sun, 02 Nov 2014 06:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; bh=dF65J0l4rPyG/pgB0tzRYSRxYcVYj2nhhg7x+4MmDzg=; b=JMDLvbDDsB7qWBfq7GfpD/pRNKdVrzNXbatfPSPJeyH7D5zYz2RfgTQrhyjZ47leCg MGBPBvc+fI76z5D/CUGy7SnbXgcr1pw6EtUnVjtU1S3jrssKtsbNqUxbY6WqNDv7nE+O irHy7yEFtvzX/k1xHtOTmfIc02iuraEB3ot/JYcDbITCWLrC0Gg5GLg1hrpNNsDd8up7 pNZ+sZSy4p+VUSpWpG+bar/qY/6nAIGm04RIsUFgOH99We4Xh5y5azMeQEpjZazLjBPK NLR2PhzsF8amX3HmnIRUiZlM5y6O7AslCSSJP5MT8Ie8ydjL47omoy/BzLL8Y5IxmPQH uG9g== X-Received: by 10.107.130.98 with SMTP id e95mr567193iod.87.1414936814450; Sun, 02 Nov 2014 06:00:14 -0800 (PST) Received: from [172.19.249.124] ([172.19.249.124]) by mx.google.com with ESMTPSA id 137sm5367230iof.2.2014.11.02.06.00.13 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sun, 02 Nov 2014 06:00:13 -0800 (PST) Message-ID: <1414936812.31792.31.camel@edumazet-glaptop2.roam.corp.google.com> Subject: [PATCH] net: shrink struct softnet_data From: Eric Dumazet To: David Miller Cc: netdev Date: Sun, 02 Nov 2014 06:00:12 -0800 X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet flow_limit in struct softnet_data is only read from local cpu and can be moved to fill a hole, reducing softnet_data size by 64 bytes on x86_64 While we are at it, move output_queue, output_queue_tailp and completion_queue, so that rx / tx paths touch a single cache line. Signed-off-by: Eric Dumazet --- include/linux/netdevice.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c85e065122460e9f077bcb6788018be38e1d7ddf..5ed05bd764dcf3699afdd9a7b17600246de22d1d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2329,10 +2329,7 @@ extern int netdev_flow_limit_table_len; * Incoming packets are placed on per-cpu queues */ struct softnet_data { - struct Qdisc *output_queue; - struct Qdisc **output_queue_tailp; struct list_head poll_list; - struct sk_buff *completion_queue; struct sk_buff_head process_queue; /* stats */ @@ -2340,10 +2337,17 @@ struct softnet_data { unsigned int time_squeeze; unsigned int cpu_collision; unsigned int received_rps; - #ifdef CONFIG_RPS struct softnet_data *rps_ipi_list; +#endif +#ifdef CONFIG_NET_FLOW_LIMIT + struct sd_flow_limit __rcu *flow_limit; +#endif + struct Qdisc *output_queue; + struct Qdisc **output_queue_tailp; + struct sk_buff *completion_queue; +#ifdef CONFIG_RPS /* Elements below can be accessed between CPUs for RPS */ struct call_single_data csd ____cacheline_aligned_in_smp; struct softnet_data *rps_ipi_next; @@ -2355,9 +2359,6 @@ struct softnet_data { struct sk_buff_head input_pkt_queue; struct napi_struct backlog; -#ifdef CONFIG_NET_FLOW_LIMIT - struct sd_flow_limit __rcu *flow_limit; -#endif }; static inline void input_queue_head_incr(struct softnet_data *sd)