From patchwork Fri Nov 16 15:24:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 999000 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="q/kFK0Ri"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42xMTr44Hhz9s47 for ; Sat, 17 Nov 2018 02:24:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728354AbeKQBhT (ORCPT ); Fri, 16 Nov 2018 20:37:19 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33759 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728079AbeKQBhS (ORCPT ); Fri, 16 Nov 2018 20:37:18 -0500 Received: by mail-pl1-f193.google.com with SMTP id z23so76158plo.0 for ; Fri, 16 Nov 2018 07:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K7zlO5Hq9jFO3ghsbak+EnCy7fbZwlMIJM6ZWMO5Yes=; b=q/kFK0Ri3iEbBAAJjSZ3sUf2naHncESw9njFU+wq682SF2vQ924YLIufjC9ux51mLd GeKCdH00gyxDpIHbiPI76Rjx+fJ8AKLn3sffcGiEtlL+/dNo+mBaK+81VLSIDwig7o3i UkNzMORsQmj5r+XFQKGl7liBZ3Hcp3Kq+thw4g249Gfv3R87eTp4RDy7XsxU2Tnola0p h1B8yTQmzYME9VZ9PqwyrzM8sz8iz/HLGdM4hHNI9nvUam0rMxhNlRb8bHJovwZsQl34 iOC5C5zzRDU0fe6vf6pKkCp/EsjDkInTxemXTmwMQ9hxv19ncV3ATJSzaN8GjJNBHbsI /+TA== 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=K7zlO5Hq9jFO3ghsbak+EnCy7fbZwlMIJM6ZWMO5Yes=; b=U6iXLll4bFkdkje21BEwWtBmQW0RMb3pINgCkCdc9jGVwBR8qBiR2Xh2AxVtSIoOKk KfKe1/FUUpKahZ+yxZOZ6sxrPfJb7eV6tQ1wax5M8DSoAMnSdAjxux9LXW252vpVwb9z AraoXFxsrRGSv9PDr0dvFj2FbEbTt7yQv5QgYAWhCNmlWEsKjzGIGhpEmkKLl34D1vJ3 xcotBBNBO1xalkd1H8ytEw3YYeimDLgMTOaUYnE2MLKlAAdapox1i4PYInL2oiCVzrRX J0bQAKfDZANhMiUfK9AmBdIN1obcYemXXuI8jnTkJjXRMNW1PLB0/kF8ItT169VbZtW/ k7Og== X-Gm-Message-State: AGRZ1gKNMbr4uasn0KiybLDw1JUsrIEUNwOpDE4gMhxPw4iD9ONV/IVw E/8WUWe7x4qd5TFL9PHgf17vk/b6Nmewdw== X-Google-Smtp-Source: AJdET5efWrJbyPzVgQMizEOp6JTFpS6AZqXrzog6/YyNkYErAOyGpsej6cyv4OCyxj1t9UYfG4abPQ== X-Received: by 2002:a17:902:bccc:: with SMTP id o12-v6mr11490722pls.281.1542381869478; Fri, 16 Nov 2018 07:24:29 -0800 (PST) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id f22-v6sm31337017pfn.177.2018.11.16.07.24.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Nov 2018 07:24:27 -0800 (PST) From: Eric Dumazet To: "David S . Miller" Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next] net: align pcpu_sw_netstats and pcpu_lstats structs Date: Fri, 16 Nov 2018 07:24:24 -0800 Message-Id: <20181116152424.222826-1-edumazet@google.com> X-Mailer: git-send-email 2.19.1.1215.g8438c0b245-goog MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Do not risk spanning these small structures on two cache lines, it is absolutely not worth it. For 32bit arches, the hint might not be enough, but we do not really care anymore. Signed-off-by: Eric Dumazet --- include/linux/netdevice.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 917ae7b6263e4686ac7af4d16445f4e996001ea6..086e64d885971ff04f186d488975b3305a0fbb1d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2389,13 +2389,13 @@ struct pcpu_sw_netstats { u64 tx_packets; u64 tx_bytes; struct u64_stats_sync syncp; -}; +} __aligned(4 * sizeof(u64)); struct pcpu_lstats { u64 packets; u64 bytes; struct u64_stats_sync syncp; -}; +} __aligned(2 * sizeof(u64)); #define __netdev_alloc_pcpu_stats(type, gfp) \ ({ \