* PATCH 1/2] rmap: cleanup anon_vma_prepare
@ 2012-03-07 12:10 Xiao Guangrong
2012-03-07 12:11 ` [PATCH 2/2] rmap: remove __anon_vma_link Xiao Guangrong
2012-03-07 12:13 ` PATCH 1/2] rmap: cleanup anon_vma_prepare Xiao Guangrong
0 siblings, 2 replies; 5+ messages in thread
From: Xiao Guangrong @ 2012-03-07 12:10 UTC (permalink / raw)
To: Andrew Morton; +Cc: Hugh Dickins, linux-mm, LKML
Using the common function anon_vma_chain_link() to link vma and anon_vma
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
---
mm/rmap.c | 35 ++++++++++++++++-------------------
1 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/mm/rmap.c b/mm/rmap.c
index c8454e0..55c5064 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -120,6 +120,21 @@ static void anon_vma_chain_free(struct anon_vma_chain *anon_vma_chain)
kmem_cache_free(anon_vma_chain_cachep, anon_vma_chain);
}
+static void anon_vma_chain_link(struct vm_area_struct *vma,
+ struct anon_vma_chain *avc,
+ struct anon_vma *anon_vma)
+{
+ avc->vma = vma;
+ avc->anon_vma = anon_vma;
+ list_add(&avc->same_vma, &vma->anon_vma_chain);
+
+ /*
+ * It's critical to add new vmas to the tail of the anon_vma,
+ * see comment in huge_memory.c:__split_huge_page().
+ */
+ list_add_tail(&avc->same_anon_vma, &anon_vma->head);
+}
+
/**
* anon_vma_prepare - attach an anon_vma to a memory region
* @vma: the memory region in question
@@ -175,10 +190,7 @@ int anon_vma_prepare(struct vm_area_struct *vma)
spin_lock(&mm->page_table_lock);
if (likely(!vma->anon_vma)) {
vma->anon_vma = anon_vma;
- avc->anon_vma = anon_vma;
- avc->vma = vma;
- list_add(&avc->same_vma, &vma->anon_vma_chain);
- list_add_tail(&avc->same_anon_vma, &anon_vma->head);
+ anon_vma_chain_link(vma, avc, anon_vma);
allocated = NULL;
avc = NULL;
}
@@ -224,21 +236,6 @@ static inline void unlock_anon_vma_root(struct anon_vma *root)
mutex_unlock(&root->mutex);
}
-static void anon_vma_chain_link(struct vm_area_struct *vma,
- struct anon_vma_chain *avc,
- struct anon_vma *anon_vma)
-{
- avc->vma = vma;
- avc->anon_vma = anon_vma;
- list_add(&avc->same_vma, &vma->anon_vma_chain);
-
- /*
- * It's critical to add new vmas to the tail of the anon_vma,
- * see comment in huge_memory.c:__split_huge_page().
- */
- list_add_tail(&avc->same_anon_vma, &anon_vma->head);
-}
-
/*
* Attach the anon_vmas from src to dst.
* Returns 0 on success, -ENOMEM on failure.
--
1.7.7.6
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/2] rmap: remove __anon_vma_link
2012-03-07 12:10 PATCH 1/2] rmap: cleanup anon_vma_prepare Xiao Guangrong
@ 2012-03-07 12:11 ` Xiao Guangrong
2012-03-07 22:21 ` David Rientjes
2012-03-07 12:13 ` PATCH 1/2] rmap: cleanup anon_vma_prepare Xiao Guangrong
1 sibling, 1 reply; 5+ messages in thread
From: Xiao Guangrong @ 2012-03-07 12:11 UTC (permalink / raw)
To: Xiao Guangrong; +Cc: Andrew Morton, Hugh Dickins, linux-mm, LKML
This declaration is not used anymore, remove it
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
---
include/linux/rmap.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 1cdd62a..fd07c45 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -122,7 +122,6 @@ void unlink_anon_vmas(struct vm_area_struct *);
int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *);
void anon_vma_moveto_tail(struct vm_area_struct *);
int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *);
-void __anon_vma_link(struct vm_area_struct *);
static inline void anon_vma_merge(struct vm_area_struct *vma,
struct vm_area_struct *next)
--
1.7.7.6
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH 1/2] rmap: cleanup anon_vma_prepare
2012-03-07 12:10 PATCH 1/2] rmap: cleanup anon_vma_prepare Xiao Guangrong
2012-03-07 12:11 ` [PATCH 2/2] rmap: remove __anon_vma_link Xiao Guangrong
@ 2012-03-07 12:13 ` Xiao Guangrong
2012-03-07 22:21 ` David Rientjes
1 sibling, 1 reply; 5+ messages in thread
From: Xiao Guangrong @ 2012-03-07 12:13 UTC (permalink / raw)
To: Xiao Guangrong; +Cc: Andrew Morton, Hugh Dickins, linux-mm, LKML
Sorry for the title typo, repost it.
-------------------->
Subject: [PATCH 1/2] rmap: cleanup anon_vma_prepare
Using the common function anon_vma_chain_link() to link vma and anon_vma
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
---
mm/rmap.c | 35 ++++++++++++++++-------------------
1 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/mm/rmap.c b/mm/rmap.c
index c8454e0..55c5064 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -120,6 +120,21 @@ static void anon_vma_chain_free(struct anon_vma_chain *anon_vma_chain)
kmem_cache_free(anon_vma_chain_cachep, anon_vma_chain);
}
+static void anon_vma_chain_link(struct vm_area_struct *vma,
+ struct anon_vma_chain *avc,
+ struct anon_vma *anon_vma)
+{
+ avc->vma = vma;
+ avc->anon_vma = anon_vma;
+ list_add(&avc->same_vma, &vma->anon_vma_chain);
+
+ /*
+ * It's critical to add new vmas to the tail of the anon_vma,
+ * see comment in huge_memory.c:__split_huge_page().
+ */
+ list_add_tail(&avc->same_anon_vma, &anon_vma->head);
+}
+
/**
* anon_vma_prepare - attach an anon_vma to a memory region
* @vma: the memory region in question
@@ -175,10 +190,7 @@ int anon_vma_prepare(struct vm_area_struct *vma)
spin_lock(&mm->page_table_lock);
if (likely(!vma->anon_vma)) {
vma->anon_vma = anon_vma;
- avc->anon_vma = anon_vma;
- avc->vma = vma;
- list_add(&avc->same_vma, &vma->anon_vma_chain);
- list_add_tail(&avc->same_anon_vma, &anon_vma->head);
+ anon_vma_chain_link(vma, avc, anon_vma);
allocated = NULL;
avc = NULL;
}
@@ -224,21 +236,6 @@ static inline void unlock_anon_vma_root(struct anon_vma *root)
mutex_unlock(&root->mutex);
}
-static void anon_vma_chain_link(struct vm_area_struct *vma,
- struct anon_vma_chain *avc,
- struct anon_vma *anon_vma)
-{
- avc->vma = vma;
- avc->anon_vma = anon_vma;
- list_add(&avc->same_vma, &vma->anon_vma_chain);
-
- /*
- * It's critical to add new vmas to the tail of the anon_vma,
- * see comment in huge_memory.c:__split_huge_page().
- */
- list_add_tail(&avc->same_anon_vma, &anon_vma->head);
-}
-
/*
* Attach the anon_vmas from src to dst.
* Returns 0 on success, -ENOMEM on failure.
--
1.7.7.6
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: PATCH 1/2] rmap: cleanup anon_vma_prepare
2012-03-07 12:13 ` PATCH 1/2] rmap: cleanup anon_vma_prepare Xiao Guangrong
@ 2012-03-07 22:21 ` David Rientjes
0 siblings, 0 replies; 5+ messages in thread
From: David Rientjes @ 2012-03-07 22:21 UTC (permalink / raw)
To: Xiao Guangrong; +Cc: Andrew Morton, Hugh Dickins, linux-mm, LKML
On Wed, 7 Mar 2012, Xiao Guangrong wrote:
> Sorry for the title typo, repost it.
>
> -------------------->
> Subject: [PATCH 1/2] rmap: cleanup anon_vma_prepare
>
> Using the common function anon_vma_chain_link() to link vma and anon_vma
>
> Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-07 22:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-07 12:10 PATCH 1/2] rmap: cleanup anon_vma_prepare Xiao Guangrong
2012-03-07 12:11 ` [PATCH 2/2] rmap: remove __anon_vma_link Xiao Guangrong
2012-03-07 22:21 ` David Rientjes
2012-03-07 12:13 ` PATCH 1/2] rmap: cleanup anon_vma_prepare Xiao Guangrong
2012-03-07 22:21 ` David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox