Skip to contentSkip to conversation

rmap : simplify the code for try_to_unmap_file

PATCH In review Huang Shijie 2 participants 3 messages Oct 20, 2009 – Oct 29, 2009

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

PATCH 1/1 rmap : simplify the code for try_to_unmap_file

Just simplify the code when the mlocked is true.

---
 mm/rmap.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
mm/rmap.c +1 -4
index dd43373..c57c3b6 100644
@@ -1100,13 +1100,10 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
 		if (ret == SWAP_MLOCK) {
 			mlocked = try_to_mlock_page(page, vma);
 			if (mlocked)
-				break;  /* stop if actually mlocked page */
+				goto out;  /* stop if actually mlocked page */
 		}
 	}
 
-	if (mlocked)
-		goto out;
-
 	if (list_empty(&mapping->i_mmap_nonlinear))
 		goto out;
 
Signature · 7 lines
1.6.0.6

--
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>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines

Just simplify the code when the mlocked is true.

---
 mm/rmap.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
mm/rmap.c +0 -0
index dd43373..c57c3b6 100644
@@ -1100,13 +1100,10 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
 		if (ret == SWAP_MLOCK) {
 			mlocked = try_to_mlock_page(page, vma);
 			if (mlocked)

mm/rmap.c static int try_to_unmap_file(struct page *page, enum ttu_flags flags) · line 1108

Quoted 10 lines
mm/rmap.c +1 -4
-				break;  /* stop if actually mlocked page */
+				goto out;  /* stop if actually mlocked page */
 		}
 	}
 
-	if (mlocked)
-		goto out;
-
 	if (list_empty(&mapping->i_mmap_nonlinear))
 		goto out;

Did anyone reviewed this patch?
Anyway,

Huang, I'm sorry for the delaying. I was attend to JLS and I couldn't review long time.

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

#2 lore raw
Quoted 29 lines · KOSAKI Motohiro
Quoted 16 lines

Just simplify the code when the mlocked is true.

---
 mm/rmap.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
mm/rmap.c +0 -1
index dd43373..c57c3b6 100644
@@ -1100,13 +1100,10 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
 		if (ret == SWAP_MLOCK) {
 			mlocked = try_to_mlock_page(page, vma);
 			if (mlocked)
-				break;  /* stop if actually mlocked page */

mm/rmap.c static int try_to_unmap_file(struct page *page, enum ttu_flags flags) · line 1109

Quoted 10 lines
mm/rmap.c +1 -3
+				goto out;  /* stop if actually mlocked page */
 		}
 	}
 
-	if (mlocked)
-		goto out;
-
 	if (list_empty(&mapping->i_mmap_nonlinear))
 		goto out;
 

Did anyone reviewed this patch?
Anyway,

Quoted 3 lines

thanks :)

Quoted 5 lines

Huang, I'm sorry for the delaying. I was attend to JLS and I couldn't review long time.

Not at all.I forgeted the JLS when I sent the two tiny patchs.

Quoted 2 lines

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