Received: by 10.223.176.5 with SMTP id f5csp2314661wra; Wed, 31 Jan 2018 21:39:30 -0800 (PST) X-Google-Smtp-Source: AH8x224Ee2BngR4ni3u4xOenMNtFWI8s15isK0/rbvls8G3U12NO7/PSV7BQ60SFU5Q2RE+8TYi5 X-Received: by 2002:a17:902:8608:: with SMTP id f8-v6mr31413920plo.366.1517463570090; Wed, 31 Jan 2018 21:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517463570; cv=none; d=google.com; s=arc-20160816; b=ui2KcyLALfn+zukDAwyvLc1d78qxCdmhsTBW+h1PsyEDsStNclKnnEAPKLDHCRtmCa jmvStySsbo0i0dXhPBSnHzeeKDdb3HABVXrHWjvKvsQQwYfP1Xq/R4+3//muwCDHSfn1 XEXjEVL/Wo2DlDdIqdom93XBVgST3d0tXbiLN9X7z5igIp24aU7K10PPf6RzmL5uWU1r R4lRSpFkrqv8wmxPerZOuJMcWVKiJKwak80tW3Fo1N0Sco2eF4sEJM5mnkz5uMTdme4i 0jvPIEGzEon5H36f4S7g6R0kr1ATtbwxh/kaMec+/FkFBWnmv5c95AziP7v7QPafBEot FP6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=GMm2sG8KrPCKLQPuiY8GJDEOo5hVTbPwVTWdXI/5knY=; b=y0Jiaf26eX5GqmMKv9MbOLvHEhnPEx13aQ/cQVbb5HBHl0xhkaYMmpDh4KFUpQ0RzN wGQkIWaUyBcs83SIurn9Q8eP1N5aj7sYBa8RQjg8RreOfcl4BNkegORMnPiHpkAdjQ6F gxy6Cm6rw1V76qerua2pCVrH5Rz9JjjLDCQaVLQ/s/LcPpEwPwmi4BnZexFf4XmIrQ9D am57e9vGezTgtcr9veMBC8QQ+U2Lgkcqf9lnvFN61mPRXqH6pAaL2ZjoM9DBozmCvw4b PrqXWOFHYQ8ywPTKQ/7x5tJM7awt3HF0XYwM+e9OD/8/XaVyWf3TAztJ1iIKqtU+UsHB HraA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JKjR6zxW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s25si982090pfi.96.2018.01.31.21.39.14; Wed, 31 Jan 2018 21:39: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JKjR6zxW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751405AbeBAFiv (ORCPT + 99 others); Thu, 1 Feb 2018 00:38:51 -0500 Received: from mail-pl0-f47.google.com ([209.85.160.47]:42495 "EHLO mail-pl0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000AbeBAFiu (ORCPT ); Thu, 1 Feb 2018 00:38:50 -0500 Received: by mail-pl0-f47.google.com with SMTP id 11so2684898plc.9 for ; Wed, 31 Jan 2018 21:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GMm2sG8KrPCKLQPuiY8GJDEOo5hVTbPwVTWdXI/5knY=; b=JKjR6zxWKLxmLPgRxrFLwG0SLuiAf7p1GGmhtqCT8L4/IMzxxFk0r7pXgl6F+R+SJ7 DLkI46ik7WPtaocKfUnfFYDShhchUnHLiUdV/SU/Hb5Co7g4yIpkck8Z7KWLLPts57Th yakJdq7/tQk5rxBj9NB7tPUb8ePvLY120KKkPcV9Evd+TOJVGHvSLmLrpIO+3tN4RNuO UNW30JaVIOgw0AjFCFctyBL5+awpXQn2vOS4QRCSEOppMEO2MBUkHQENIZt8R/QkOKyI RzfAy7HpZyt4CaHZxsv+wXOpD+pOEF6+4gz8fE4ZL60DeIwOsiNTxMDUYs4ZS638A0Zh Zc4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GMm2sG8KrPCKLQPuiY8GJDEOo5hVTbPwVTWdXI/5knY=; b=rnw8LdXt4wS4UT2ki5nveKNPTAQFMUOizsgHa0fEkxI91FeZJ6Jdl+Xbyz9T2p3rYr wnLDpZKfOlCwyI/PDIjDCtxUvT5qPtd2eia1zQFchPLvvnC9PmzBTjOiZljU8RTrj/vz 5h74h9yPot/9vGD8FFWBnh3Qn3Ie0QZKPp8WH7nHspmgX9y0cmIhf46z/Pjqefv9P+GY Jos3wfbhQFCu8vL6j2fHKKUYFnMIKPEBKm+dko9x8jeNCHmjvOYssxxZu91AMyV7HhG9 sK2mLXFus5EXWn8BESZy0BXAQJ6Cbc+gBqAwNS7VyQZ9sHbMr9O7Qn3R35eDvMB0P9cJ ttfw== X-Gm-Message-State: AKwxytcy1N69XHmh7YNYv98zysQ9MpfGlE4ifHhZdUtcFqZDQN05jrp2 WhfqyKy1sEcD12fT06dbayE= X-Received: by 2002:a17:902:3363:: with SMTP id a90-v6mr29924797plc.159.1517463529271; Wed, 31 Jan 2018 21:38:49 -0800 (PST) Received: from [10.2.101.129] ([208.91.2.2]) by smtp.gmail.com with ESMTPSA id u63sm44397142pfi.63.2018.01.31.21.38.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 21:38:48 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH] x86: Align TLB invalidation info From: Nadav Amit In-Reply-To: Date: Wed, 31 Jan 2018 21:38:46 -0800 Cc: the arch/x86 maintainers , Andy Lutomirski , "H. Peter Anvin" , Peter Zijlstra , LKML , Thomas Gleixner , Ingo Molnar Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180131201118.1694-1-namit@vmware.com> <8bb352bc-4e1f-4e87-80e3-a8e65d618d2a@linux.intel.com> <0E65629C-0D7D-4602-A43D-B18E62F330A6@gmail.com> To: Dave Hansen X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave Hansen wrote: > On 01/31/2018 01:09 PM, Nadav Amit wrote: >>> 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. >=20 > I'm certainly not nak'ing this. I think your patch is likely a good > idea. But, could you please take ten or twenty minutes to go see if > practice matches your assumptions? I'd really appreciate it. If you > can't measure it, then no biggie. [CC=E2=80=99ing the mailing list] Per your request, I measured it (which perhaps I should have done = before). I caused a misalignment intentionally by adding some padding to = flush_tlb_info and compared it with an aligned version. I used ftrace to measure the execution time of flush_tlb_func_remote() = on a 2-socket Haswell machine, using a microbenchmark I wrote for some = research project. It turns out that your skepticism may be correct - In both cases the function execution time is roughly 400ns (2% improvement on the aligned = case which is probably noise). So it is up to you whether you want to discard the patch. Regards, Nadav=