lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Sep 2007 20:49:39 +0100 (BST)
From:	Hugh Dickins <hugh@...itas.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	Hisashi Hifumi <hifumi.hisashi@....ntt.co.jp>,
	linux-kernel@...r.kernel.org
Subject: [PATCH mm 2/3] kill redundancy in rotate_reclaimable_page

a.k.a. mm-use-pagevec-to-rotate-reclaimable-page-cleanup.patch

diff -U5 shows rotate_reclaimable_page() is pointlessly testing
PageActive and PageLRU twice in a row: of course there used to be a
lock taken in between those tests; but now that pagevec_move_tail() is
making those tests under lock, there's no point to repeating them here.

Signed-off-by: Hugh Dickins <hugh@...itas.com>
---
 mm/swap.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

--- 2.6.23-rc8-mm2/mm/swap.c	2007-09-27 17:51:11.000000000 +0100
+++ linux/mm/swap.c	2007-09-27 17:51:33.000000000 +0100
@@ -158,18 +158,17 @@ int rotate_reclaimable_page(struct page 
 	if (PageActive(page))
 		return 1;
 	if (!PageLRU(page))
 		return 1;
 
-	if (PageLRU(page) && !PageActive(page)) {
-		page_cache_get(page);
-		local_irq_save(flags);
-		pvec = &__get_cpu_var(rotate_pvecs);
-		if (!pagevec_add(pvec, page))
-			pagevec_move_tail(pvec);
-		local_irq_restore(flags);
-	}
+	page_cache_get(page);
+	local_irq_save(flags);
+	pvec = &__get_cpu_var(lru_rotate_pvecs);
+	if (!pagevec_add(pvec, page))
+		pagevec_move_tail(pvec);
+	local_irq_restore(flags);
+
 	if (!test_clear_page_writeback(page))
 		BUG();
 
 	return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ