Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1213607imm; Wed, 22 Aug 2018 22:13:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxu6tAMnfyJZ6TX8iyi1ufwIbVRa7+Xpz5N57d4EvSrqP32u3t9kPZxY2s2ioT48CBl8Xov X-Received: by 2002:aa7:82c3:: with SMTP id f3-v6mr61304566pfn.136.1535001229239; Wed, 22 Aug 2018 22:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535001229; cv=none; d=google.com; s=arc-20160816; b=VhibCQyw+EO88TpQY1kwCeoKkONOgeH/E+GND1DqhbXRY1fVQMcE1zwT1KpoNLS6cJ wudz0ori5cckh0uQpQJDO90Yz0FB+CVUhkrsnIvdSmBF70DVesV9IDPKTFh3dtyW9RtZ qbKrEzKaV8c07vOw4QLeSeEPTGNChzvEBncEsGC8zhzvTY5C0eW8IF3VbBEji4rag2Hd F0ArMEI9W/hJgkQhnjLjF9XJPxLMD+OzE1ooQ/bxqyPcIeJqPLKTi4Nw4JT1Vco0gcOl 1y9JWB4+Ie7NMeSJ1sTVfZ5xs0CtGi4Nh5AXlm/7J10PgCKxuRCvPj0z/5HM0oXtujj9 tdBg== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=JbnlinS3b4AHWk9RQjPRDQ3Wgq/44nd2GSc2B7c13L4=; b=Vygzc6pNVc6taAMm3iS068ohifL+3PR63Jtzye2QWvLJ0E7oAR9vedqhGDVR5Hd4d6 TMZdiW7rWGE8JzXkeCTi4RzsZK6x984weD9HSoyQAv+greuKiEWjNoxU1ky0GSm70IYu COzfRHeIOIsP5eff/D7KhLB/uUnzf8V+j6Uc+6AyIFKsdU3NDioGWBQf0VPXNfSW0uL4 aT6pZKyWJKeI3Uk2aus1tB7n5LsW/PDBiO7ZwecRm3qKilwRfEbuzJPfVkCykvNOPA2g Z9mI9u0qNYoiBpO+GS7LCjt20+ecKegkFuM2CF1oXXLTnR1qUFaLnc4jJ0QHbPIiBaNi FjsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UFpOnXl7; 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 186-v6si3878745pff.270.2018.08.22.22.13.33; Wed, 22 Aug 2018 22:13:49 -0700 (PDT) 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=@linux-foundation.org header.s=google header.b=UFpOnXl7; 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 S1728522AbeHWIjp (ORCPT + 99 others); Thu, 23 Aug 2018 04:39:45 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:40178 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbeHWIjo (ORCPT ); Thu, 23 Aug 2018 04:39:44 -0400 Received: by mail-io0-f196.google.com with SMTP id l14-v6so3337696iob.7 for ; Wed, 22 Aug 2018 22:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JbnlinS3b4AHWk9RQjPRDQ3Wgq/44nd2GSc2B7c13L4=; b=UFpOnXl7V9ARfzAH/wj66TkhSTED0gaCRYjc+Kz8AmQi0I3rOciMOPQ1YjQyCZietN xEY2jTD/+VmjUFlcQHfrupHEWjWTemPYPbpjJz7oN7uKaU12nyhk3iiu/KuFT0cAn3p2 HNJXNBnqzq4I9DWQFlfWYfKU26FSo/jRXB4Yc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JbnlinS3b4AHWk9RQjPRDQ3Wgq/44nd2GSc2B7c13L4=; b=dG/vXjdfbUL85UuAk53Uww9qMiIbTC9WQVZx1iCKuU/rJsaFAGcq3VShdJTvy5V9kE nlmxl0k9wLEaOAUzXVTtRNWZ929wkJyszfuO1hFHi6aphf7YTtjzWtUWHHq+IupIQUa3 aY7sfYgvSBajcsqz4rR9dsC6yIr+NQUt6bvtz74/6texV46vQwvK4+uAN7An9ZH7MdTe tpPimJpcbtlmkInyFNTfQjhtxxjzDHl1UvtuuvvNlXViWldpw530bVRfo1XGWdGbsvLi B/7hWojN+TxUHOobLd0ztSyGycq9uwWRU0RhDkutLD+duAX5o5kbw9NR3l+7/W2EqQfF pjcg== X-Gm-Message-State: APzg51BJbokQkpKFJBniIEECdCVIBczQj9210DyulyOhQzA0m70B5Esg R4pGzj2oLJVV8yK7ERbkqNDROwGDGh/xgPe2U7k= X-Received: by 2002:a6b:f815:: with SMTP id o21-v6mr2075215ioh.203.1535001112246; Wed, 22 Aug 2018 22:11:52 -0700 (PDT) MIME-Version: 1.0 References: <20180822153012.173508681@infradead.org> <20180822154046.823850812@infradead.org> <20180822155527.GF24124@hirez.programming.kicks-ass.net> <20180823134525.5f12b0d3@roar.ozlabs.ibm.com> <776104d4c8e4fc680004d69e3a4c2594b638b6d1.camel@au1.ibm.com> In-Reply-To: <776104d4c8e4fc680004d69e3a4c2594b638b6d1.camel@au1.ibm.com> From: Linus Torvalds Date: Wed, 22 Aug 2018 22:11:41 -0700 Message-ID: Subject: Re: [PATCH 3/4] mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE To: Benjamin Herrenschmidt Cc: Nick Piggin , Peter Zijlstra , Andrew Lutomirski , "the arch/x86 maintainers" , Borislav Petkov , Will Deacon , Rik van Riel , Jann Horn , Adin Scannell , Dave Hansen , Linux Kernel Mailing List , linux-mm , David Miller , Martin Schwidefsky , Michael Ellerman 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, Aug 22, 2018 at 9:54 PM Benjamin Herrenschmidt wrote: > > > So we do need a different flush instruction for the page tables vs. the > normal TLB pages. Right. ARM wants it too. x86 is odd in that a regular "invlpg" already invalidates all the internal tlb cache nodes. So the "new world order" is exactly that patch that PeterZ sent you, that adds a + unsigned int freed_tables : 1; to the 'struct mmu_gather', and then makes all those pte/pmd/pud/p4d_free_tlb() functions set that bit. So I'm referring to the email PeterZ sent you in this thread that said: Nick, Will is already looking at using this to remove the synchronous invalidation from __p*_free_tlb() for ARM, could you have a look to see if PowerPC-radix could benefit from that too? Basically, using a patch like the below, would give your tlb_flush() information on if tables were removed or not. then, in that model, you do *not* need to override these pte/pmd/pud/p4d_free_tlb() macros at all (well, you *can* if you want to, for doing games with the range modification, but let's sayt that you don't need that right now). So instead, when you get to the actual "tlb_flush(tlb)", you do exactly that - flush the tlb. And the mmu_gather structure shows you how much you need to flush. If you see that "freed_tables" is set, then you know that you need to also do the special instruction to flush the inner level caches. The range continues to show the page range. Linus