Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5671578imm; Mon, 27 Aug 2018 02:03:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbR1AHIOwH05cCMTEaWt2Y9SSWA1e3+xP1K7sexlFAk5jlNSQIwPJVGnbiCcrlmCKBKSpuS X-Received: by 2002:a65:48c6:: with SMTP id o6-v6mr11137023pgs.99.1535360639338; Mon, 27 Aug 2018 02:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535360639; cv=none; d=google.com; s=arc-20160816; b=S60QUiFkgeiIo4ArtYOXayX2bfaBfPxHs1YshMhrsWiwCd3gXeC/97M9d79r/L3yFi e7LcRqC+Ok0m+fqDC1DBTaARvEyz8Via+me7ISlerXOgcfGFSfZA7pSqybPrM9CwG1gE 0jop89glq4Xno1scn51Pk+sAhFi7dywY5mzWPqP9LwxWW92OHc2H6lx1FfOioAxATQSs PjGYPLY6w8VVtsoLhZf4ptiEoXowvZFoU6ErB0yv/RF5zN2EKM6QGvsOgI0rBzXZ4tsx Lp2YwvlUhY4wfhCRniTl6NSR92cvUN5DHvMGiWph4EQt+UKT5VHTjPnEqOOyV0TWnkrs 2uVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=fPs1WpPXu517flu+cev1qTcMK3Hh3IzV+1b7oLsE7SU=; b=vG8pducbarb+VGkKkRyL+at8FQDIymdlAUZuPLvVDUanIG3mIGA+6DWnen2slWs+D2 PbkH5LaOEM6K4vaR8dP1SwU8ahOcJ1m3D1EmMONzEqW/5kY9pUzXHVXTHC6WAtVxHp+Q dKUlSGwFpN7AoYxElIkZPORqu3pmLj/LR8b5jZmNhly0C14GhgVT/UPdQwThKVBUSDqr Le3leD/jeLvQbXUx4ZcZuQF41rOqSWGIdQ3iR8kHkYupYi3l1CaYS2y9uK2iJ6IOw8UZ efJiqcDAD/1LDF5zFMBw+NiNPBNNifboZXkmBbeJ3kxgPYZHJg6p3etJQT0wtMxxHhXY QiJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gkPUF8HS; 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 y4-v6si13890068pgh.225.2018.08.27.02.03.44; Mon, 27 Aug 2018 02:03:59 -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=gkPUF8HS; 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 S1727176AbeH0MsK (ORCPT + 99 others); Mon, 27 Aug 2018 08:48:10 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:39260 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbeH0MsK (ORCPT ); Mon, 27 Aug 2018 08:48:10 -0400 Received: by mail-pg1-f195.google.com with SMTP id m3-v6so6224264pgp.6 for ; Mon, 27 Aug 2018 02:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fPs1WpPXu517flu+cev1qTcMK3Hh3IzV+1b7oLsE7SU=; b=gkPUF8HSiZAdkY28A6bhl1fRqIXbk88vOOXFlxvK3N9J5JrvJ45Wl7LyYByYEoUjlR 0Cge45qQX+vR6sFG2DKK0jhj1yKjuq5E6MOIdn44MS+LNXLKCGuli0GaduUph71+R2SU J8EgDSIUj9y5ufTT7sEflFig9oJUb9iC9ThLDsdZHx+i6rmF7fIfubvCmlJgbv5oqWI1 bPHPgwM88we0mTgSC5Qv+fP8RgQ3UrJd8mYw+0z+aUV4z1RESEog6yf/SzZ0/spnGUNY FtoniK5rym3uQCACyxlTe1KMLGjgJB6BYXxuxFdSNpJobW9kTjEl1fIymFBhHVruj1Pt iQQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fPs1WpPXu517flu+cev1qTcMK3Hh3IzV+1b7oLsE7SU=; b=K/wLsJpSXEBPndcqD8AuhVLyI2BxP+RjjDJH+G2NtvtbbGucD173SjCR5SwNe2cg3R dbidb5A321QBTez8iTAWgZEmtYOAR45IAgMsFNFeNqtcmGdA47W4F4r47cUQmas6fwZS lYqH6fXsid9W3bRaXeST/dVWifAJI0y3/rQe1R0NcaeXEFkGqaAZAAJ2vifWhYsRqh/l pbNo9/QZXhv8XaSSLRAopiqHOqw2SRTyJBjbWcp6H+RIv42RrHbpM2C2A1gPuQ1daVzW MmZ4TGbOgiTS1paMmmNo5xtFVP7vv0FvTmVGFvlz1xuy4BTcTFW/HmafZegQeMxMFKUB FwxA== X-Gm-Message-State: APzg51CGQ9R1AUhO4Q+GLVxgUfTcvM0bCSWxHLUJYVUy2WMk8ZFf9J7i tYDMQjVHNAjkLYh6LuvBVBA= X-Received: by 2002:a62:a216:: with SMTP id m22-v6mr13329184pff.163.1535360543485; Mon, 27 Aug 2018 02:02:23 -0700 (PDT) Received: from roar.ozlabs.ibm.com (59-102-83-192.tpgi.com.au. [59.102.83.192]) by smtp.gmail.com with ESMTPSA id n83-v6sm32292808pfk.19.2018.08.27.02.02.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Aug 2018 02:02:22 -0700 (PDT) Date: Mon, 27 Aug 2018 19:02:13 +1000 From: Nicholas Piggin To: Benjamin Herrenschmidt Cc: Peter Zijlstra , Will Deacon , Linus Torvalds , 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 Subject: Re: [PATCH 3/4] mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE Message-ID: <20180827190213.6c7d85ca@roar.ozlabs.ibm.com> In-Reply-To: <4ef8a2aa44db971340b0bcc4f73d639455dd4282.camel@kernel.crashing.org> References: <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> <20180824113214.GK24142@hirez.programming.kicks-ass.net> <20180824113953.GL24142@hirez.programming.kicks-ass.net> <20180827150008.13bce08f@roar.ozlabs.ibm.com> <20180827074701.GW24124@hirez.programming.kicks-ass.net> <20180827180458.4af9b2ac@roar.ozlabs.ibm.com> <4ef8a2aa44db971340b0bcc4f73d639455dd4282.camel@kernel.crashing.org> X-Mailer: Claws Mail 3.17.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Aug 2018 18:09:50 +1000 Benjamin Herrenschmidt wrote: > On Mon, 2018-08-27 at 18:04 +1000, Nicholas Piggin wrote: > > > Yes.. I see that. tlb_remove_check_page_size_change() really is a rather > > > ugly thing, it can cause loads of TLB flushes. Do you really _have_ to > > > do that? The way ARM and x86 work is that using INVLPG in a 4K stride is > > > still correct for huge pages, inefficient maybe, but so is flushing > > > every other page because 'sparse' transparant-huge-pages. > > > > It could do that. It requires a tlbie that matches the page size, > > so it means 3 sizes. I think possibly even that would be better > > than current code, but we could do better if we had a few specific > > fields in there. > > More tlbies ? With the cost of the broadasts on the fabric ? I don't > think so.. or I'm not understanding your point... More tlbies are no good, but there will be some places where it works out much better (and fewer tlbies). Worst possible case for current code is a big unmap with lots of scattered page sizes. We _should_ get that with just a single PID flush at the end, but what we will get today is a bunch of PID and VA flushes. I don't propose doing that though, I'd rather be explicit about tracking start and end range of each page size. Still not "optimal" but neither is existing single range for sparse mappings... anyway it will need to be profiled, but my point is we don't really fit exactly what x86/arm want. Thanks, Nick