Received: by 10.223.176.5 with SMTP id f5csp1896094wra; Wed, 31 Jan 2018 13:16:37 -0800 (PST) X-Google-Smtp-Source: AH8x2242XKMROa25BYAxxIBeujH1Nr+5Y0iJ2DmbvfUHwMG/Xz4/yA0McGfy+Jd6frUYZbtJFckO X-Received: by 10.101.77.8 with SMTP id i8mr27832033pgt.308.1517433397846; Wed, 31 Jan 2018 13:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517433397; cv=none; d=google.com; s=arc-20160816; b=P7opwazy5j76KxKQofErPzd+SFa/KKVV3XoCP/LJAtagw2q10qzCHsSJQQJW7yreBC c0jjGhOZJmPwzmISHi0j/JECqVCiBBoXyfPQEKzzt+6s4qzMT5JXYOmR3wnQ9MUvzzoA en7YtL9Jvan/jeBNsVuYN7bWDiisni4TvVmbcmzeCB2Hd9QkNKQnSJ4wpS8ptSU0AUU/ WhogC16y3ichrEyA1DWpSrJ545WHghv+1+S25TJS2J+FFuE4Ty+NfDue/yWng/vAQeF7 UIGGp7AsTlO5AQdF0xCUC56wmEnF1G7X9n/N5cZBgQYOYAx6YTa8ws+g6UsgMOBGnEVe NniQ== 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=+KVfQh+Lfa6BISc75OsnRAm++8OpKCCwo63CZnlg+J4=; b=ZuVBmBPoOifpbBTJhi2D4AzTxIgOTIOFCzQ/k6L9qvIUKces1Sr098unuSuejlMHr2 78QjxPJHTHcPIUBXNwQJIiIH7TjN8AJaJ/SiqiCfSZY6MP+4vn+hFy+T++2b0OJVJ/8W wnmCmg7xSChD5K33j57ti1G9WVaC0R9nA6ulSpseWRkk8Mo0fDPSwWNwoevDNf/a+U8+ i5nLtB6QFYsKcoAW7ZERwkAXCrzyuAVXWciLAr6MRI5jrwQ/gfZZYyU5GotfSY40Bcbs ffQANLU5/miFACn6bzZNCTRiasIlE8s5iBHABs+ZZWzSH1rUyMHPrxTTuQYWIzG33UzU Cq7A== 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 o9-v6si113467pls.290.2018.01.31.13.16.22; Wed, 31 Jan 2018 13:16:37 -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 S1753195AbeAaVPl (ORCPT + 99 others); Wed, 31 Jan 2018 16:15:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:53778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753145AbeAaVPk (ORCPT ); Wed, 31 Jan 2018 16:15:40 -0500 Received: from mail-it0-f45.google.com (mail-it0-f45.google.com [209.85.214.45]) (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 F2CB12178D for ; Wed, 31 Jan 2018 21:15:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2CB12178D 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-it0-f45.google.com with SMTP id e1so1284433ita.0 for ; Wed, 31 Jan 2018 13:15:39 -0800 (PST) X-Gm-Message-State: AKwxyteSGeDGgFFRZWnQCQZQjXtwseBOy68cHtMVRU3q+uO+Kg1MntCW DaZCollmfI+bCfBLjaRkiUlqxH6Nx3+4ueP6gccBfw== X-Received: by 10.36.1.66 with SMTP id 63mr38640831itk.104.1517433339428; Wed, 31 Jan 2018 13:15:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.84 with HTTP; Wed, 31 Jan 2018 13:15:19 -0800 (PST) In-Reply-To: <0E65629C-0D7D-4602-A43D-B18E62F330A6@gmail.com> References: <20180131201118.1694-1-namit@vmware.com> <8bb352bc-4e1f-4e87-80e3-a8e65d618d2a@linux.intel.com> <0E65629C-0D7D-4602-A43D-B18E62F330A6@gmail.com> From: Andy Lutomirski Date: Wed, 31 Jan 2018 13:15:19 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86: Align TLB invalidation info To: Nadav Amit Cc: Dave Hansen , "the arch/x86 maintainers" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , LKML , Peter Zijlstra , Andy Lutomirski 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:09 PM, Nadav Amit wrote: > Dave Hansen wrote: > >> On 01/31/2018 12:11 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. >>> >>> GCC provides a way to deal with it by using >>> __builtin_alloca_with_align(). Use it to avoid the bouncing cache lines. >> >> It doesn't really *bounce*, though, does it? I don't see any writes on >> the remote side. The remote use seems entirely read-only. >> >> You also don't have to exhaustively test this, but I'd love to see at >> least a sanity check with a microbenchmark (or something) that, yes, >> this does help *something*. Maybe it makes the remote >> flush_tlb_func_common() run faster because it's pulling in fewer lines, >> or maybe you can even detect fewer misses in there. > > I agree that with the whole Meltdown/Spectre entry-cost it might not even be > measurable, at least on small ( < 2 sockets) machines. But I do not think it > worth profiling. Basically, AFAIK, all the data structures that are used for > inter-processor communication by the kernel are aligned, and this is an > exception. > This is only going to be measurable at all on NUMA, I suspect.