Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757583Ab0GNX2f (ORCPT ); Wed, 14 Jul 2010 19:28:35 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:58433 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754522Ab0GNX2e (ORCPT ); Wed, 14 Jul 2010 19:28:34 -0400 MIME-Version: 1.0 In-Reply-To: <20100714230913.GG22373@basil.fritz.box> References: <20100714170617.GB4955@Krystal> <20100714184642.GA9728@elte.hu> <20100714195617.GC22373@basil.fritz.box> <20100714200552.GA22096@Krystal> <20100714223116.GB14533@nowhere> <20100714230913.GG22373@basil.fritz.box> Date: Wed, 14 Jul 2010 16:22:52 -0700 Message-ID: Subject: Re: [patch 1/2] x86_64 page fault NMI-safe From: Linus Torvalds To: Andi Kleen Cc: Frederic Weisbecker , Mathieu Desnoyers , Ingo Molnar , LKML , Andrew Morton , Peter Zijlstra , Steven Rostedt , Steven Rostedt , Thomas Gleixner , Christoph Hellwig , Li Zefan , Lai Jiangshan , Johannes Berg , Masami Hiramatsu , Arnaldo Carvalho de Melo , Tom Zanussi , KOSAKI Motohiro , "H. Peter Anvin" , Jeremy Fitzhardinge , "Frank Ch. Eigler" , Tejun Heo Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1095 Lines: 27 On Wed, Jul 14, 2010 at 4:09 PM, Andi Kleen wrote: > > It can happen in theory, but for such a rare case take a lock > and walking everything should be fine. Actually, that's _exactly_ the wrong kind of thinking. Bad latency is bad latency, even when it happens rarely. So latency problems kill - even when they are rare. So you want to avoid them. And walking every possible page table is a _huge_ latency problem when it happens. In contrast, what's the advantage of doing thigns synchronously while holding a lock? It's that you can avoid a few page faults, and get better CPU use. But that's _stupid_ if it's something that is very rare to begin with. So the very rarity argues for the lazy approach. If it wasn't rare, there would be a much stronger argument for trying to do things up-front. Linus -- 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/