[Cbe-oss-dev] [PATCH 7/10] MARS: workload queue api fix

Yuji Mano Yuji.Mano at am.sony.com
Fri Aug 29 08:38:02 EST 2008


Kazunori Asayama wrote:
> Yuji Mano wrote:
>> This modifies the internal workload queue API in the host-side library. When
>> scheduling a new workload, the workload model may need to initialize parts of
>> the workload context once it has been reserved in an available slot of the
>> workload queue.
>> 
>> Previously a separate call that returns the pointer to the
>> workload context was provided. However, that may cause simultaneous access
>> problems since the workload queue will not be locked during the whole
>> scheduling call.
>> 
>> This patch removes the separate API call, and instead adds a callback interface
>> to allow for the workload model to modify the workload context within the
>> mutex protected 'workload_queue_schedule' call.
> 
> Or alternative solution is to introduce another state such as
> 'MARS_WORKLOAD_STATE_SCHEDULING' for intermediate state between
> workload_queue_context() and workload_queue_schedule().

Yes that is another possible solution.

workload_queue_schedule_begin()
 - mutex lock
 - changes state to MARS_WORKLOAD_STATE_SCHEDULING
 - mutex unlock
 - returns pointer to the workload context for workload specific initialization

workload_queue_schedule_end()
 - mutex lock
 - sets necessary bits in workload queue
 - changes state to MARS_WORKLOAD_STATE_READY
 - mutex unlock

Is this preferable to the current callback solution and why?
If so I can implement the above, otherwise please ack current patch.

Regards,
Yuji




More information about the cbe-oss-dev mailing list