From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 05/17] asm-generic/tlb: Rename HAVE_RCU_TABLE_NO_INVALIDATE Date: Mon, 16 Dec 2019 15:50:41 +0100 Message-ID: <20191216145041.GG2827@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <33ed03aa-a34c-3a81-0f83-20c3e8d4eff7@linux.ibm.com> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-arch.vger.kernel.org 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:54558 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbfLPOu6 (ORCPT ); Mon, 16 Dec 2019 09:50:58 -0500 Date: Mon, 16 Dec 2019 15:50:41 +0100 From: Peter Zijlstra Subject: Re: [PATCH 05/17] asm-generic/tlb: Rename HAVE_RCU_TABLE_NO_INVALIDATE Message-ID: <20191216145041.GG2827@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33ed03aa-a34c-3a81-0f83-20c3e8d4eff7@linux.ibm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: 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 Message-ID: <20191216145041.tqVENJA18cGRjeq4R8v6_gF6LLVtxTMtha8o98wXtOg@z> 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.