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


Groups > linux.kernel > #1222186 > unrolled thread

[PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs

Started byOleg Nesterov <oleg@redhat.com>
First post2015-09-10 15:20 +0200
Last post2015-09-13 13:00 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to  disable irqs Oleg Nesterov <oleg@redhat.com> - 2015-09-10 15:20 +0200
    Re: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need  to disable irqs Kirill Tkhai <ktkhai@odin.com> - 2015-09-10 15:40 +0200
    Re: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need  to disable irqs Srikar Dronamraju <srikar@linux.vnet.ibm.com> - 2015-09-11 12:30 +0200
    [tip:sched/core] cpu/hotplug: Read_lock(tasklist_lock) doesn'  t need to disable irqs tip-bot for Oleg Nesterov <tipbot@zytor.com> - 2015-09-13 13:00 +0200

#1222186 — [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs

FromOleg Nesterov <oleg@redhat.com>
Date2015-09-10 15:20 +0200
Subject[PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs
Message-ID<q79VE-2ta-27@gated-at.bofh.it>
check_for_tasks() doesn't need to disable irqs, recursive read_lock()
from interrupt is fine.

While at it, s/do_each_thread/for_each_process_thread/.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 kernel/cpu.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 94bbe46..24551f2 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -302,8 +302,8 @@ static inline void check_for_tasks(int dead_cpu)
 {
 	struct task_struct *g, *p;
 
-	read_lock_irq(&tasklist_lock);
-	do_each_thread(g, p) {
+	read_lock(&tasklist_lock);
+	for_each_process_thread(g, p) {
 		if (!p->on_rq)
 			continue;
 		/*
@@ -318,8 +318,8 @@ static inline void check_for_tasks(int dead_cpu)
 
 		pr_warn("Task %s (pid=%d) is on cpu %d (state=%ld, flags=%x)\n",
 			p->comm, task_pid_nr(p), dead_cpu, p->state, p->flags);
-	} while_each_thread(g, p);
-	read_unlock_irq(&tasklist_lock);
+	}
+	read_unlock(&tasklist_lock);
 }
 
 struct take_cpu_down_param {
-- 
1.5.5.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1222198 — Re: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs

FromKirill Tkhai <ktkhai@odin.com>
Date2015-09-10 15:40 +0200
SubjectRe: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs
Message-ID<q7af1-2PS-29@gated-at.bofh.it>
In reply to#1222186

On 10.09.2015 16:07, Oleg Nesterov wrote:
> check_for_tasks() doesn't need to disable irqs, recursive read_lock()
> from interrupt is fine.
> 
> While at it, s/do_each_thread/for_each_process_thread/.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Reviewed-by: Kirill Tkhai <ktkhai@odin.com>

> ---
>  kernel/cpu.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 94bbe46..24551f2 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -302,8 +302,8 @@ static inline void check_for_tasks(int dead_cpu)
>  {
>  	struct task_struct *g, *p;
>  
> -	read_lock_irq(&tasklist_lock);
> -	do_each_thread(g, p) {
> +	read_lock(&tasklist_lock);
> +	for_each_process_thread(g, p) {
>  		if (!p->on_rq)
>  			continue;
>  		/*
> @@ -318,8 +318,8 @@ static inline void check_for_tasks(int dead_cpu)
>  
>  		pr_warn("Task %s (pid=%d) is on cpu %d (state=%ld, flags=%x)\n",
>  			p->comm, task_pid_nr(p), dead_cpu, p->state, p->flags);
> -	} while_each_thread(g, p);
> -	read_unlock_irq(&tasklist_lock);
> +	}
> +	read_unlock(&tasklist_lock);
>  }
>  
>  struct take_cpu_down_param {
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1222695 — Re: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs

FromSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Date2015-09-11 12:30 +0200
SubjectRe: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs
Message-ID<q7tKG-7d0-7@gated-at.bofh.it>
In reply to#1222186
* Oleg Nesterov <oleg@redhat.com> [2015-09-10 15:07:50]:

> check_for_tasks() doesn't need to disable irqs, recursive read_lock()
> from interrupt is fine.
> 
> While at it, s/do_each_thread/for_each_process_thread/.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

> ---
>  kernel/cpu.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 

-- 
Thanks and Regards
Srikar Dronamraju

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1223573 — [tip:sched/core] cpu/hotplug: Read_lock(tasklist_lock) doesn' t need to disable irqs

Fromtip-bot for Oleg Nesterov <tipbot@zytor.com>
Date2015-09-13 13:00 +0200
Subject[tip:sched/core] cpu/hotplug: Read_lock(tasklist_lock) doesn' t need to disable irqs
Message-ID<q8daO-5pP-7@gated-at.bofh.it>
In reply to#1222186
Commit-ID:  a75a6068dac25d4022ebcd82192ed6345407843c
Gitweb:     http://git.kernel.org/tip/a75a6068dac25d4022ebcd82192ed6345407843c
Author:     Oleg Nesterov <oleg@redhat.com>
AuthorDate: Thu, 10 Sep 2015 15:07:50 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 12 Sep 2015 11:54:27 +0200

cpu/hotplug: Read_lock(tasklist_lock) doesn't need to disable irqs

check_for_tasks() doesn't need to disable irqs, recursive
read_lock() from interrupt is fine.

While at it, s/do_each_thread/for_each_process_thread/.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Kirill Tkhai <ktkhai@odin.com>
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Kirill Tkhai <ktkhai@parallels.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20150910130750.GA20055@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/cpu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 82cf9df..050c634 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -304,8 +304,8 @@ static inline void check_for_tasks(int dead_cpu)
 {
 	struct task_struct *g, *p;
 
-	read_lock_irq(&tasklist_lock);
-	do_each_thread(g, p) {
+	read_lock(&tasklist_lock);
+	for_each_process_thread(g, p) {
 		if (!p->on_rq)
 			continue;
 		/*
@@ -320,8 +320,8 @@ static inline void check_for_tasks(int dead_cpu)
 
 		pr_warn("Task %s (pid=%d) is on cpu %d (state=%ld, flags=%x)\n",
 			p->comm, task_pid_nr(p), dead_cpu, p->state, p->flags);
-	} while_each_thread(g, p);
-	read_unlock_irq(&tasklist_lock);
+	}
+	read_unlock(&tasklist_lock);
 }
 
 struct take_cpu_down_param {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web