From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 622AD25F784; Thu, 7 Aug 2025 12:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754568912; cv=none; b=aM0MsWkxUMUo0QxEox5afFV3Gp3PY/8wO2a9SXYreQvQM62PilLMIG/65eDcTUClBBZmQiqVO5a6Uxg++LnXvPmS709OvgCf2UL0o7n9X5q24DlnHIJtcrMTjv8QZE8F/yRwdZMBQ83BK58ecJ8nSy+bBdPuSO0a/OB9QyX9xO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754568912; c=relaxed/simple; bh=sFimRWDFPtU0UMdeq9hQYUbd5AEv8F8fdClIH6UHJcg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AcmWORtAJqihJW2pAhV0Y4P2tiEwAyVPw8YuI5DJWX6GwBHAT4CTWpXDQUpw72TNHjbHft+NjAcVp5Pl4zJXpfv0QXkChB+ZUnAxA4iWLrgc9lWrlyNuJiiJP5+d9jH8aQVKlzC5hZn95nZuniIx/AUH5OoJNuckjR/9sxAOlPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 26cd0758738811f0b29709d653e92f7d-20250807 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:646277c4-9eba-4eb9-97cc-c44329b1bfc5,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6493067,CLOUDID:9863bd1b1b17eaa9329cc40525016c7a,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:nil,Content:0|50,EDM:-3,IP: nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,L ES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 26cd0758738811f0b29709d653e92f7d-20250807 Received: from mail.kylinos.cn [(10.44.16.175)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1728304931; Thu, 07 Aug 2025 20:15:05 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id DDDB5E01A758; Thu, 7 Aug 2025 20:15:04 +0800 (CST) X-ns-mid: postfix-689498C8-67532670 Received: from localhost.localdomain (unknown [172.25.120.24]) by mail.kylinos.cn (NSMail) with ESMTPA id 76606E0000B0; Thu, 7 Aug 2025 20:15:01 +0800 (CST) From: Zihuan Zhang To: "Rafael J . Wysocki" , Peter Zijlstra , Oleg Nesterov , David Hildenbrand , Michal Hocko , Jonathan Corbet Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , len brown , pavel machek , Kees Cook , Andrew Morton , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Catalin Marinas , Nico Pache , xu xin , wangfushuai , Andrii Nakryiko , Christian Brauner , Thomas Gleixner , Jeff Layton , Al Viro , Adrian Ratiu , linux-pm@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Zihuan Zhang Subject: [RFC PATCH v1 7/9] freezer: raise freeze priority of tasks failed to freeze last time Date: Thu, 7 Aug 2025 20:14:16 +0800 Message-Id: <20250807121418.139765-8-zhangzihuan@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250807121418.139765-1-zhangzihuan@kylinos.cn> References: <20250807121418.139765-1-zhangzihuan@kylinos.cn> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable If there are tasks that fail to freeze in the current suspend attempt, we raise their freeze priority for the next attempt. This change ensures that such tasks are frozen earlier in the next round, helping to reduce retry counts and avoid persistent D-state tasks due to dependency misordering. Signed-off-by: Zihuan Zhang --- kernel/power/process.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/power/process.c b/kernel/power/process.c index 21bbca7040cf..9d3cbde905b9 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -111,8 +111,10 @@ static int try_to_freeze_tasks(bool user_only) if (!wakeup || pm_debug_messages_on) { read_lock(&tasklist_lock); for_each_process_thread(g, p) { - if (p !=3D current && freezing(p) && !frozen(p)) + if (p !=3D current && freezing(p) && !frozen(p)) { + freeze_set_default_priority(p, FREEZE_PRIORITY_HIGH); sched_show_task(p); + } } read_unlock(&tasklist_lock); } --=20 2.25.1