[SNIP]
>
> Second of all, even after we removed the entity from rq in
> drm_sched_entity_flush to terminate any subsequent submissions
>
> to the queue the other thread doing push job can just acquire again a
> run queue
>
> from drm_sched_entity_get_free_sched and continue submission
Hi Christian
That is actually desired.
When another process is now using the entity to submit jobs adding it
back to the rq is actually the right thing to do cause the entity is
still in use.
Yes, no problem if it's another process. But what about another thread from same process ? Is it a possible use case that 2 threads from same process submit to same entity concurrently ? If so and we specifically kill one, the other will not stop event if we want him to because current code makes him just require a rq for him self.
Well you can't kill a single thread of a process (you can only interrupt it), a SIGKILL will always kill the whole process.
Is the following scenario possible and acceptable ?
2 threads from same process working on same queue where thread A currently in drm_sched_entity_flush->wait_event_timeout (the process getting shut down because of SIGKILL sent by user)
while thread B still inside drm_sched_entity_push_job before 'if (reschedule)'. 'A' stopped waiting because queue became empty and then removes the entity queue from scheduler's run queue while
B goes inside 'reschedule' because it evaluates to true ('first' is true and all the rest of the conditions), acquires new rq, and later adds it back to scheduler (different one maybe) and keeps submitting jobs as much as he likes and then can be stack for up to 'timeout' timeĀ in his drm_sched_entity_flush waiting for them.
My understanding was that introduction of entity->last is to force immediate termination job submissions by any thread from the terminating process.
Andrey