Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757299AbdIHXXO (ORCPT ); Fri, 8 Sep 2017 19:23:14 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:46791 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757089AbdIHXXN (ORCPT ); Fri, 8 Sep 2017 19:23:13 -0400 X-Google-Smtp-Source: ADKCNb5UCysCtTN9e7AQJvCkaP/I2l0QyAY9StWm3y4LAjID0onrAcHpxVfB6i92K//j04Sxk6vrm/9TVChGlncRzd0= 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> From: Linus Torvalds Date: Fri, 8 Sep 2017 16:23:11 -0700 X-Google-Sender-Auth: 7hr5YdF93bahSRGCiNXzvg7gBQs 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: 981 Lines: 26 On Fri, Sep 8, 2017 at 4:07 PM, Andy Lutomirski wrote: > > I *think* this is impossible because CPU A's mm_cpumask manipulations > are atomic and should therefore force out the streaming write buffers, > but maybe there's some other scenario where this matters. I don't think atomic memops do that. They enforce globally visible ordering, but since they happen in the cache and is not actually visible to outside, that doesn't actually affect any streaming write buffers. Then, if somebody else requests a cacheline that we have exclusive ownership to, the write buffers just need to flush before we give up that cacheline. So a locked memory op is *not* serializing, it only enforces memory ordering. Big difference. Only fully serializing instructions will serialize with the write buffers, and they are expensive as hell (partly exactly _due_ to these kinds of issues). So this change to delay invalidation does sound fairly scary.. Linus