mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-18 22:14:16 +00:00 
			
		
		
		
	workqueue: note the nested NOT_RUNNING test in worker_clr_flags() isn't a noop
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. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Hillf Danton <dhillf@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									e159489baa
								
							
						
					
					
						commit
						42c025f3de
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -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)); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Tejun Heo
						Tejun Heo