mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	drm/sched: Use drm sched lockdep map for submit_wq
Avoid leaking a lockdep map on each drm sched creation and destruction by using a single lockdep map for all drm sched allocated submit_wq. v2: - Use alloc_ordered_workqueue_lockdep_map (Tejun) Cc: Luben Tuikov <ltuikov89@gmail.com> Cc: Christian König <christian.koenig@amd.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20241002131639.3425022-2-matthew.brost@intel.com Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
This commit is contained in:
		
							parent
							
								
									f9e7ac6e2e
								
							
						
					
					
						commit
						34f50cc644
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
					@ -87,6 +87,12 @@
 | 
				
			||||||
#define CREATE_TRACE_POINTS
 | 
					#define CREATE_TRACE_POINTS
 | 
				
			||||||
#include "gpu_scheduler_trace.h"
 | 
					#include "gpu_scheduler_trace.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef CONFIG_LOCKDEP
 | 
				
			||||||
 | 
					static struct lockdep_map drm_sched_lockdep_map = {
 | 
				
			||||||
 | 
						.name = "drm_sched_lockdep_map"
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define to_drm_sched_job(sched_job)		\
 | 
					#define to_drm_sched_job(sched_job)		\
 | 
				
			||||||
		container_of((sched_job), struct drm_sched_job, queue_node)
 | 
							container_of((sched_job), struct drm_sched_job, queue_node)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1269,7 +1275,12 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
 | 
				
			||||||
		sched->submit_wq = submit_wq;
 | 
							sched->submit_wq = submit_wq;
 | 
				
			||||||
		sched->own_submit_wq = false;
 | 
							sched->own_submit_wq = false;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 | 
					#ifdef CONFIG_LOCKDEP
 | 
				
			||||||
 | 
							sched->submit_wq = alloc_ordered_workqueue_lockdep_map(name, 0,
 | 
				
			||||||
 | 
													       &drm_sched_lockdep_map);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
		sched->submit_wq = alloc_ordered_workqueue(name, 0);
 | 
							sched->submit_wq = alloc_ordered_workqueue(name, 0);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		if (!sched->submit_wq)
 | 
							if (!sched->submit_wq)
 | 
				
			||||||
			return -ENOMEM;
 | 
								return -ENOMEM;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue