linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: do_mincore() cleanup
@ 2013-12-05  8:52 Jianguo Wu
  2013-12-05 14:39 ` Naoya Horiguchi
  0 siblings, 1 reply; 3+ messages in thread
From: Jianguo Wu @ 2013-12-05  8:52 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Johannes Weiner, Minchan Kim, linux-mm, linux-kernel, qiuxishi

Two cleanups:
1. remove redundant codes for hugetlb pages.
2. end = pmd_addr_end(addr, end) restricts [addr, end) within PMD_SIZE,
   this may increase do_mincore() calls, remove it.

Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
---
 mm/mincore.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/mm/mincore.c b/mm/mincore.c
index da2be56..1016233 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -225,13 +225,6 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
 
 	end = min(vma->vm_end, addr + (pages << PAGE_SHIFT));
 
-	if (is_vm_hugetlb_page(vma)) {
-		mincore_hugetlb_page_range(vma, addr, end, vec);
-		return (end - addr) >> PAGE_SHIFT;
-	}
-
-	end = pmd_addr_end(addr, end);
-
 	if (is_vm_hugetlb_page(vma))
 		mincore_hugetlb_page_range(vma, addr, end, vec);
 	else
-- 
1.7.1


--
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] 3+ messages in thread

* Re: [PATCH] mm: do_mincore() cleanup
  2013-12-05  8:52 [PATCH] mm: do_mincore() cleanup Jianguo Wu
@ 2013-12-05 14:39 ` Naoya Horiguchi
  2013-12-06  1:19   ` Jianguo Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Naoya Horiguchi @ 2013-12-05 14:39 UTC (permalink / raw)
  To: Jianguo Wu
  Cc: Andrew Morton, Johannes Weiner, Minchan Kim, linux-mm,
	linux-kernel, qiuxishi

On Thu, Dec 05, 2013 at 04:52:52PM +0800, Jianguo Wu wrote:
> Two cleanups:
> 1. remove redundant codes for hugetlb pages.
> 2. end = pmd_addr_end(addr, end) restricts [addr, end) within PMD_SIZE,
>    this may increase do_mincore() calls, remove it.
> 
> Signed-off-by: Jianguo Wu <wujianguo@huawei.com>

Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

Thanks!

Naoya

> ---
>  mm/mincore.c |    7 -------
>  1 files changed, 0 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/mincore.c b/mm/mincore.c
> index da2be56..1016233 100644
> --- a/mm/mincore.c
> +++ b/mm/mincore.c
> @@ -225,13 +225,6 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
>  
>  	end = min(vma->vm_end, addr + (pages << PAGE_SHIFT));
>  
> -	if (is_vm_hugetlb_page(vma)) {
> -		mincore_hugetlb_page_range(vma, addr, end, vec);
> -		return (end - addr) >> PAGE_SHIFT;
> -	}
> -
> -	end = pmd_addr_end(addr, end);
> -
>  	if (is_vm_hugetlb_page(vma))
>  		mincore_hugetlb_page_range(vma, addr, end, vec);
>  	else
> -- 
> 1.7.1
> 
> 
> --
> 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>
> 

--
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] 3+ messages in thread

* Re: [PATCH] mm: do_mincore() cleanup
  2013-12-05 14:39 ` Naoya Horiguchi
@ 2013-12-06  1:19   ` Jianguo Wu
  0 siblings, 0 replies; 3+ messages in thread
From: Jianguo Wu @ 2013-12-06  1:19 UTC (permalink / raw)
  To: Naoya Horiguchi
  Cc: Andrew Morton, Johannes Weiner, Minchan Kim, linux-mm,
	linux-kernel, qiuxishi

On 2013/12/5 22:39, Naoya Horiguchi wrote:

> On Thu, Dec 05, 2013 at 04:52:52PM +0800, Jianguo Wu wrote:
>> Two cleanups:
>> 1. remove redundant codes for hugetlb pages.
>> 2. end = pmd_addr_end(addr, end) restricts [addr, end) within PMD_SIZE,
>>    this may increase do_mincore() calls, remove it.
>>
>> Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
> 
> Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

Hi Naoya, thanks for your review!

Jianguo Wu

> 
> Thanks!
> 
> Naoya
> 
>> ---
>>  mm/mincore.c |    7 -------
>>  1 files changed, 0 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/mincore.c b/mm/mincore.c
>> index da2be56..1016233 100644
>> --- a/mm/mincore.c
>> +++ b/mm/mincore.c
>> @@ -225,13 +225,6 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
>>  
>>  	end = min(vma->vm_end, addr + (pages << PAGE_SHIFT));
>>  
>> -	if (is_vm_hugetlb_page(vma)) {
>> -		mincore_hugetlb_page_range(vma, addr, end, vec);
>> -		return (end - addr) >> PAGE_SHIFT;
>> -	}
>> -
>> -	end = pmd_addr_end(addr, end);
>> -
>>  	if (is_vm_hugetlb_page(vma))
>>  		mincore_hugetlb_page_range(vma, addr, end, vec);
>>  	else
>> -- 
>> 1.7.1
>>
>>
>> --
>> 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>
>>
> 
> .
> 



--
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] 3+ messages in thread

end of thread, other threads:[~2013-12-06  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05  8:52 [PATCH] mm: do_mincore() cleanup Jianguo Wu
2013-12-05 14:39 ` Naoya Horiguchi
2013-12-06  1:19   ` Jianguo Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).