Skip to contentSkip to conversation

mm/khugepaged: Add missed tracepoint for collapse_huge_page_swapin

PATCH Applied SeongJae Park 2 participants 2 messages May 7, 2017 – May 10, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/khugepaged: Add missed tracepoint for collapse_huge_page_swapin

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.

---
 mm/khugepaged.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/khugepaged.c +3 -1
index ba40b7f673f4..9aad377c67a8 100644
@@ -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);
Signature · 7 lines
2.12.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#1 lore raw
Quoted 5 lines · 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.

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

Quoted 11 lines
---
 mm/khugepaged.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/khugepaged.c +0 -0
index ba40b7f673f4..9aad377c67a8 100644
@@ -909,8 +909,10 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm,
 				return false;

mm/khugepaged.c static bool __collapse_huge_page_swapin(struct mm_struct *mm, · line 918

Quoted 10 lines
mm/khugepaged.c +3 -1
 			}
 			/* 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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>