Skip to contentSkip to conversation

kernel-workqueuec-remove-noop-in-workqueue.patch removed from -mm tree

merged New [email protected] 2 participants 2 messages Jan 10, 2011 – Jan 11, 2011 1 message not in the archive Workqueue

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
kernel/workqueue.c: remove noop in workqueue
has been removed from the -mm tree. Its filename was
kernel-workqueuec-remove-noop-in-workqueue.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: kernel/workqueue.c: remove noop in workqueue
From: Hillf Danton <[email protected]>

Checking WORKER_NOT_RUNNING in the flags word of worker is unnecessary if it is set in the flags parameter.

---

 kernel/workqueue.c |    1 -
 1 file changed, 1 deletion(-)
kernel/workqueue.c renamed from kernel/workqueue.c~kernel-workqueuec-remove-noop-in-workqueue +0 -1
diff -puN kernel/workqueue.c~kernel-workqueuec-remove-noop-in-workqueue kernel/workqueue.c
@@ -770,7 +770,6 @@ static inline void worker_clr_flags(stru
 
 	/* if transitioning out of NOT_RUNNING, increment nr_running */
 	if ((flags & WORKER_NOT_RUNNING) && (oflags & WORKER_NOT_RUNNING))
-		if (!(worker->flags & WORKER_NOT_RUNNING))
 			atomic_inc(get_gcwq_nr_running(gcwq->cpu));
 }
 

_

Patches currently in -mm which might be from [email protected] are

origin.patch
linux-next.patch

maintainer
#2 lore raw

PATCH 1/1 workqueue: note the nested NOT_RUNNING test in worker_clr_flags() isn't a noop

In reply to a message not in the archive

The nested NOT_RUNNING test in worker_clr_flags() is slightly misleading in that if NOT_RUNNING were a single flag the nested test would be always %true and thus noop. Add a comment noting that the test isn't a noop.

Cc Hillf Danton <[email protected]>
Cc Andrew Morton <[email protected]>

---
Let's avoid similar mistakes in the future. Thanks.

 kernel/workqueue.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
kernel/workqueue.c +5 -1
index 930c239..11869fa 100644
@@ -768,7 +768,11 @@ static inline void worker_clr_flags(struct worker *worker, unsigned int flags)
 
 	worker->flags &= ~flags;
 
-	/* if transitioning out of NOT_RUNNING, increment nr_running */
+	/*
+	 * If transitioning out of NOT_RUNNING, increment nr_running.  Note
+	 * that the nested NOT_RUNNING is not a noop.  NOT_RUNNING is mask
+	 * of multiple flags, not a single flag.
+	 */
 	if ((flags & WORKER_NOT_RUNNING) && (oflags & WORKER_NOT_RUNNING))
 		if (!(worker->flags & WORKER_NOT_RUNNING))
 			atomic_inc(get_gcwq_nr_running(gcwq->cpu));
Signature · 1 line
1.7.1