Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1641196

[patch 12/18] async: Adjust system_state checks

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject [patch 12/18] async: Adjust system_state checks
Date 2017-05-14 20:50 +0200
Message-ID <tH6KC-5j9-21@gated-at.bofh.it> (permalink)
References <tH6AV-56V-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


To enable smp_processor_id() and might_sleep() debug checks earlier, it's
required to add system states between SYSTEM_BOOTING and SYSTEM_RUNNING.

Adjust the system_state check in async_run_entry_fn() and
async_synchronize_cookie_domain() to handle the extra states.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Arjan van de Ven <arjan@linux.intel.com>
---
 kernel/async.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/kernel/async.c
+++ b/kernel/async.c
@@ -114,14 +114,14 @@ static void async_run_entry_fn(struct wo
 	ktime_t uninitialized_var(calltime), delta, rettime;
 
 	/* 1) run (and print duration) */
-	if (initcall_debug && system_state == SYSTEM_BOOTING) {
+	if (initcall_debug && system_state < SYSTEM_RUNNING) {
 		pr_debug("calling  %lli_%pF @ %i\n",
 			(long long)entry->cookie,
 			entry->func, task_pid_nr(current));
 		calltime = ktime_get();
 	}
 	entry->func(entry->data, entry->cookie);
-	if (initcall_debug && system_state == SYSTEM_BOOTING) {
+	if (initcall_debug && system_state < SYSTEM_RUNNING) {
 		rettime = ktime_get();
 		delta = ktime_sub(rettime, calltime);
 		pr_debug("initcall %lli_%pF returned 0 after %lld usecs\n",
@@ -284,14 +284,14 @@ void async_synchronize_cookie_domain(asy
 {
 	ktime_t uninitialized_var(starttime), delta, endtime;
 
-	if (initcall_debug && system_state == SYSTEM_BOOTING) {
+	if (initcall_debug && system_state < SYSTEM_RUNNING) {
 		pr_debug("async_waiting @ %i\n", task_pid_nr(current));
 		starttime = ktime_get();
 	}
 
 	wait_event(async_done, lowest_in_progress(domain) >= cookie);
 
-	if (initcall_debug && system_state == SYSTEM_BOOTING) {
+	if (initcall_debug && system_state < SYSTEM_RUNNING) {
 		endtime = ktime_get();
 		delta = ktime_sub(endtime, starttime);
 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[patch 00/18] init: Enable might_sleep() and smp_processor_id()  debugging early Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
  [patch 09/18] cpufreq/pasemi: Adjust system_state check Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
    Re: [patch 09/18] cpufreq/pasemi: Adjust system_state check Viresh Kumar <viresh.kumar@linaro.org> - 2017-05-15 07:30 +0200
      Re: [patch 09/18] cpufreq/pasemi: Adjust system_state check Steven Rostedt <rostedt@goodmis.org> - 2017-05-15 16:40 +0200
  [patch 13/18] extable: Adjust system_state checks Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
    Re: [patch 13/18] extable: Adjust system_state checks Steven Rostedt <rostedt@goodmis.org> - 2017-05-15 16:40 +0200
  [patch 08/18] mm: Adjust system_state check Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
    Re: [patch 08/18] mm: Adjust system_state check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-15 08:20 +0200
      Re: [patch 08/18] mm: Adjust system_state check Steven Rostedt <rostedt@goodmis.org> - 2017-05-15 16:40 +0200
  [patch 01/18] init: Pin init task to boot cpu initially Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
    Re: [patch 01/18] init: Pin init task to boot cpu initially Steven Rostedt <rostedt@goodmis.org> - 2017-05-15 16:20 +0200
  Re: [patch 12/18] async: Adjust system_state checks Arjan van de Ven <arjan@linux.intel.com> - 2017-05-14 20:50 +0200
  [patch 05/18] metag: Adjust system_state check Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
  [patch 02/18] arm: Adjust system_state check Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
  [patch 18/18] sched: Enable smp_processor_id() checks early Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
    Re: [patch 18/18] sched: Enable smp_processor_id() checks early Steven Rostedt <rostedt@goodmis.org> - 2017-05-15 17:20 +0200
      Re: [patch 18/18] sched: Enable smp_processor_id() checks early Thomas Gleixner <tglx@linutronix.de> - 2017-05-15 17:40 +0200
  [patch 12/18] async: Adjust system_state checks Thomas Gleixner <tglx@linutronix.de> - 2017-05-14 20:50 +0200
  Re: [patch 00/18] init: Enable might_sleep() and smp_processor_id()  debugging early Mark Rutland <mark.rutland@arm.com> - 2017-05-15 14:00 +0200

csiph-web