Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp910581imb; Fri, 1 Mar 2019 18:56:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyvMB/rGaIQlIvhrYad9RLG0RrWGYNAZaPtTBgL1vUbPKpdRRdx/KskwUHd10dBQhcBO7LS X-Received: by 2002:a17:902:b58c:: with SMTP id a12mr8928876pls.102.1551495390393; Fri, 01 Mar 2019 18:56:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551495390; cv=none; d=google.com; s=arc-20160816; b=pj3U/wYYdA2wGfMlU0Oz3Jr3ov2Ttz1Yrafw/V21IpM3JVmJCf1fkRAVD3tgEn4Flz EcfwhxjaZVpV2y+A/Nx+M5JVz/+9JtP5g/PpeifZ0nlLjdm7Mjbwuoc9HI2UMi1FfqJk Dhe/QMjIiWAZh2kSON4gdTsMb2R5o/cry9ugy5o6cyDjn3l0w9O64MxD9qndrYfyPIvF BSVXzbRLRRta3HwcsYkrGsVjwmK6dTsgAYVegVDznJ24C/A/Jw4cq1ApClPOixY5LRBd bFGjP0oszAuBJKKw8+ZvfQZy/NgVinVMKBZ1PDx1tFOL0DRu7TIm4eBLY/UBKOUH31im l83g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=6m44prTcMvmzDN6eEIKDN9J0iPto2xoYmMiGmV0jzBU=; b=lAsMbBP1JL/fN2yAIEPwwJHxwB+6s+ABpPb5MBav8vZGMDloTxhw1eFgvWGtaU+hZn jTJycumESwdDxnfuQf7TXFKU3NH7t3+tLvvk/UNl5FlJ7SysEGCPZhjGrRjfcaMgtgez tVll87rVjk8t+gmIJm5DjETZiBg6aPdyo1BrgkbeLnC+32cU9OmKJQCu1DmRy2VUesGW 9TOX1eVBre1Tsaf0qgvnJWEZaGcV6yNwI/NOr+Qx28plbvYuKvQ+aTJEjazdSPaK/YPC Zgdesr6TOXu65vScVoh/gU0WM9WAlwOlpi+ODwGnmQqi4iNEVR6+vjlPHQnxH+hhWw4T MHyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si16002213pgv.157.2019.03.01.18.56.14; Fri, 01 Mar 2019 18:56:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728351AbfCBCyC (ORCPT + 99 others); Fri, 1 Mar 2019 21:54:02 -0500 Received: from mga09.intel.com ([134.134.136.24]:61568 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbfCBCwa (ORCPT ); Fri, 1 Mar 2019 21:52:30 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2019 18:52:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,430,1544515200"; d="scan'208";a="148572592" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by fmsmga004.fm.intel.com with ESMTP; 01 Mar 2019 18:52:27 -0800 From: Fenghua Yu To: "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "H Peter Anvin" , "Paolo Bonzini" , "Dave Hansen" , "Ashok Raj" , "Peter Zijlstra" , "Ravi V Shankar" , "Xiaoyao Li " Cc: "linux-kernel" , "x86" , kvm@vger.kernel.org, Fenghua Yu Subject: [PATCH v4 02/17] drivers/net/b44: Align pwol_mask to unsigned long for better performance Date: Fri, 1 Mar 2019 18:44:56 -0800 Message-Id: <1551494711-213533-3-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1551494711-213533-1-git-send-email-fenghua.yu@intel.com> References: <1551494711-213533-1-git-send-email-fenghua.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A bit in pwol_mask is set in b44_magic_pattern automatically by set_bit. set_bit sets the bit in a single unsigned long location. Since pwol_mask may not be aligned to unsigned long, the location may cross two cache lines and accessing the location degradates performance. On x86, accessing two cache lines in locked instruction in set_bit is called split lock and can cause overall performance degradation. To avoid to impact performance by accessing two cache lines in set_bit, align pwol_mask to unsigned long. Signed-off-by: Fenghua Yu --- drivers/net/ethernet/broadcom/b44.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 97ab0dd25552..bc544b6b9c3a 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c @@ -1547,7 +1547,8 @@ static void b44_setup_pseudo_magicp(struct b44 *bp) u32 val; int plen0, plen1, plen2; u8 *pwol_pattern; - u8 pwol_mask[B44_PMASK_SIZE]; + /* Align to unsigned long for better performance in set_bit() */ + u8 pwol_mask[B44_PMASK_SIZE] __aligned(sizeof(unsigned long)); pwol_pattern = kzalloc(B44_PATTERN_SIZE, GFP_KERNEL); if (!pwol_pattern) -- 2.7.4