Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752152AbdFUNlG (ORCPT ); Wed, 21 Jun 2017 09:41:06 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50081 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057AbdFUNlA (ORCPT ); Wed, 21 Jun 2017 09:41:00 -0400 Date: Wed, 21 Jun 2017 15:40:58 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Linus Torvalds , Andrew Morton , Mel Gorman , "linux-mm@kvack.org" , Nadav Amit , Rik van Riel , Dave Hansen , Arjan van de Ven , Peter Zijlstra Subject: Re: [PATCH v3 11/11] x86/mm: Try to preserve old TLB entries using PCID In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 594 Lines: 17 On Wed, 21 Jun 2017, Thomas Gleixner wrote: > > + for (asid = 0; asid < NR_DYNAMIC_ASIDS; asid++) { > > + if (this_cpu_read(cpu_tlbstate.ctxs[asid].ctx_id) != > > + next->context.ctx_id) > > + continue; > > + > > + *new_asid = asid; > > + *need_flush = (this_cpu_read(cpu_tlbstate.ctxs[asid].tlb_gen) < > > + next_tlb_gen); > > + return; > > + } > > Hmm. So this loop needs to be taken unconditionally even if the task stays > on the same CPU. And of course the number of dynamic IDs has to be short in > order to makes this loop suck performance wise. ... not suck ...