Path: csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod From: Linus Torvalds Newsgroups: linux.kernel Subject: Re: Current mainline git (24e700e291d52bd2) hangs when building e.g. perf Date: Sat, 09 Sep 2017 20:50:01 +0200 Message-ID: References: Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nbVJWjKgc6KmeiCLDzikWfWDcSCS5/+9nWuDLlq/e80=; b=jOert+311LfKq3PZaZYVvudkoQ59ZQh9WNhadPsQydk4z0D5c8cvbm83/633BO6Dn8 H2y4UaZTm4RAbNPczcWM7JDohnJ6GfqoEzX9C5y8YGf2b3Yeu4vfuI58Hp3oVOKh0+5Q ZAR4QhbR2KJGoJ6Ihr+XRhFb9Te4XOgDRsupCJczyan5/wSN9e/QgN5GoUw7skCNGaQu 2eXH5SeMotz7ijp/C2RK1w5gh4KorQfxM8LC5cgV4I/OXg8esUAoLy490Em95/ccDpJQ FmqJNLMXaC/bHDfKi0FIl7X1Qs9Qwy0jvKBmrGdFwVzMw1JAl1MWxLw4H0ecuDccr5q3 RmIA== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nbVJWjKgc6KmeiCLDzikWfWDcSCS5/+9nWuDLlq/e80=; b=NM7AP2yLVzlJhO8cRq8+OLNRTkIELTlCx+srobbngvr28zuR+4/AV520p/KP+PuLu4 SMmccLASWkooEwrqeo0xye9egFjsXycXR3Oos8l+tBDXsTuE/WoEOvYsNYY0EWwyfRKw 8lI/72IhGJ6LnOHmaYNv5pXGZt7/57ogil0Vgi6Oc+Z76hpAhdG8dYewvxMrWXfViYAM kv0psC01hOtIeTZfgkBf4uD3klQLM6yj1nF53ik5uh5SqMuIYgsQanXf3DGqxGMmQR6q z9gs4EsOG5xEsGj227cVVndne8IejYxv1w+d4EJxKXJ6Ip4xWLrA59Wr6f/Tk3FjzFMi 5Hsg== X-Gm-Message-State: AHPjjUilVk855oExIJzOTa/VHQtXAsc0JbRzYZkz1z1md56GQHhCa6Nn uYL5XK1raUBqQJzg93/kadzRyASv0Q== X-Google-SMTP-Source: AOwi7QBWX2hdZpZx9IHzuVlVqi7V3/oI9Rfqrrl8rdlVnHPdhtxErsW358a5UyOTXP/n1jKVRbiXqMr+AJpRPTQnkwg= X-Received: by 10.107.3.202 with SMTP id e71mr5074528ioi.39.1504982854330; Sat, 09 Sep 2017 11:47:34 -0700 (PDT) MIME-Version: 1.0 X-Google-Sender-Auth: KDE7MnXv06iqWHZKZ6imWniFDJQ Content-Type: text/plain; charset="UTF-8" Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 26 Organization: linux.* mail to news gateway X-Original-Cc: Markus Trippelsdorf , Andy Lutomirski , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , LKML , Ingo Molnar , Tom Lendacky X-Original-Date: Sat, 9 Sep 2017 11:47:33 -0700 X-Original-Message-ID: X-Original-References: <20170909140700.bp7jonmp7etlb7ov@pd.tnic> <20170909142014.GC289@x4> <20170909143335.ja2iwjsbeyfxz4ez@pd.tnic> <20170909144350.GA290@x4> <20170909163225.GA290@x4> <20170909170537.6xmxtzwripplhhwi@pd.tnic> <20170909172352.GA290@x4> <20170909173633.4ttfk7maooxkcwum@pd.tnic> <20170909181445.GA281@x4> <20170909182952.itqad4ryngjwrgqf@pd.tnic> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1729513 On Sat, Sep 9, 2017 at 11:29 AM, Borislav Petkov wrote: > On Sat, Sep 09, 2017 at 11:26:27AM -0700, Linus Torvalds wrote: >> But the fact that that fixes it for you does indicate that it's not >> just a stale TLB entry or something, it really is some CPU using page >> tables after they have been free'd and been re-allocated to something >> else (and *then* they may point to garbage). > > Cool, I was trying to think of a good use case how we'd hit that. I > guess you just gave one. :) The thing is, even with the delayed TLB flushing, I don't think it should be *so* delayed that we should be seeing a TLB fill from garbage page tables. But the part in Andy's patch that worries me the most is that + cpumask_clear_cpu(cpu, mm_cpumask(mm)); in enter_lazy_tlb(). It means that we won't be notified by peopel invalidating the page tables, and while we then do re-validate the TLB when we switch back from lazy mode, I still worry. I'm not entirely convinced by that tlb_gen logic. I can't actually see anything *wrong* in the tlb_gen logic, but it worries me. Linus