mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	dm mpath: only flush workqueue when needed
The workqueues are shared by many multipath devices, only flush whole workqueue when necessary. Otherwise, we just flush works as needed. Signed-off-by: wuzhouhui <wuzhouhui14@mails.ucas.ac.cn> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
		
							parent
							
								
									2adc5c559a
								
							
						
					
					
						commit
						935fcc56ab
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1211,14 +1211,16 @@ static void flush_multipath_work(struct multipath *m)
 | 
			
		|||
		set_bit(MPATHF_PG_INIT_DISABLED, &m->flags);
 | 
			
		||||
		smp_mb__after_atomic();
 | 
			
		||||
 | 
			
		||||
		flush_workqueue(kmpath_handlerd);
 | 
			
		||||
		if (atomic_read(&m->pg_init_in_progress))
 | 
			
		||||
			flush_workqueue(kmpath_handlerd);
 | 
			
		||||
		multipath_wait_for_pg_init_completion(m);
 | 
			
		||||
 | 
			
		||||
		clear_bit(MPATHF_PG_INIT_DISABLED, &m->flags);
 | 
			
		||||
		smp_mb__after_atomic();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	flush_workqueue(kmultipathd);
 | 
			
		||||
	if (m->queue_mode == DM_TYPE_BIO_BASED)
 | 
			
		||||
		flush_work(&m->process_queued_bios);
 | 
			
		||||
	flush_work(&m->trigger_event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue