Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3099509imm; Fri, 24 Aug 2018 10:29:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbUW/980ZzlFrOD0949fPvKrkZZuHQkJlD8yR0t8NbseV1QDP3YGQOhIo7sA9nrFniCJSup X-Received: by 2002:a62:c0a:: with SMTP id u10-v6mr2938819pfi.43.1535131740895; Fri, 24 Aug 2018 10:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535131740; cv=none; d=google.com; s=arc-20160816; b=l1zrAE1+/D65UlX2TyUbOMqGXLcFaj0NN9EvmxlTNR0y5x+B52kdjm+tuiqxx9YN3z AYvrbWjFSpUozfv1Jwd7x42tUrUOuSERzJI1wD7u5+RmbuscBBsqSXIJEspQIoWb9htj 3ZCuLo77Z9ekNkJz+Vpar9JsxrnuiSBVOlIq13qHT/YD1fJNiY2Jd2C3xqXQjHlg4VvB 4d6jT784gdXUdu3ikrqO2LwNlzdwEYSISAWzM2JnVNbEvbNw6DaH5RILyNJt0CN8WdbG wqvzPJngWMEZgeKPQw5SZAp97OQb/dEseColkNlSBH9oywcoKwlqcyk5DhJkNmod6I6q 75/A== 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=9s1CHgIVgZFQtE7te+Z/DSQx69Tk8XIDazUK6d96EXs=; b=QBmMFLKpgnaU+27VEpAd0leBnBEUFYULIomdKuG4/3GnmTsj2ak21xGxgg61lxuHjb RjNDys6YkPoeYtUNac6XAG3RJ9TXFdmnhLOZr+34mQ7B/Gp68tO38V6AYx8aVeNi6jZ8 IyK70YEag8m08PuxSLKw9RF7wZtkj6u1a0PqogWuCpw26PFTWxTzipWwJ3d7xDkN22ZZ pEKoIiZ/Z3hd3L0TETG0EZp5mBKyfb/gs//p2e7VPyzH3EpoERUGDY/iosQxWD/YbTNs wtu+kSRnrt0qasPkqD/6cuuesMKqN7M8axRMsVjlbefCJzTFXyRow0OdF1SH7sNZnpUG a8iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LtNk3KOq; 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=QUARANTINE 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 b5-v6si6899910pls.507.2018.08.24.10.28.42; Fri, 24 Aug 2018 10:29:00 -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=@gmail.com header.s=20161025 header.b=LtNk3KOq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726896AbeHXVC2 (ORCPT + 99 others); Fri, 24 Aug 2018 17:02:28 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39294 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbeHXVC2 (ORCPT ); Fri, 24 Aug 2018 17:02:28 -0400 Received: by mail-pg1-f193.google.com with SMTP id m3-v6so3683533pgp.6 for ; Fri, 24 Aug 2018 10:26:53 -0700 (PDT) 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=9s1CHgIVgZFQtE7te+Z/DSQx69Tk8XIDazUK6d96EXs=; b=LtNk3KOqFY8pj8Zd5queXcOygWlN/LoDonjkA/94aLaOP0P8IxpFqekfnaCYo/+8CX XM6Umq4kv5Cy19RLvHclu27TWZOQtYJgELEiMUimV3OVaC7o8zB++etZzg5oCa9KedT0 rvJwu/H4NuzVuV4QmhGjUdngARXBg1MQPL/34YhjFHg61xOlsUtIT/EivlGD7SXmqa8f sZ1RmA7TvJDHop4rC67I1PCLg0ccG8UNXi5/rvhf5JY5e8C8jzXRJ3OCXZMI6gO0fdHo wgELo/P9kcgIlXFrIuDW+I2+jUMtFIvontq9BTug9jlpT/fxSgvyXtO5MozDWv3g2bNy 9rTA== 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=9s1CHgIVgZFQtE7te+Z/DSQx69Tk8XIDazUK6d96EXs=; b=Q1EWyC/y7TmIe0ZEfzFW7bn4tQj2ipetyPyDQSIvwyZO3UrGFR7dICnRreB51yqSiU Z+CnJW0htLWWeVOAyV/f39FG14IUg+7Hkql5K93COzZKe0tyiHKwjkn4MSeC9zgrQHC6 uRdh3ywSK9X78W+wtCcPqik5MG2OUG0fpi3hqBSbbAudmtajK8ZOhTSC1W4S3zEfvHMv HaqX7BRQYVNALdCwl1LnK2W1OWKMflIYBrePJt7TvnEkPYdLV/GaXulrNjTKQrq5HAke 5JeWelPJZ+TiyQdxx6jInPC9hp3dGs0srHgxeL3hxPKPKbacVJNNdexTlr+NvWiV5jbt 56yg== X-Gm-Message-State: APzg51DxwPpBPgk/YIr7av1jh/UKZxkHOpNfSyu5pHApz5bhr08ozmX6 sa6U4WFUMgnb/yv/sEkumAc= X-Received: by 2002:a65:5545:: with SMTP id t5-v6mr2523502pgr.157.1535131613344; Fri, 24 Aug 2018 10:26:53 -0700 (PDT) Received: from [10.33.114.204] ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id v22-v6sm12034464pfi.60.2018.08.24.10.26.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Aug 2018 10:26:52 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [PATCH 3/4] mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE From: Nadav Amit In-Reply-To: <20180824084717.GK24124@hirez.programming.kicks-ass.net> Date: Fri, 24 Aug 2018 10:26:50 -0700 Cc: Linus Torvalds , Benjamin Herrenschmidt , Nick Piggin , Andrew Lutomirski , the arch/x86 maintainers , Borislav Petkov , Rik van Riel , Jann Horn , Adin Scannell , Dave Hansen , Linux Kernel Mailing List , linux-mm , David Miller , Martin Schwidefsky , Michael Ellerman Content-Transfer-Encoding: quoted-printable Message-Id: 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> <20180823133958.GA1496@brain-police> <20180824084717.GK24124@hirez.programming.kicks-ass.net> To: Peter Zijlstra , Will Deacon X-Mailer: Apple Mail (2.3445.9.1) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org at 1:47 AM, Peter Zijlstra wrote: > On Thu, Aug 23, 2018 at 02:39:59PM +0100, Will Deacon wrote: >> The only problem with this approach is that we've lost track of the = granule >> size by the point we get to the tlb_flush(), so we can't adjust the = stride of >> the TLB invalidations for huge mappings, which actually works nicely = in the >> synchronous case (e.g. we perform a single invalidation for a 2MB = mapping, >> rather than iterating over it at a 4k granule). >>=20 >> One thing we could do is switch to synchronous mode if we detect a = change in >> granule (i.e. treat it like a batch failure). >=20 > We could use tlb_start_vma() to track that, I think. Shouldn't be too > hard. Somewhat unrelated, but I use this opportunity that TLB got your = attention for something that bothers me for some time. clear_fixmap(), which is = used in various places (e.g., text_poke()), ends up in doing only a local TLB flush (in __set_pte_vaddr()). Is that sufficient?