Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752208AbdIISCy (ORCPT ); Sat, 9 Sep 2017 14:02:54 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:37979 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbdIISCw (ORCPT ); Sat, 9 Sep 2017 14:02:52 -0400 X-Google-Smtp-Source: AOwi7QBU3VAD3xwEbAjsDhGmt+yd9uQb0xsuMhv8lojDqlTkmY9x43/ohhrL+xr3SNobKgHrEGd4ZnD9SYkOcVepfpI= MIME-Version: 1.0 In-Reply-To: References: <20170908080536.ninspvplibd37fj2@pd.tnic> <20170908091614.nmdxjnukxowlsjja@pd.tnic> <20170908094815.GA278@x4> <20170908103513.npjmb2kcjt2zljb2@gmail.com> <20170908103906.GB278@x4> <20170908113039.GA285@x4> <20170908171633.GA279@x4> <20170908215656.qw66lgfsfgpoqrdm@pd.tnic> <8D582966-08B6-46F2-B12A-BC33F7EF0EB6@amacapital.net> From: Linus Torvalds Date: Sat, 9 Sep 2017 11:02:50 -0700 X-Google-Sender-Auth: sgDNcQTULbLZmaPkhmDxBrUjvn0 Message-ID: Subject: Re: Current mainline git (24e700e291d52bd2) hangs when building e.g. perf To: Andy Lutomirski Cc: Borislav Petkov , Markus Trippelsdorf , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , LKML , Ingo Molnar , Tom Lendacky Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1593 Lines: 41 On Sat, Sep 9, 2017 at 10:49 AM, Andy Lutomirski wrote: > > Anyway, if I need change the behavior back, I can do it in one of two > ways. I can just switch to init_mm instead of going lazy, which is > expensive, but not *that* expensive on CPUs with PCID. Or I can do it > the way we used to do it and send the flush IPI to lazy CPUs. The > latter will only have a performance impact when a flush happens, but > the performance hit is much higher when there's a flush. Why not both? Let's at least entertain the idea. In particular, we don't send IPI's to *all* CPU's. We only send them to the set of CPU's that could have that MM cached. And that set _may_ be very limited. In the best case, it's just the current CPU, and no IPI is needed at all. Which means that maybe we can use that set of CPU's as guidance to how we should treat lazy. We can *also* take PCID support into account. So what I would suggest is something like - if we have PCID support, _and_ the set of CPU's is more than just us, just switch to init_mm. The switch is cheaper than the IPI's. - otherwise do what we used to do, with the IPI. The exact heuristics could be tuned later, but considering Markus's report, and considering that not so many people have really even heavily tested the new code yet (so _one_ report now means that there are probably a shitload of machines that would show it later), I really think we need to steer back towards our old behavior. But at the same time, I think we can take advantage of newer CPU's that _do_ have PCID. Hmm? Linus