From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01657C43603 for ; Mon, 16 Dec 2019 15:31:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B9E5F20726 for ; Mon, 16 Dec 2019 15:31:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="owOuxhkO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9E5F20726 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 39C9A8E0006; Mon, 16 Dec 2019 10:31:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 34CB98E0003; Mon, 16 Dec 2019 10:31:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23BB28E0006; Mon, 16 Dec 2019 10:31:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 0ECFC8E0003 for ; Mon, 16 Dec 2019 10:31:12 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id B4752180AD80F for ; Mon, 16 Dec 2019 15:31:11 +0000 (UTC) X-FDA: 76271393142.11.cart81_27798ada5554e X-HE-Tag: cart81_27798ada5554e X-Filterd-Recvd-Size: 4722 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Dec 2019 15:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=a8LsOaGDs/Z3fBnFkqVotZhvYgNBIldUCQVm7RoIjUw=; b=owOuxhkOKLqC2aX5Ubb+i3Lrc 1J/D+0WnBgyS8URosr+J53C7mFpvAzCVyLGKXTcQfUfPOOnkM8BjFyyCZswOaf4LRVcAQfbYBIYDE o1XBGZfki3nEpN3bvWg1RB0E5nC7B0dqfG6j8kTTnYlwT22Dby4B45p4JklKVMbFes5e7eN7xjpBO xI93EfP5FSRaOvV7kRi+AUGzG0CD22v5XS0gxv80irPuOCwmsv7iac5YzdmNjpzvtdt+nbdn2/JYg rFMSL7vf31OneaqLAe2jCNoqMB1dMgB352yWfH56PYzpTwfdZ7wZZO3YV3XTa85eubc90XSYRF0EW fgdfN3KSg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1igsKh-0000Ou-6E; Mon, 16 Dec 2019 15:30:51 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 096BD3035D4; Mon, 16 Dec 2019 16:29:25 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DE7E72B2A192E; Mon, 16 Dec 2019 16:30:47 +0100 (CET) Date: Mon, 16 Dec 2019 16:30:47 +0100 From: Peter Zijlstra To: "Aneesh Kumar K.V" Cc: Michael Ellerman , Will Deacon , Andrew Morton , Nick Piggin , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yoshinori Sato , Rich Felker , "David S. Miller" , Helge Deller , Geert Uytterhoeven , Paul Burton , Tony Luck , Richard Henderson , Nick Hu , Paul Walmsley Subject: Re: [PATCH 05/17] asm-generic/tlb: Rename HAVE_RCU_TABLE_NO_INVALIDATE Message-ID: <20191216153047.GM2871@hirez.programming.kicks-ass.net> References: <20191211120713.360281197@infradead.org> <20191211122955.940455408@infradead.org> <87woawzc1t.fsf@linux.ibm.com> <20191216123752.GM2844@hirez.programming.kicks-ass.net> <20191216132004.GO2844@hirez.programming.kicks-ass.net> <33ed03aa-a34c-3a81-0f83-20c3e8d4eff7@linux.ibm.com> <20191216145041.GG2827@hirez.programming.kicks-ass.net> <20191216151419.GL2871@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191216151419.GL2871@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Dec 16, 2019 at 04:14:19PM +0100, Peter Zijlstra wrote: > On Mon, Dec 16, 2019 at 03:50:41PM +0100, Peter Zijlstra wrote: > > On Mon, Dec 16, 2019 at 07:24:24PM +0530, Aneesh Kumar K.V wrote: > > > > > So __p*_free_tlb() routines on ppc64 just mark that we need a page walk > > > cache flush and the actual flush in done in tlb_flush_mmu. > > > > Not quite, your __p*_free_tlb() goes to pgtable_free_tlb() which call > > tlb_remove_table(). > > > > > As per > > > > > > d86564a2f085b79ec046a5cba90188e61235280 (mm/tlb, x86/mm: Support > > > invalidating TLB caches for RCU_TABLE_FREE ) that is not sufficient? > > > > 96bc9567cbe1 ("asm-generic/tlb, arch: Invert CONFIG_HAVE_RCU_TABLE_INVALIDATE") > > > > And no. Since you have TABLE_NO_INVALIDATE set, tlb_remove_table() will > > not TLBI when it fails to allocate a batch page, which is an error for > > PPC-Radix. > > > > There is also no TLBI when the batch page is full and the RCU callback > > happens, which is also a bug on PPC-Radix. > > It seems to me you need something like this here patch, all you need to > add is a suitable definition of tlb_needs_table_invalidate() for Power. I'm thinking this: #define tlb_needs_table_invalidate() radix_enabled() should work for you. When you have Radix you need that TLBI, if you have Hash you don't.