All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mmotm-2010-01-15-15-34] Fix wrong offset for vma merge in mbind
@ 2010-01-16 16:15 ` Minchan Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Minchan Kim @ 2010-01-16 16:15 UTC (permalink / raw)
  To: Andrew Morton
  Cc: KOSAKI Motohiro, Christoph Lameter, Hugh Dickins, LKML, linux-mm

mm-fix-mbind-vma-merge-problem.patch added vma_merge in mbind
to merge mergeable vmas.
But it passed wrong offset of vm_file.

This patch fixes it.

Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
---
 mm/mempolicy.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 9751f3f..7e529d0 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -570,6 +570,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
 	struct vm_area_struct *prev;
 	struct vm_area_struct *vma;
 	int err = 0;
+	pgoff_t pgoff;
 	unsigned long vmstart;
 	unsigned long vmend;
 
@@ -582,9 +583,9 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
 		vmstart = max(start, vma->vm_start);
 		vmend   = min(end, vma->vm_end);
 
+		pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT);
 		prev = vma_merge(mm, prev, vmstart, vmend, vma->vm_flags,
-				  vma->anon_vma, vma->vm_file, vma->vm_pgoff,
-				  new_pol);
+				  vma->anon_vma, vma->vm_file, pgoff, new_pol);
 		if (prev) {
 			vma = prev;
 			next = vma->vm_next;
-- 
1.6.3.3



-- 
Kind regards,
Minchan Kim


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

* [PATCH -mmotm-2010-01-15-15-34] Fix wrong offset for vma merge in mbind
@ 2010-01-16 16:15 ` Minchan Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Minchan Kim @ 2010-01-16 16:15 UTC (permalink / raw)
  To: Andrew Morton
  Cc: KOSAKI Motohiro, Christoph Lameter, Hugh Dickins, LKML, linux-mm

mm-fix-mbind-vma-merge-problem.patch added vma_merge in mbind
to merge mergeable vmas.
But it passed wrong offset of vm_file.

This patch fixes it.

Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
---
 mm/mempolicy.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 9751f3f..7e529d0 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -570,6 +570,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
 	struct vm_area_struct *prev;
 	struct vm_area_struct *vma;
 	int err = 0;
+	pgoff_t pgoff;
 	unsigned long vmstart;
 	unsigned long vmend;
 
@@ -582,9 +583,9 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
 		vmstart = max(start, vma->vm_start);
 		vmend   = min(end, vma->vm_end);
 
+		pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT);
 		prev = vma_merge(mm, prev, vmstart, vmend, vma->vm_flags,
-				  vma->anon_vma, vma->vm_file, vma->vm_pgoff,
-				  new_pol);
+				  vma->anon_vma, vma->vm_file, pgoff, new_pol);
 		if (prev) {
 			vma = prev;
 			next = vma->vm_next;
-- 
1.6.3.3



-- 
Kind regards,
Minchan Kim

--
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>

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

* Re: [PATCH -mmotm-2010-01-15-15-34] Fix wrong offset for vma merge in mbind
  2010-01-16 16:15 ` Minchan Kim
@ 2010-01-18  3:10   ` KOSAKI Motohiro
  -1 siblings, 0 replies; 4+ messages in thread
From: KOSAKI Motohiro @ 2010-01-18  3:10 UTC (permalink / raw)
  To: Minchan Kim
  Cc: kosaki.motohiro, Andrew Morton, Christoph Lameter, Hugh Dickins,
	LKML, linux-mm

> mm-fix-mbind-vma-merge-problem.patch added vma_merge in mbind
> to merge mergeable vmas.
> But it passed wrong offset of vm_file.
> 
> This patch fixes it.
> 
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>

Nice catch!
	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>


> ---
>  mm/mempolicy.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 9751f3f..7e529d0 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -570,6 +570,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
>  	struct vm_area_struct *prev;
>  	struct vm_area_struct *vma;
>  	int err = 0;
> +	pgoff_t pgoff;
>  	unsigned long vmstart;
>  	unsigned long vmend;
>  
> @@ -582,9 +583,9 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
>  		vmstart = max(start, vma->vm_start);
>  		vmend   = min(end, vma->vm_end);
>  
> +		pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT);
>  		prev = vma_merge(mm, prev, vmstart, vmend, vma->vm_flags,
> -				  vma->anon_vma, vma->vm_file, vma->vm_pgoff,
> -				  new_pol);
> +				  vma->anon_vma, vma->vm_file, pgoff, new_pol);
>  		if (prev) {
>  			vma = prev;
>  			next = vma->vm_next;
> -- 
> 1.6.3.3
> 
> 
> 
> -- 
> Kind regards,
> Minchan Kim
> 




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

* Re: [PATCH -mmotm-2010-01-15-15-34] Fix wrong offset for vma merge in mbind
@ 2010-01-18  3:10   ` KOSAKI Motohiro
  0 siblings, 0 replies; 4+ messages in thread
From: KOSAKI Motohiro @ 2010-01-18  3:10 UTC (permalink / raw)
  To: Minchan Kim
  Cc: kosaki.motohiro, Andrew Morton, Christoph Lameter, Hugh Dickins,
	LKML, linux-mm

> mm-fix-mbind-vma-merge-problem.patch added vma_merge in mbind
> to merge mergeable vmas.
> But it passed wrong offset of vm_file.
> 
> This patch fixes it.
> 
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>

Nice catch!
	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>


> ---
>  mm/mempolicy.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 9751f3f..7e529d0 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -570,6 +570,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
>  	struct vm_area_struct *prev;
>  	struct vm_area_struct *vma;
>  	int err = 0;
> +	pgoff_t pgoff;
>  	unsigned long vmstart;
>  	unsigned long vmend;
>  
> @@ -582,9 +583,9 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
>  		vmstart = max(start, vma->vm_start);
>  		vmend   = min(end, vma->vm_end);
>  
> +		pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT);
>  		prev = vma_merge(mm, prev, vmstart, vmend, vma->vm_flags,
> -				  vma->anon_vma, vma->vm_file, vma->vm_pgoff,
> -				  new_pol);
> +				  vma->anon_vma, vma->vm_file, pgoff, new_pol);
>  		if (prev) {
>  			vma = prev;
>  			next = vma->vm_next;
> -- 
> 1.6.3.3
> 
> 
> 
> -- 
> Kind regards,
> Minchan Kim
> 



--
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>

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

end of thread, other threads:[~2010-01-18  3:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-16 16:15 [PATCH -mmotm-2010-01-15-15-34] Fix wrong offset for vma merge in mbind Minchan Kim
2010-01-16 16:15 ` Minchan Kim
2010-01-18  3:10 ` KOSAKI Motohiro
2010-01-18  3:10   ` KOSAKI Motohiro

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.