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]
Message-Id: <20230719113001.2023703-4-shikemeng@huaweicloud.com>
Date:   Wed, 19 Jul 2023 19:30:00 +0800
From:   Kemeng Shi <shikemeng@...weicloud.com>
To:     akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Cc:     shikemeng@...weicloud.com
Subject: [PATCH 3/4] mm/compaction: use compact_unlock_should_abort in isolate_migratepages_block

Use compact_unlock_should_abort in isolate_migratepages_block to remove
repeat code.

Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
---
 mm/compaction.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 638146a49e89..c1dc821ac6e1 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -909,20 +909,10 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 		 * contention, to give chance to IRQs. Abort completely if
 		 * a fatal signal is pending.
 		 */
-		if (!(low_pfn % COMPACT_CLUSTER_MAX)) {
-			if (locked) {
-				spin_unlock_irqrestore(locked, flags);
-				locked = NULL;
-			}
-
-			if (fatal_signal_pending(current)) {
-				cc->contended = true;
-				ret = -EINTR;
-
-				goto fatal_pending;
-			}
-
-			cond_resched();
+		if (!(low_pfn % COMPACT_CLUSTER_MAX) &&
+		    compact_unlock_should_abort(&locked, flags, cc)) {
+			ret = -EINTR;
+			goto fatal_pending;
 		}
 
 		nr_scanned++;
-- 
2.30.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ