[PATCH 1/2] Enable SPU switch notification to detect currently active SPU tasks.

Christoph Hellwig hch at lst.de
Fri Jul 13 20:12:33 EST 2007


On Thu, Jul 12, 2007 at 06:45:40PM -0500, Bob Nelson wrote:
> We would like this patch included in -mm and in 2.6.23.

Do you plan to submit oprofile support aswell?  In that case it's fine
otherwise please send it together with the actual oprofile support.

> +static void notify_spus_active(void)
> +{
> +	int node;
> +	/* Wake up the active spu_contexts. When the awakened processes
> +	 * see their "notify_active" flag is set, they will call
> +	 * spu_switch_notify();
> +	 */

Small style issue, this should be:

	int node;

	/*
	 * Wake up the active spu_contexts.
	 *
	 * When the awakened processes see their "notify_active" flag is set,
	 * they will call spu_switch_notify().
	 */

> -static inline int spu_stopped(struct spu_context *ctx, u32 * stat)
> +static inline int spu_stopped(struct spu_context *ctx, u32 *stat)

useless (and wrong) reformatting, please remove.

> -static int spu_run_init(struct spu_context *ctx, u32 * npc)
> +static int spu_run_init(struct spu_context *ctx, u32 *npc)

Same here.

> -static int spu_run_fini(struct spu_context *ctx, u32 * npc,
> -			       u32 * status)
> +static int spu_run_fini(struct spu_context *ctx, u32 *npc,
> +			       u32 *status)

Same here.

> +		if (unlikely(test_bit(SPU_SCHED_NOTIFY_ACTIVE,
> +				      &ctx->sched_flags))) {
> +			clear_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags);

this should use test_and_clear_bit




More information about the Linuxppc-dev mailing list