[Cbe-oss-dev] [PATCH 7/10] MARS: workload queue api fix
Geoff Levand
geoffrey.levand at am.sony.com
Fri Aug 29 11:14:15 EST 2008
Yuji Mano wrote:
> 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?
Callbacks are generally troublesome both in debugging and in reliability,
so something that is not to complex and avoids a callback is usually
preferred.
-Geoff
More information about the cbe-oss-dev
mailing list