[Cbe-oss-dev] [patch 05/18] cell: add placement computation for scheduling of affinity contexts
André Detsch
adetsch at br.ibm.com
Mon Apr 30 23:46:25 EST 2007
Jeremy Kerr wrote:
> This looks fine to me, save a couple of very minor nitpicks. However,
> I'm going to leave the acking job to Christoph, as this is really his
> area of expertise...
I guess he is going to be back on Wednesday, I'll wait until then.
>> +static inline int sched_spu(struct spu *spu)
>> +{
>> + return (!spu->ctx || !(spu->ctx->flags & SPU_CREATE_NOSCHED));
>> +}
>
> Can we give this a more descriptive name?
scheduleable_spu()?
(Suggestions welcome :)
>> +static void aff_set_ref_point_location(struct spu_gang *gang)
>> +{
>> + int mem_aff, gs, lowest_offset;
>> + struct spu_context *ctx;
>> + struct spu *tmp;
>> +
>> + mem_aff = gang->aff_ref_ctx->flags & SPU_CREATE_AFFINITY_MEM;
>> + lowest_offset = 0;
>> + gs = 0;
>> + list_for_each_entry(tmp, &gang->aff_list_head, aff_list)
>> + gs++;
>
> No need to use list_for_each_entry here - list_for_each will do fine,
> then we can drop the 'tmp' variable.
Ok.
>
>> @@ -103,6 +104,8 @@ struct spu_gang {
>> struct list_head aff_list_head;
>> struct mutex aff_mutex;
>> int aff_flags;
>> + struct spu *aff_ref_spu;
>> + atomic_t aff_sched_count;
>> };
>
> It's not strictly necessary, but it might be a good idea to
> ATOMIC_INIT() the aff_sched_count explicitly on gang creation.
Ok.
--
Andre Detsch
More information about the cbe-oss-dev
mailing list