All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Rajesh Venkatasubramanian <vrajesh@umich.edu>
Cc: Hugh Dickins <hugh@veritas.com>,
	"David S. Miller" <davem@redhat.com>,
	raybry@sgi.com, ak@muc.de, benh@kernel.crashing.org,
	manfred@colorfullife.com, linux-ia64@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: page fault fastpath patch v2: fix race conditions, stats for 8,32     and    512 cpu SMP
Date: Thu, 19 Aug 2004 00:20:38 +0000	[thread overview]
Message-ID: <20040819002038.GW11200@holomorphy.com> (raw)
In-Reply-To: <Pine.GSO.4.58.0408182005080.9340@sapphire.engin.umich.edu>

On Wed, 18 Aug 2004, William Lee Irwin III wrote:
>> exit_mmap() has removed the vma from ->i_mmap and ->mmap prior to
>> unmapping the pages, so this should be safe unless that operation
>> can be caught while it's in progress.

On Wed, Aug 18, 2004 at 08:07:24PM -0400, Rajesh Venkatasubramanian wrote:
> No. Unfortunately exit_mmap() removes vmas from ->i_mmap after removing
> page table pages. Maybe we can reverse this, though.

Something like this?


Index: mm1-2.6.8.1/mm/mmap.c
=================================--- mm1-2.6.8.1.orig/mm/mmap.c	2004-08-16 23:47:16.000000000 -0700
+++ mm1-2.6.8.1/mm/mmap.c	2004-08-18 17:18:26.513559632 -0700
@@ -1810,6 +1810,14 @@
 	mm->map_count -= unmap_vmas(&tlb, mm, mm->mmap, 0,
 					~0UL, &nr_accounted, NULL);
 	vm_unacct_memory(nr_accounted);
+	/*
+	 * Walk the list again, actually closing and freeing it.
+	 */
+	while (vma) {
+		struct vm_area_struct *next = vma->vm_next;
+		remove_vm_struct(vma);
+		vma = next;
+	}
 	BUG_ON(mm->map_count);	/* This is just debugging */
 	clear_page_tables(tlb, FIRST_USER_PGD_NR, USER_PTRS_PER_PGD);
 	tlb_finish_mmu(tlb, 0, MM_VM_SIZE(mm));
@@ -1822,16 +1830,6 @@
 	mm->locked_vm = 0;
 
 	spin_unlock(&mm->page_table_lock);
-
-	/*
-	 * Walk the list again, actually closing and freeing it
-	 * without holding any MM locks.
-	 */
-	while (vma) {
-		struct vm_area_struct *next = vma->vm_next;
-		remove_vm_struct(vma);
-		vma = next;
-	}
 }
 
 /* Insert vm structure into process list sorted by address

WARNING: multiple messages have this Message-ID (diff)
From: William Lee Irwin III <wli@holomorphy.com>
To: Rajesh Venkatasubramanian <vrajesh@umich.edu>
Cc: Hugh Dickins <hugh@veritas.com>,
	"David S. Miller" <davem@redhat.com>,
	raybry@sgi.com, ak@muc.de, benh@kernel.crashing.org,
	manfred@colorfullife.com, linux-ia64@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: page fault fastpath patch v2: fix race conditions, stats for 8,32     and    512 cpu SMP
Date: Wed, 18 Aug 2004 17:20:38 -0700	[thread overview]
Message-ID: <20040819002038.GW11200@holomorphy.com> (raw)
In-Reply-To: <Pine.GSO.4.58.0408182005080.9340@sapphire.engin.umich.edu>

On Wed, 18 Aug 2004, William Lee Irwin III wrote:
>> exit_mmap() has removed the vma from ->i_mmap and ->mmap prior to
>> unmapping the pages, so this should be safe unless that operation
>> can be caught while it's in progress.

On Wed, Aug 18, 2004 at 08:07:24PM -0400, Rajesh Venkatasubramanian wrote:
> No. Unfortunately exit_mmap() removes vmas from ->i_mmap after removing
> page table pages. Maybe we can reverse this, though.

Something like this?


Index: mm1-2.6.8.1/mm/mmap.c
===================================================================
--- mm1-2.6.8.1.orig/mm/mmap.c	2004-08-16 23:47:16.000000000 -0700
+++ mm1-2.6.8.1/mm/mmap.c	2004-08-18 17:18:26.513559632 -0700
@@ -1810,6 +1810,14 @@
 	mm->map_count -= unmap_vmas(&tlb, mm, mm->mmap, 0,
 					~0UL, &nr_accounted, NULL);
 	vm_unacct_memory(nr_accounted);
+	/*
+	 * Walk the list again, actually closing and freeing it.
+	 */
+	while (vma) {
+		struct vm_area_struct *next = vma->vm_next;
+		remove_vm_struct(vma);
+		vma = next;
+	}
 	BUG_ON(mm->map_count);	/* This is just debugging */
 	clear_page_tables(tlb, FIRST_USER_PGD_NR, USER_PTRS_PER_PGD);
 	tlb_finish_mmu(tlb, 0, MM_VM_SIZE(mm));
@@ -1822,16 +1830,6 @@
 	mm->locked_vm = 0;
 
 	spin_unlock(&mm->page_table_lock);
-
-	/*
-	 * Walk the list again, actually closing and freeing it
-	 * without holding any MM locks.
-	 */
-	while (vma) {
-		struct vm_area_struct *next = vma->vm_next;
-		remove_vm_struct(vma);
-		vma = next;
-	}
 }
 
 /* Insert vm structure into process list sorted by address

  reply	other threads:[~2004-08-19  0:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2uexw-1Nn-1@gated-at.bofh.it>
     [not found] ` <2uCTq-2wa-55@gated-at.bofh.it>
2004-08-18 23:50   ` page fault fastpath patch v2: fix race conditions, stats for 8,32 and 512 cpu SMP Rajesh Venkatasubramanian
2004-08-18 23:50     ` Rajesh Venkatasubramanian
2004-08-19  0:01     ` William Lee Irwin III
2004-08-19  0:01       ` William Lee Irwin III
2004-08-19  0:07       ` page fault fastpath patch v2: fix race conditions, stats for Rajesh Venkatasubramanian
2004-08-19  0:07         ` page fault fastpath patch v2: fix race conditions, stats for 8,32 and 512 cpu SMP Rajesh Venkatasubramanian
2004-08-19  0:20         ` William Lee Irwin III [this message]
2004-08-19  0:20           ` William Lee Irwin III
2004-08-19  3:19           ` page fault fastpath patch v2: fix race conditions, stats for Rajesh Venkatasubramanian
2004-08-19  3:19             ` page fault fastpath patch v2: fix race conditions, stats for 8,32 and 512 cpu SMP Rajesh Venkatasubramanian
2004-08-19  3:31             ` William Lee Irwin III
2004-08-19  3:31               ` William Lee Irwin III
2004-08-19  3:41               ` William Lee Irwin III
2004-08-19  3:41                 ` William Lee Irwin III
2004-08-23 22:00           ` page fault fastpath patch v2: fix race conditions, stats for Christoph Lameter
2004-08-23 22:00             ` page fault fastpath patch v2: fix race conditions, stats for 8,32 and 512 cpu SMP Christoph Lameter
2004-08-23 23:25             ` page fault fastpath patch v2: fix race conditions, stats for Rajesh Venkatasubramanian
2004-08-23 23:25               ` page fault fastpath patch v2: fix race conditions, stats for 8,32 and 512 cpu SMP Rajesh Venkatasubramanian
2004-08-23 23:35               ` page fault fastpath patch v2: fix race conditions, stats for Christoph Lameter
2004-08-23 23:35                 ` page fault fastpath patch v2: fix race conditions, stats for 8,32 and 512 cpu SMP Christoph Lameter
     [not found] <fa.ofiojek.hkeujs@ifi.uio.no>
     [not found] ` <fa.o1kt2ua.1bm6n0c@ifi.uio.no>
2004-08-18 20:13   ` Ray Bryant
2004-08-18 20:48     ` William Lee Irwin III
2004-08-18 20:48       ` William Lee Irwin III
2004-08-15 13:50 page fault fastpath: Increasing SMP scalability by introducing pte Christoph Lameter
2004-08-15 20:09 ` page fault fastpath: Increasing SMP scalability by introducing David S. Miller
2004-08-15 22:58   ` Christoph Lameter
2004-08-15 23:58     ` David S. Miller
2004-08-16  0:11       ` Christoph Lameter
2004-08-16  1:56         ` David S. Miller
2004-08-16  3:29           ` Christoph Lameter
2004-08-16 14:39             ` page fault fastpath: Increasing SMP scalability by introducing pte locks? William Lee Irwin III
2004-08-17 15:28               ` page fault fastpath patch v2: fix race conditions, stats for 8,32 and 512 cpu SMP Christoph Lameter
2004-08-17 15:37                 ` Christoph Hellwig
2004-08-17 15:37                   ` Christoph Hellwig
2004-08-17 15:51                 ` William Lee Irwin III
2004-08-17 15:51                   ` William Lee Irwin III
2004-08-18 17:55                 ` Hugh Dickins
2004-08-18 20:20                   ` William Lee Irwin III
2004-08-18 20:20                     ` William Lee Irwin III
2004-08-19  1:19                   ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040819002038.GW11200@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=ak@muc.de \
    --cc=benh@kernel.crashing.org \
    --cc=davem@redhat.com \
    --cc=hugh@veritas.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=raybry@sgi.com \
    --cc=vrajesh@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.