From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"minchan.kim@gmail.com" <minchan.kim@gmail.com>,
cl@linux-foundation.org,
"hugh.dickins" <hugh.dickins@tiscali.co.uk>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [RFC][PATCH 3/8] mm: Add vma sequence count
Date: Mon, 04 Jan 2010 19:24:32 +0100 [thread overview]
Message-ID: <20100104182813.390611101@chello.nl> (raw)
In-Reply-To: 20100104182429.833180340@chello.nl
[-- Attachment #1: mm-foo-5.patch --]
[-- Type: text/plain, Size: 1644 bytes --]
In order to detect VMA range changes, add a sequence count.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/mm_types.h | 2 ++
mm/mmap.c | 10 ++++++++++
2 files changed, 12 insertions(+)
Index: linux-2.6/include/linux/mm_types.h
===================================================================
--- linux-2.6.orig/include/linux/mm_types.h
+++ linux-2.6/include/linux/mm_types.h
@@ -12,6 +12,7 @@
#include <linux/completion.h>
#include <linux/cpumask.h>
#include <linux/page-debug-flags.h>
+#include <linux/seqlock.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -186,6 +187,7 @@ struct vm_area_struct {
#ifdef CONFIG_NUMA
struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif
+ seqcount_t vm_sequence;
};
struct core_thread {
Index: linux-2.6/mm/mmap.c
===================================================================
--- linux-2.6.orig/mm/mmap.c
+++ linux-2.6/mm/mmap.c
@@ -512,6 +512,10 @@ void vma_adjust(struct vm_area_struct *v
long adjust_next = 0;
int remove_next = 0;
+ write_seqcount_begin(&vma->vm_sequence);
+ if (next)
+ write_seqcount_begin(&next->vm_sequence);
+
if (next && !insert) {
if (end >= next->vm_end) {
/*
@@ -647,11 +651,17 @@ again: remove_next = 1 + (end > next->
* up the code too much to do both in one go.
*/
if (remove_next == 2) {
+ write_seqcount_end(&next->vm_sequence);
next = vma->vm_next;
+ write_seqcount_begin(&next->vm_sequence);
goto again;
}
}
+ if (next)
+ write_seqcount_end(&next->vm_sequence);
+ write_seqcount_end(&vma->vm_sequence);
+
validate_mm(mm);
}
--
WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"minchan.kim@gmail.com" <minchan.kim@gmail.com>,
cl@linux-foundation.org,
"hugh.dickins" <hugh.dickins@tiscali.co.uk>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [RFC][PATCH 3/8] mm: Add vma sequence count
Date: Mon, 04 Jan 2010 19:24:32 +0100 [thread overview]
Message-ID: <20100104182813.390611101@chello.nl> (raw)
In-Reply-To: 20100104182429.833180340@chello.nl
[-- Attachment #1: mm-foo-5.patch --]
[-- Type: text/plain, Size: 1869 bytes --]
In order to detect VMA range changes, add a sequence count.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/mm_types.h | 2 ++
mm/mmap.c | 10 ++++++++++
2 files changed, 12 insertions(+)
Index: linux-2.6/include/linux/mm_types.h
===================================================================
--- linux-2.6.orig/include/linux/mm_types.h
+++ linux-2.6/include/linux/mm_types.h
@@ -12,6 +12,7 @@
#include <linux/completion.h>
#include <linux/cpumask.h>
#include <linux/page-debug-flags.h>
+#include <linux/seqlock.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -186,6 +187,7 @@ struct vm_area_struct {
#ifdef CONFIG_NUMA
struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif
+ seqcount_t vm_sequence;
};
struct core_thread {
Index: linux-2.6/mm/mmap.c
===================================================================
--- linux-2.6.orig/mm/mmap.c
+++ linux-2.6/mm/mmap.c
@@ -512,6 +512,10 @@ void vma_adjust(struct vm_area_struct *v
long adjust_next = 0;
int remove_next = 0;
+ write_seqcount_begin(&vma->vm_sequence);
+ if (next)
+ write_seqcount_begin(&next->vm_sequence);
+
if (next && !insert) {
if (end >= next->vm_end) {
/*
@@ -647,11 +651,17 @@ again: remove_next = 1 + (end > next->
* up the code too much to do both in one go.
*/
if (remove_next == 2) {
+ write_seqcount_end(&next->vm_sequence);
next = vma->vm_next;
+ write_seqcount_begin(&next->vm_sequence);
goto again;
}
}
+ if (next)
+ write_seqcount_end(&next->vm_sequence);
+ write_seqcount_end(&vma->vm_sequence);
+
validate_mm(mm);
}
--
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-01-04 20:50 UTC|newest]
Thread overview: 239+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-04 18:24 [RFC][PATCH 0/8] Speculative pagefault -v3 Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra
2010-01-04 18:24 ` [RFC][PATCH 1/8] mm: Remove pte reference from fault path Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra
2010-01-04 18:24 ` [RFC][PATCH 2/8] mm: Speculative pagefault infrastructure Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra [this message]
2010-01-04 18:24 ` [RFC][PATCH 3/8] mm: Add vma sequence count Peter Zijlstra
2010-01-04 18:24 ` [RFC][PATCH 4/8] mm: RCU free vmas Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra
2010-01-05 2:43 ` Paul E. McKenney
2010-01-05 2:43 ` Paul E. McKenney
2010-01-05 8:28 ` Peter Zijlstra
2010-01-05 8:28 ` Peter Zijlstra
2010-01-05 16:05 ` Paul E. McKenney
2010-01-05 16:05 ` Paul E. McKenney
2010-01-04 18:24 ` [RFC][PATCH 5/8] mm: Speculative pte_map_lock() Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra
2010-01-04 18:24 ` [RFC][PATCH 6/8] mm: handle_speculative_fault() Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra
2010-01-05 0:25 ` KAMEZAWA Hiroyuki
2010-01-05 0:25 ` KAMEZAWA Hiroyuki
2010-01-05 3:13 ` Linus Torvalds
2010-01-05 3:13 ` Linus Torvalds
2010-01-05 8:17 ` Peter Zijlstra
2010-01-05 8:17 ` Peter Zijlstra
2010-01-05 8:57 ` Peter Zijlstra
2010-01-05 8:57 ` Peter Zijlstra
2010-01-05 15:34 ` Linus Torvalds
2010-01-05 15:34 ` Linus Torvalds
2010-01-05 15:40 ` Al Viro
2010-01-05 15:40 ` Al Viro
2010-01-05 16:10 ` Linus Torvalds
2010-01-05 16:10 ` Linus Torvalds
2010-01-06 15:41 ` Peter Zijlstra
2010-01-06 15:41 ` Peter Zijlstra
2010-01-05 9:37 ` Peter Zijlstra
2010-01-05 9:37 ` Peter Zijlstra
2010-01-05 23:35 ` Linus Torvalds
2010-01-05 23:35 ` Linus Torvalds
2010-01-05 4:29 ` Minchan Kim
2010-01-05 4:29 ` Minchan Kim
2010-01-05 4:43 ` KAMEZAWA Hiroyuki
2010-01-05 4:43 ` KAMEZAWA Hiroyuki
2010-01-05 5:10 ` Linus Torvalds
2010-01-05 5:10 ` Linus Torvalds
2010-01-05 5:30 ` KAMEZAWA Hiroyuki
2010-01-05 5:30 ` KAMEZAWA Hiroyuki
2010-01-05 7:39 ` KAMEZAWA Hiroyuki
2010-01-05 15:26 ` Linus Torvalds
2010-01-05 15:26 ` Linus Torvalds
2010-01-05 16:14 ` Linus Torvalds
2010-01-05 16:14 ` Linus Torvalds
2010-01-05 17:25 ` Andi Kleen
2010-01-05 17:25 ` Andi Kleen
2010-01-05 17:47 ` Christoph Lameter
2010-01-05 17:47 ` Christoph Lameter
2010-01-05 18:00 ` Andi Kleen
2010-01-05 18:00 ` Andi Kleen
2010-01-05 17:55 ` Linus Torvalds
2010-01-05 17:55 ` Linus Torvalds
2010-01-05 18:13 ` Christoph Lameter
2010-01-05 18:13 ` Christoph Lameter
2010-01-05 18:25 ` Linus Torvalds
2010-01-05 18:25 ` Linus Torvalds
2010-01-05 18:46 ` Christoph Lameter
2010-01-05 18:46 ` Christoph Lameter
2010-01-05 18:56 ` Linus Torvalds
2010-01-05 18:56 ` Linus Torvalds
2010-01-05 19:15 ` Christoph Lameter
2010-01-05 19:15 ` Christoph Lameter
2010-01-05 19:28 ` Linus Torvalds
2010-01-05 19:28 ` Linus Torvalds
2010-01-05 18:55 ` Paul E. McKenney
2010-01-05 18:55 ` Paul E. McKenney
2010-01-05 19:08 ` Linus Torvalds
2010-01-05 19:08 ` Linus Torvalds
2010-01-05 19:23 ` Paul E. McKenney
2010-01-05 19:23 ` Paul E. McKenney
2010-01-05 20:29 ` Peter Zijlstra
2010-01-05 20:29 ` Peter Zijlstra
2010-01-05 20:46 ` Linus Torvalds
2010-01-05 20:46 ` Linus Torvalds
2010-01-05 21:00 ` Linus Torvalds
2010-01-05 21:00 ` Linus Torvalds
2010-01-05 23:29 ` Paul E. McKenney
2010-01-05 23:29 ` Paul E. McKenney
2010-01-06 0:22 ` KAMEZAWA Hiroyuki
2010-01-06 0:22 ` KAMEZAWA Hiroyuki
2010-01-06 1:37 ` Linus Torvalds
2010-01-06 1:37 ` Linus Torvalds
2010-01-06 2:52 ` KAMEZAWA Hiroyuki
2010-01-06 2:52 ` KAMEZAWA Hiroyuki
2010-01-06 3:27 ` Linus Torvalds
2010-01-06 3:27 ` Linus Torvalds
2010-01-06 3:56 ` KAMEZAWA Hiroyuki
2010-01-06 3:56 ` KAMEZAWA Hiroyuki
2010-01-06 4:20 ` Linus Torvalds
2010-01-06 4:20 ` Linus Torvalds
2010-01-06 7:06 ` KAMEZAWA Hiroyuki
2010-01-06 7:49 ` Minchan Kim
2010-01-06 7:49 ` Minchan Kim
2010-01-06 9:39 ` Linus Torvalds
2010-01-06 9:39 ` Linus Torvalds
2010-01-07 1:00 ` KAMEZAWA Hiroyuki
2010-01-07 1:00 ` KAMEZAWA Hiroyuki
2010-01-08 16:53 ` Peter Zijlstra
2010-01-08 16:53 ` Peter Zijlstra
2010-01-08 17:22 ` Linus Torvalds
2010-01-08 17:22 ` Linus Torvalds
2010-01-08 17:43 ` Christoph Lameter
2010-01-08 17:43 ` Christoph Lameter
2010-01-08 17:52 ` Linus Torvalds
2010-01-08 17:52 ` Linus Torvalds
2010-01-08 18:33 ` Christoph Lameter
2010-01-08 18:33 ` Christoph Lameter
2010-01-08 18:46 ` Andi Kleen
2010-01-08 18:46 ` Andi Kleen
2010-01-08 18:56 ` Christoph Lameter
2010-01-08 18:56 ` Christoph Lameter
2010-01-08 19:10 ` Andi Kleen
2010-01-08 19:10 ` Andi Kleen
2010-01-08 19:11 ` Linus Torvalds
2010-01-08 19:11 ` Linus Torvalds
2010-01-08 19:28 ` Andi Kleen
2010-01-08 19:28 ` Andi Kleen
2010-01-08 19:39 ` Linus Torvalds
2010-01-08 19:39 ` Linus Torvalds
2010-01-08 19:42 ` Linus Torvalds
2010-01-08 19:42 ` Linus Torvalds
2010-01-08 21:36 ` Linus Torvalds
2010-01-08 21:36 ` Linus Torvalds
2010-01-08 21:46 ` Christoph Lameter
2010-01-08 21:46 ` Christoph Lameter
2010-01-08 22:43 ` Linus Torvalds
2010-01-08 22:43 ` Linus Torvalds
2010-01-08 22:43 ` Linus Torvalds
2010-01-09 14:47 ` Ed Tomlinson
2010-01-09 14:47 ` Ed Tomlinson
2010-01-10 5:27 ` Nitin Gupta
2010-01-10 5:27 ` Nitin Gupta
2010-01-05 15:14 ` Christoph Lameter
2010-01-05 15:14 ` Christoph Lameter
2010-01-05 8:18 ` Peter Zijlstra
2010-01-05 8:18 ` Peter Zijlstra
2010-01-05 6:00 ` Minchan Kim
2010-01-05 6:00 ` Minchan Kim
2010-01-05 4:48 ` Linus Torvalds
2010-01-05 4:48 ` Linus Torvalds
2010-01-05 6:09 ` Minchan Kim
2010-01-05 6:09 ` Minchan Kim
2010-01-05 6:09 ` KAMEZAWA Hiroyuki
2010-01-05 6:09 ` KAMEZAWA Hiroyuki
2010-01-05 6:24 ` Minchan Kim
2010-01-05 6:24 ` Minchan Kim
2010-01-05 8:35 ` Peter Zijlstra
2010-01-05 8:35 ` Peter Zijlstra
2010-01-05 13:45 ` Arjan van de Ven
2010-01-05 13:45 ` Arjan van de Ven
2010-01-05 14:15 ` Andi Kleen
2010-01-05 14:15 ` Andi Kleen
2010-01-05 15:17 ` Christoph Lameter
2010-01-05 15:17 ` Christoph Lameter
2010-01-06 3:22 ` Arjan van de Ven
2010-01-06 3:22 ` Arjan van de Ven
2010-01-07 16:11 ` Christoph Lameter
2010-01-07 16:11 ` Christoph Lameter
2010-01-07 16:19 ` Linus Torvalds
2010-01-07 16:19 ` Linus Torvalds
2010-01-07 16:31 ` Linus Torvalds
2010-01-07 16:31 ` Linus Torvalds
2010-01-07 16:34 ` Paul E. McKenney
2010-01-07 16:34 ` Paul E. McKenney
2010-01-07 16:36 ` Christoph Lameter
2010-01-07 16:36 ` Christoph Lameter
2010-01-08 4:49 ` Arjan van de Ven
2010-01-08 4:49 ` Arjan van de Ven
2010-01-08 5:00 ` Linus Torvalds
2010-01-08 5:00 ` Linus Torvalds
2010-01-08 15:51 ` Christoph Lameter
2010-01-08 15:51 ` Christoph Lameter
2010-01-09 15:55 ` Arjan van de Ven
2010-01-09 15:55 ` Arjan van de Ven
2010-01-07 17:22 ` Peter Zijlstra
2010-01-07 17:22 ` Peter Zijlstra
2010-01-07 17:36 ` Linus Torvalds
2010-01-07 17:36 ` Linus Torvalds
2010-01-07 17:49 ` Linus Torvalds
2010-01-07 17:49 ` Linus Torvalds
2010-01-07 18:00 ` Peter Zijlstra
2010-01-07 18:00 ` Peter Zijlstra
2010-01-07 18:15 ` Linus Torvalds
2010-01-07 18:15 ` Linus Torvalds
2010-01-07 21:49 ` Peter Zijlstra
2010-01-07 21:49 ` Peter Zijlstra
2010-01-07 18:44 ` Linus Torvalds
2010-01-07 18:44 ` Linus Torvalds
2010-01-07 19:20 ` Paul E. McKenney
2010-01-07 19:20 ` Paul E. McKenney
2010-01-07 20:06 ` Linus Torvalds
2010-01-07 20:06 ` Linus Torvalds
2010-01-07 20:25 ` Paul E. McKenney
2010-01-07 20:25 ` Paul E. McKenney
2010-01-07 19:24 ` Christoph Lameter
2010-01-07 19:24 ` Christoph Lameter
2010-01-07 20:08 ` Linus Torvalds
2010-01-07 20:08 ` Linus Torvalds
2010-01-07 20:13 ` Linus Torvalds
2010-01-07 20:13 ` Linus Torvalds
2010-01-07 21:44 ` Peter Zijlstra
2010-01-07 21:44 ` Peter Zijlstra
2010-01-07 22:33 ` Linus Torvalds
2010-01-07 22:33 ` Linus Torvalds
2010-01-08 0:23 ` KAMEZAWA Hiroyuki
2010-01-08 0:23 ` KAMEZAWA Hiroyuki
2010-01-08 0:25 ` KAMEZAWA Hiroyuki
2010-01-08 0:25 ` KAMEZAWA Hiroyuki
2010-01-08 0:39 ` Linus Torvalds
2010-01-08 0:39 ` Linus Torvalds
2010-01-08 0:41 ` Linus Torvalds
2010-01-08 0:41 ` Linus Torvalds
2010-01-07 23:51 ` Rik van Riel
2010-01-07 23:51 ` Rik van Riel
2010-01-04 18:24 ` [RFC][PATCH 7/8] mm,x86: speculative pagefault support Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra
2010-01-04 18:24 ` [RFC][PATCH 8/8] mm: Optimize pte_map_lock() Peter Zijlstra
2010-01-04 18:24 ` Peter Zijlstra
2010-01-04 21:41 ` [RFC][PATCH 0/8] Speculative pagefault -v3 Rik van Riel
2010-01-04 21:41 ` Rik van Riel
2010-01-04 21:46 ` Peter Zijlstra
2010-01-04 21:46 ` Peter Zijlstra
2010-01-04 23:20 ` Rik van Riel
2010-01-04 23:20 ` Rik van Riel
2010-01-04 21:59 ` Christoph Lameter
2010-01-04 21:59 ` Christoph Lameter
2010-01-05 0:28 ` KAMEZAWA Hiroyuki
2010-01-05 0:28 ` KAMEZAWA Hiroyuki
2010-01-05 2:26 ` Minchan Kim
2010-01-05 2:26 ` Minchan Kim
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=20100104182813.390611101@chello.nl \
--to=a.p.zijlstra@chello.nl \
--cc=cl@linux-foundation.org \
--cc=hugh.dickins@tiscali.co.uk \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
/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.