linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch 21/57] mpol in copy_vma
@ 2004-05-22 22:06 akpm
  2004-05-23  4:55 ` Hugh Dickins
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2004-05-22 22:06 UTC (permalink / raw)
  To: torvalds; +Cc: linux-mm, akpm, hugh

From: Hugh Dickins <hugh@veritas.com>

I think Andi missed the copy_vma I recently added for mremap, and it'll
need something like below....  (Doesn't look like it'll optimize away when
it's not needed - rather bloaty.)


---

 25-akpm/mm/mmap.c |    7 +++++++
 1 files changed, 7 insertions(+)

diff -puN mm/mmap.c~mpol-in-copy_vma mm/mmap.c
--- 25/mm/mmap.c~mpol-in-copy_vma	2004-05-22 14:56:24.820318264 -0700
+++ 25-akpm/mm/mmap.c	2004-05-22 14:59:40.804524136 -0700
@@ -1504,6 +1504,7 @@ struct vm_area_struct *copy_vma(struct v
 	struct mm_struct *mm = vma->vm_mm;
 	struct vm_area_struct *new_vma, *prev;
 	struct rb_node **rb_link, *rb_parent;
+	struct mempolicy *pol;
 
 	find_vma_prepare(mm, addr, &prev, &rb_link, &rb_parent);
 	new_vma = vma_merge(mm, prev, rb_parent, addr, addr + len,
@@ -1519,6 +1520,12 @@ struct vm_area_struct *copy_vma(struct v
 		new_vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
 		if (new_vma) {
 			*new_vma = *vma;
+			pol = mpol_copy(vma_policy(vma));
+			if (IS_ERR(pol)) {
+				kmem_cache_free(vm_area_cachep, new_vma);
+				return NULL;
+			}
+			vma_set_policy(new_vma, pol);
 			INIT_LIST_HEAD(&new_vma->shared);
 			new_vma->vm_start = addr;
 			new_vma->vm_end = addr + len;

_
--
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:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 21/57] mpol in copy_vma
  2004-05-22 22:06 [patch 21/57] mpol in copy_vma akpm
@ 2004-05-23  4:55 ` Hugh Dickins
  0 siblings, 0 replies; 2+ messages in thread
From: Hugh Dickins @ 2004-05-23  4:55 UTC (permalink / raw)
  To: akpm; +Cc: ak, torvalds, linux-mm

On Sat, 22 May 2004 akpm@osdl.org wrote:
> 
> From: Hugh Dickins <hugh@veritas.com>
> 
> I think Andi missed the copy_vma I recently added for mremap, and it'll
> need something like below....  (Doesn't look like it'll optimize away when
> it's not needed - rather bloaty.)

It did optimize away - that comment slandered Andi's work - I apologize!

Hugh

--
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:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-23  4:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-22 22:06 [patch 21/57] mpol in copy_vma akpm
2004-05-23  4:55 ` Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox