Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 18 Mar 2001 13:14:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 18 Mar 2001 13:14:05 -0500 Received: from neon-gw.transmeta.com ([209.10.217.66]:15113 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Sun, 18 Mar 2001 13:14:00 -0500 To: linux-kernel@vger.kernel.org From: torvalds@transmeta.com (Linus Torvalds) Subject: Re: changing mm->mmap_sem (was: Re: system call for process information?) Date: 18 Mar 2001 10:13:11 -0800 Organization: Transmeta Corporation Message-ID: <992trn$lk1$1@penguin.transmeta.com> In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org In article , Rik van Riel wrote: > >OK, I'll write some code to prevent multiple threads from >stepping all over each other when they pagefault at the >same address. > >What would be the preferred method of fixing this ? > >- fixing do_swap_page and all ->nopage functions There is no need to fix gthe "nopage" functions. They never see the page table directly anyway. So the only thing that _should_ be needed is to make sure that do_no_page(), do_swap_page() and do_anonymous_page() will re-aquire the mm->page_table_lock and undo their work if it turns out that the page table entry is no longer empty.. (do_wp_page() should already be ok in this regard - it already does this exactly because present pagetable entries can already race with kswapd. What we're adding is that _nonpresent_ page table entries can race with multiple invocations of concurrent page faults) >- hacking handle_mm_fault to make sure no overlapping > pagefaults will be served at the same time No. The whole reason the rw_semaphores were done in the first place was to allow page faults to happen concurrently to allow threaded applictions to scale up even when faulting. 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/