[Cbe-oss-dev] [RFC, PATCH 1/2] powerpc/spufs: allow spu_acquire_saved to correctly handle NOSCHED contexts

Jeremy Kerr jk at ozlabs.org
Sat Aug 2 13:28:27 EST 2008


Gi Arnd,

> What kind of benefit do you see from your patch, other than saving a
> few lines of source code with the second patch?

libspe cannot use NOSCHED contexts at the moment, as it has no way to 
set up the registers (for the inital stack frame). Allowing access to 
the regs file at appropriate times is the main goal here.

> We have users relying on the phys-id of the context not to change and
> that can not accept the latencies of a context save/restore when
> accessing the context.

OK, I think the expectation that we never *switch* a NOSCHED context 
(rather than just never *scheduling* one out) is reasonable, so how 
about something like:

	/* if a context is running, we don't want to deschedule it */
	if ((ctx->flags & SPU_CREATE_NOSCHED) &&
			(ctx->state != SPU_STATE_SAVED) {
		spu_release(ctx);
		return -EBUSY;
	}

This will allow libspe to access the registers before the context is 
loaded, but will never result in an unschedule.

Cheers,


Jeremy



More information about the cbe-oss-dev mailing list