Received: by 10.223.176.5 with SMTP id f5csp1883084wra; Wed, 31 Jan 2018 13:04:41 -0800 (PST) X-Google-Smtp-Source: AH8x224P24H3dLxeSUcKk3iZgsHyH/VXWCHC4T0xo9vU8VDtAnVPCWBjckqDXmkF0RkVFIyg389p X-Received: by 10.98.211.204 with SMTP id z73mr34941814pfk.198.1517432681189; Wed, 31 Jan 2018 13:04:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517432681; cv=none; d=google.com; s=arc-20160816; b=yfurBd1ft3vdVmqPaEIdYKk+F+5tcCJKgDt0KVOA46QsYsLC7Qu6+Eujr0uNLM3E7i Zl4p901tCj6eJp87lW85cl5tVzXiGN5pUumT7S2PHtOFAZy1Dnzsd48uG0RqWk/Jaqoy xsV2uCAa3TT5xWo0/vlBXaEvX4yfQ5FMTQCqVUBjUdvV0vvi+rVsOX9AlE+6uSdKA307 tsRa8nwj5OhtQVJyWjYX6B5Euxu5Dej36hBqsMPoyK4iioW0O+UhlwZ5/lDospTg56rm YZ2owbcHOUeps+Wccm1vYfnWrJvAVpt02vSWrqt3qk8AfvVyltiQKMHz4656G1X0TQE7 zKYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=KavSHjUxI/VSIig6snQ231Mvq+KRlH1SqxUzE83nz7c=; b=CAsVUubUllwuiOnE7H39vMTMWwEennz8tAW0JygsxCCA5p+yHd0M0SIZHOaj9nQnLU U9WmER88uJvF5qSlsH/KY4C4jjZb1SO4PFnbysN5wqy8Jqdt1sh6aSk08HwZu3kHg6AY G3WJjpIg6el0UdILIeXnWx3ffW65EIcYHVu/fmrclh1AtmaZhcH+OmQBfrrbSkhSbUDu wR+nrgjF+3m5eB+7Nxksc/UyWsaCf/PWIhgel71G1je6J0xORjIvaT0S4/tZJGCTBRb7 chjJbeipA7Ahrl+/mGWXsqwlNOhD8aKT6uHibCGYHymlfnIFRlcAp8FwDLjd0ZNj6fGi okww== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f130si1683388pgc.57.2018.01.31.13.04.26; Wed, 31 Jan 2018 13:04:41 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752796AbeAaVDr (ORCPT + 99 others); Wed, 31 Jan 2018 16:03:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:52882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886AbeAaVDq (ORCPT ); Wed, 31 Jan 2018 16:03:46 -0500 Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B405E21799 for ; Wed, 31 Jan 2018 21:03:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B405E21799 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-io0-f182.google.com with SMTP id f4so16724201ioh.8 for ; Wed, 31 Jan 2018 13:03:45 -0800 (PST) X-Gm-Message-State: AKwxytf1MiWjX6b3/L9otSQZJP3iRuigDscNhpbL13TNrAYmmpKTRDGg mg3hbIKCB/V4e1Digf45aK2NiYnMqTZ9TwEBVvf2CQ== X-Received: by 10.107.167.136 with SMTP id q130mr21986783ioe.173.1517432625088; Wed, 31 Jan 2018 13:03:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.84 with HTTP; Wed, 31 Jan 2018 13:03:24 -0800 (PST) In-Reply-To: <20180131210039.18273-1-namit@vmware.com> References: <20180131210039.18273-1-namit@vmware.com> From: Andy Lutomirski Date: Wed, 31 Jan 2018 13:03:24 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] x86: Align TLB invalidation info To: Nadav Amit Cc: X86 ML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , LKML , Peter Zijlstra , Nadav Amit , Andy Lutomirski , Dave Hansen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 1:00 PM, Nadav Amit wrote: > The TLB invalidation info is allocated on the stack, which might cause > it to be unaligned. Since this information may be transferred to > different cores for TLB shootdown, this might result in an additional > cache-line bouncing between the cores. > > We do not use __cacheline_aligned() since it also defines the section, > which is inappropriate for stack variables. > > Signed-off-by: Nadav Amit > > Cc: Andy Lutomirski > Cc: Dave Hansen Acked-by: Andy Lutomirski This is basically free and adds no mess, so I think it's probably okay even in the absence that it's a huge win. But Dave is right, the commit message needs updating. It will reduce the number of cachelines that become shared and then get exclusively owned by the originator from 2 to 1. This isn't really "bouncing". > > -- > v1 -> v2: use __aligned instead of all the mess (Andy) > --- > arch/x86/mm/tlb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c > index 5bfe61a5e8e3..9690112e3a82 100644 > --- a/arch/x86/mm/tlb.c > +++ b/arch/x86/mm/tlb.c > @@ -576,7 +576,7 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, > { > int cpu; > > - struct flush_tlb_info info = { > + struct flush_tlb_info info __aligned(SMP_CACHE_BYTES) = { > .mm = mm, > }; > > -- > 2.14.1 >