Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753091Ab2F1K45 (ORCPT ); Thu, 28 Jun 2012 06:56:57 -0400 Received: from casper.infradead.org ([85.118.1.10]:42586 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163Ab2F1K4y convert rfc822-to-8bit (ORCPT ); Thu, 28 Jun 2012 06:56:54 -0400 Message-ID: <1340880904.28750.13.camel@twins> Subject: Re: [PATCH 08/20] mm: Optimize fullmm TLB flushing From: Peter Zijlstra To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , akpm@linux-foundation.org, Rik van Riel , Hugh Dickins , Mel Gorman , Nick Piggin , Alex Shi , "Nikunj A. Dadhania" , Konrad Rzeszutek Wilk , Benjamin Herrenschmidt , David Miller , Russell King , Catalin Marinas , Chris Metcalf , Martin Schwidefsky , Tony Luck , Paul Mundt , Jeff Dike , Richard Weinberger , Ralf Baechle , Kyle McMartin , James Bottomley , Chris Zankel Date: Thu, 28 Jun 2012 12:55:04 +0200 In-Reply-To: References: <20120627211540.459910855@chello.nl> <20120627212831.137126018@chello.nl> <1340838154.10063.86.camel@twins> <1340838807.10063.90.camel@twins> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1308 Lines: 27 On Wed, 2012-06-27 at 16:33 -0700, Linus Torvalds wrote: > IOW, the point I'm trying to make is that even if there are zero > *actual* accesses of user space (because user space is dead, and the > kernel hopefully does no "get_user()/put_user()" stuff at this point > any more), the CPU may speculatively use user addresses for the > bog-standard kernel addresses that happen. Right.. and s390 having done this only says that s390 appears to be ok with it. Martin, does s390 hardware guarantee no speculative stuff like Linus explained, or might there even be a latent issue on s390? But it looks like we cannot do this in general, and esp. ARM (as already noted by Catalin) has very aggressive speculative behaviour. The alternative is that we do a switch_mm() to init_mm instead of the TLB flush. On x86 that should be about the same cost, but I've not looked at other architectures yet. The second and least favourite alternative is of course special casing this for s390 if it turns out its a safe thing to do for them. /me goes look through arch code. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/