Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758007Ab0GNXJV (ORCPT ); Wed, 14 Jul 2010 19:09:21 -0400 Received: from one.firstfloor.org ([213.235.205.2]:60885 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755436Ab0GNXJT (ORCPT ); Wed, 14 Jul 2010 19:09:19 -0400 Date: Thu, 15 Jul 2010 01:09:13 +0200 From: Andi Kleen To: Linus Torvalds Cc: Frederic Weisbecker , Mathieu Desnoyers , Andi Kleen , 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 Subject: Re: [patch 1/2] x86_64 page fault NMI-safe Message-ID: <20100714230913.GG22373@basil.fritz.box> References: <20100714170617.GB4955@Krystal> <20100714184642.GA9728@elte.hu> <20100714195617.GC22373@basil.fritz.box> <20100714200552.GA22096@Krystal> <20100714223116.GB14533@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1366 Lines: 33 > - at vmalloc time, when adding a new page directory entry, walk all > the tens of thousands of existing page tables under a lock that > guarantees that we don't add any new ones (ie it will lock out fork()) > and add the required pgd entry to them. > > - or just take the fault and do the "fill the page tables" on demand. > > Quite frankly, most of the time it's probably better to make that last > choice (unless your hardware makes it easy to make the first choice, Adding new PGDs should happen only very rarely (in fact at most once per boot on i386-PAE36 with only 4 entries, most used by user space), most of the time when you do a vmalloc it changes only lower level tables. The PGD for the kernel mappings is already set up. On x86-64 it can happen more often in theory, but in practice it should be also extremly rare because a PGD is so large. That's why I'm not sure this problem even happened. It should be extremly rare that you exactly add that PGD during the per cpu allocation. It can happen in theory, but for such a rare case take a lock and walking everything should be fine. -Andi -- 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/