From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752635AbcIIHpC (ORCPT ); Fri, 9 Sep 2016 03:45:02 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:45368 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751469AbcIIHpB (ORCPT ); Fri, 9 Sep 2016 03:45:01 -0400 Date: Fri, 9 Sep 2016 09:44:56 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: Benjamin Serebrin , Ingo Molnar , Rik van Riel , Linus Torvalds , "H. Peter Anvin" , Linux Kernel Mailing List , Andrew Lutomirski , Borislav Petkov , Mel Gorman , Thomas Gleixner Subject: Re: [PATCH RFC v6] x86,mm,sched: make lazy TLB mode even lazier Message-ID: <20160909074456.GD10153@twins.programming.kicks-ass.net> References: <20160825150515.02c2d8ea@riellap.home.surriel.com> <7E7CF02F-F0B1-493A-98B3-B078174811DA@zytor.com> <20160825170133.0a783ae8@riellap.home.surriel.com> <20160827080316.GA11325@gmail.com> <20160831122710.5285c4ca@annuminas.surriel.com> <20160908065606.GB25876@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 08, 2016 at 09:39:45PM -0700, Andy Lutomirski wrote: > If they're busy threads, shouldn't the yield return immediately > because the threads are still ready to run? Lazy TLB won't do much > unless you get the kernel in some state where it's running in the > context of a different kernel thread and hasn't switched to > swapper_pg_dir. IIRC idle works like that, but you'd need to actually > sleep to go idle. Right, a task doing: for (;;) sched_yield(); esp. when its the only runnable thread on the CPU, is a busy thread. It will not enter switch_mm(), which was where the invalidate hook was placed IIRC.