All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/khugepaged: Add missed tracepoint for collapse_huge_page_swapin
@ 2017-05-07 10:18 ` SeongJae Park
  0 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2017-05-07 10:18 UTC (permalink / raw)
  To: akpm, kirill.shutemov; +Cc: hannes, linux-mm, linux-kernel, SeongJae Park

One return case of `__collapse_huge_page_swapin()` does not invoke
tracepoint while every other return case does.  This commit adds a
tracepoint invocation for the case.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 mm/khugepaged.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index ba40b7f673f4..9aad377c67a8 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -909,8 +909,10 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm,
 				return false;
 			}
 			/* check if the pmd is still valid */
-			if (mm_find_pmd(mm, address) != pmd)
+			if (mm_find_pmd(mm, address) != pmd) {
+				trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
 				return false;
+			}
 		}
 		if (ret & VM_FAULT_ERROR) {
 			trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
-- 
2.12.0

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

* [PATCH] mm/khugepaged: Add missed tracepoint for collapse_huge_page_swapin
@ 2017-05-07 10:18 ` SeongJae Park
  0 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2017-05-07 10:18 UTC (permalink / raw)
  To: akpm, kirill.shutemov; +Cc: hannes, linux-mm, linux-kernel, SeongJae Park

One return case of `__collapse_huge_page_swapin()` does not invoke
tracepoint while every other return case does.  This commit adds a
tracepoint invocation for the case.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 mm/khugepaged.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index ba40b7f673f4..9aad377c67a8 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -909,8 +909,10 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm,
 				return false;
 			}
 			/* check if the pmd is still valid */
-			if (mm_find_pmd(mm, address) != pmd)
+			if (mm_find_pmd(mm, address) != pmd) {
+				trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
 				return false;
+			}
 		}
 		if (ret & VM_FAULT_ERROR) {
 			trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
-- 
2.12.0

--
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] mm/khugepaged: Add missed tracepoint for collapse_huge_page_swapin
  2017-05-07 10:18 ` SeongJae Park
@ 2017-05-10 13:09   ` Vlastimil Babka
  -1 siblings, 0 replies; 4+ messages in thread
From: Vlastimil Babka @ 2017-05-10 13:09 UTC (permalink / raw)
  To: SeongJae Park, akpm, kirill.shutemov; +Cc: hannes, linux-mm, linux-kernel

On 05/07/2017 12:18 PM, SeongJae Park wrote:
> One return case of `__collapse_huge_page_swapin()` does not invoke
> tracepoint while every other return case does.  This commit adds a
> tracepoint invocation for the case.
> 
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>

Right. But extra points by turning all of the "trace+return false"
instances into some kind of "goto out".

> ---
>  mm/khugepaged.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index ba40b7f673f4..9aad377c67a8 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -909,8 +909,10 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm,
>  				return false;
>  			}
>  			/* check if the pmd is still valid */
> -			if (mm_find_pmd(mm, address) != pmd)
> +			if (mm_find_pmd(mm, address) != pmd) {
> +				trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
>  				return false;
> +			}
>  		}
>  		if (ret & VM_FAULT_ERROR) {
>  			trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
> 

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

* Re: [PATCH] mm/khugepaged: Add missed tracepoint for collapse_huge_page_swapin
@ 2017-05-10 13:09   ` Vlastimil Babka
  0 siblings, 0 replies; 4+ messages in thread
From: Vlastimil Babka @ 2017-05-10 13:09 UTC (permalink / raw)
  To: SeongJae Park, akpm, kirill.shutemov; +Cc: hannes, linux-mm, linux-kernel

On 05/07/2017 12:18 PM, SeongJae Park wrote:
> One return case of `__collapse_huge_page_swapin()` does not invoke
> tracepoint while every other return case does.  This commit adds a
> tracepoint invocation for the case.
> 
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>

Right. But extra points by turning all of the "trace+return false"
instances into some kind of "goto out".

> ---
>  mm/khugepaged.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index ba40b7f673f4..9aad377c67a8 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -909,8 +909,10 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm,
>  				return false;
>  			}
>  			/* check if the pmd is still valid */
> -			if (mm_find_pmd(mm, address) != pmd)
> +			if (mm_find_pmd(mm, address) != pmd) {
> +				trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
>  				return false;
> +			}
>  		}
>  		if (ret & VM_FAULT_ERROR) {
>  			trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
> 

--
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:[~2017-05-10 13:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-07 10:18 [PATCH] mm/khugepaged: Add missed tracepoint for collapse_huge_page_swapin SeongJae Park
2017-05-07 10:18 ` SeongJae Park
2017-05-10 13:09 ` Vlastimil Babka
2017-05-10 13:09   ` Vlastimil Babka

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.