trace_workqueue: use list_for_each_entry() instead of list_for_each_entry_safe()
No need to use list_for_each_entry_safe() in iteration without deleting any node, we can use list_for_each_entry() instead. [ Impact: cleanup ] Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
This commit is contained in:
parent
fb39125fd7
commit
1fdfca9c57
|
@ -47,12 +47,11 @@ probe_workqueue_insertion(struct task_struct *wq_thread,
|
||||||
struct work_struct *work)
|
struct work_struct *work)
|
||||||
{
|
{
|
||||||
int cpu = cpumask_first(&wq_thread->cpus_allowed);
|
int cpu = cpumask_first(&wq_thread->cpus_allowed);
|
||||||
struct cpu_workqueue_stats *node, *next;
|
struct cpu_workqueue_stats *node;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
|
spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
|
||||||
list_for_each_entry_safe(node, next, &workqueue_cpu_stat(cpu)->list,
|
list_for_each_entry(node, &workqueue_cpu_stat(cpu)->list, list) {
|
||||||
list) {
|
|
||||||
if (node->pid == wq_thread->pid) {
|
if (node->pid == wq_thread->pid) {
|
||||||
atomic_inc(&node->inserted);
|
atomic_inc(&node->inserted);
|
||||||
goto found;
|
goto found;
|
||||||
|
@ -69,12 +68,11 @@ probe_workqueue_execution(struct task_struct *wq_thread,
|
||||||
struct work_struct *work)
|
struct work_struct *work)
|
||||||
{
|
{
|
||||||
int cpu = cpumask_first(&wq_thread->cpus_allowed);
|
int cpu = cpumask_first(&wq_thread->cpus_allowed);
|
||||||
struct cpu_workqueue_stats *node, *next;
|
struct cpu_workqueue_stats *node;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
|
spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
|
||||||
list_for_each_entry_safe(node, next, &workqueue_cpu_stat(cpu)->list,
|
list_for_each_entry(node, &workqueue_cpu_stat(cpu)->list, list) {
|
||||||
list) {
|
|
||||||
if (node->pid == wq_thread->pid) {
|
if (node->pid == wq_thread->pid) {
|
||||||
node->executed++;
|
node->executed++;
|
||||||
goto found;
|
goto found;
|
||||||
|
|
Loading…
Reference in New Issue