[Cbe-oss-dev] [PATCH 17/28]MARS/base: cache workload context

Yuji Mano yuji.mano at am.sony.com
Wed Feb 11 05:58:25 EST 2009


Kazunori Asayama wrote:
> Once 'workload context cache' is introduced and if reset state of cache
> only when adding workload to the queue, there will be 4 context load states:
> 
>   1. Start of workload
>     1-a. Not loaded
>     1-b. Cached
>   2. Workload (task) restore
>     2-a. Not cached
>     2-b. Cached
> 
> My question is, how can the task module distinguish between 1-b and 2-b?
> As you are saying, 'data' should be reloaded in 1-b case. So I thought
> it was a simple way to invalidate the cache and reload whole of the
> program always when starting workload...

The task module can currently distinguish between 1-b and 2-b through the
'stack' member stored in the task context. The 'stack' member is reset at
each 'schedule' call.

So to put it simply, the query cache syscall distinguishes (a) or (b),
while the 'stack' member for a task context distinguishes (1) or (2).

As you say, of course we can invalidate the cache and reload the whole program,
but this is an optimization for the use case where we repeatedly re-schedule
the same task over and over without creating/destroying a new one in between.
In this situation, I think we should provide the task module the option to
allow for further optimization in the future it chooses not to reload the text
and readonly data sections.

Regards,
Yuji




More information about the cbe-oss-dev mailing list