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-next>] [day] [month] [year] [list]
Date:	Sat, 21 Oct 2006 22:22:43 +1000
From:	Nigel Cunningham <ncunningham@...uxmail.org>
To:	Linux PM <linux-pm@...l.org>, LKML <linux-kernel@...r.kernel.org>,
	suspend2-devel <suspend2-devel@...ts.suspend2.net>
Subject: [PATCH] Quieten freezer if !CONFIG_PM_DEBUG.

The freezing of processes is currently very noisy. This patch makes the
noise dependant upon CONFIG_PM_DEBUG.

Prepared against current git.
    
Signed-off-by: Nigel Cunningham <nigel@...pend2.net>

diff --git a/kernel/power/process.c b/kernel/power/process.c
index 29be608..6829612 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -15,6 +15,12 @@ #include <linux/module.h>
 #include <linux/syscalls.h>
 #include <linux/freezer.h>
 
+#ifdef CONFIG_PM_DEBUG
+#define freezer_message(msg, a...) do { printk(msg, ##a); } while(0)
+#else
+#define freezer_message(msg, a...) do { } while(0)
+#endif
+
 /* 
  * Timeout for stopping processes
  */
@@ -40,7 +46,7 @@ void refrigerator(void)
 	long save;
 	save = current->state;
 	pr_debug("%s entered refrigerator\n", current->comm);
-	printk("=");
+	freezer_message("=");
 
 	frozen_process(current);
 	spin_lock_irq(&current->sighand->siglock);
@@ -87,7 +93,7 @@ int freeze_processes(void)
 	unsigned long start_time;
 	struct task_struct *g, *p;
 
-	printk( "Stopping tasks: " );
+	freezer_message( "Stopping tasks: " );
 	start_time = jiffies;
 	user_frozen = 0;
 	do {
@@ -135,7 +141,7 @@ int freeze_processes(void)
 	 * but it cleans up leftover PF_FREEZE requests.
 	 */
 	if (todo) {
-		printk( "\n" );
+		freezer_message( "\n" );
 		printk(KERN_ERR " stopping tasks timed out "
 			"after %d seconds (%d tasks remaining):\n",
 			TIMEOUT / HZ, todo);
@@ -149,7 +155,7 @@ int freeze_processes(void)
 		return todo;
 	}
 
-	printk( "|\n" );
+	freezer_message( "|\n" );
 	BUG_ON(in_atomic());
 	return 0;
 }
@@ -158,18 +164,18 @@ void thaw_processes(void)
 {
 	struct task_struct *g, *p;
 
-	printk( "Restarting tasks..." );
+	freezer_message( "Restarting tasks..." );
 	read_lock(&tasklist_lock);
 	do_each_thread(g, p) {
 		if (!freezeable(p))
 			continue;
 		if (!thaw_process(p))
-			printk(KERN_INFO " Strange, %s not stopped\n", p->comm );
+			freezer_message(KERN_INFO " Strange, %s not stopped\n", p->comm );
 	} while_each_thread(g, p);
 
 	read_unlock(&tasklist_lock);
 	schedule();
-	printk( " done\n" );
+	freezer_message( " done\n" );
 }
 
 EXPORT_SYMBOL(refrigerator);


-
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