[Cbe-oss-dev] [PATCH 8/10] MARS: workload queue mutex protection

Kazunori Asayama asayama at sm.sony.co.jp
Thu Aug 28 19:46:18 EST 2008


Yuji Mano wrote:
> This adds mutex protection when accessing the shared workload queue.
> 
> Prior to this patch the kernel scheduler accessed the whole queue block
> atomically. Now the kernel scheduler atomically locks the queue block when it
> needs to access it.
> 
> Host-side access of the queue block now also uses the mutex locks to keep the
> workload queue functions thread-safe.
> 
> This also replaces the previously used MARS context mutex. The workload queue
> handles its own mutex without the workload model APIs needing to manage the
> MARS context mutex.
> 
> Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

(snip)

> --- a/include/common/mars/mars_workload_types.h
> +++ b/include/common/mars/mars_workload_types.h
> @@ -64,9 +64,9 @@ extern "C" {
>  #define MARS_WORKLOAD_SIGNAL_ON			0x1	/* signal set on */
>  #define MARS_WORKLOAD_SIGNAL_OFF		0x0	/* signal set off */
>  
> -#define MARS_WORKLOAD_MAX			1024	/* wl max */
> -#define MARS_WORKLOAD_PER_BLOCK			16	/* wl per block */
> -#define MARS_WORKLOAD_NUM_BLOCKS		64	/* wl max / per block */
> +#define MARS_WORKLOAD_PER_BLOCK			15	/* wl/block */

This change of MARS_WORKLOAD_PER_BLOCK from 16 to 15 will cause *real*
divide operation on MPU when calculating block number and index in the
block by ID, i.e.:

  	int block = id / MARS_WORKLOAD_PER_BLOCK;
  	int index = id % MARS_WORKLOAD_PER_BLOCK;

I think we should avoid that, if possible.

Other things look ok to me.

-- 
(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list