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] [day] [month] [year] [list]
Date:	Wed, 12 Feb 2014 12:38:55 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Kirill Tkhai <ktkhai@...allels.com>
cc:	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] smpboot: Use preempt_enable_no_resched() before
 schedule()

On Wed, 12 Feb 2014, Kirill Tkhai wrote:

No, preempt_enable_no_resched() should just die. If you want to get
rid of the preempt_enable() / schedule() sequence just use
schedule_preempt_disabled(). See below.

Thanks,

	tglx


--- linux-2.6.orig/kernel/smpboot.c
+++ linux-2.6/kernel/smpboot.c
@@ -106,9 +106,9 @@ static int smpboot_thread_fn(void *data)
 	struct smpboot_thread_data *td = data;
 	struct smp_hotplug_thread *ht = td->ht;
 
+	preempt_disable();
 	while (1) {
 		set_current_state(TASK_INTERRUPTIBLE);
-		preempt_disable();
 		if (kthread_should_stop()) {
 			set_current_state(TASK_RUNNING);
 			preempt_enable();
@@ -128,6 +128,7 @@ static int smpboot_thread_fn(void *data)
 			}
 			kthread_parkme();
 			/* We might have been woken for stop */
+			preempt_disable();
 			continue;
 		}
 
@@ -152,12 +153,12 @@ static int smpboot_thread_fn(void *data)
 		}
 
 		if (!ht->thread_should_run(td->cpu)) {
-			preempt_enable();
-			schedule();
+			schedule_preempt_disabled();
 		} else {
 			set_current_state(TASK_RUNNING);
 			preempt_enable();
 			ht->thread_fn(td->cpu);
+			preempt_disable();
 		}
 	}
 }
--
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