Skip to content
  1. Sep 05, 2008
    • Jeremy Kerr's avatar
      powerpc/spufs: Fix race for a free SPU · b65fe035
      Jeremy Kerr authored
      
      
      We currently have a race for a free SPE. With one thread doing a
      spu_yield(), and another doing a spu_activate():
      
      thread 1				thread 2
      spu_yield(oldctx)			spu_activate(ctx)
        __spu_deactivate(oldctx)
        spu_unschedule(oldctx, spu)
        spu->alloc_state = SPU_FREE
      					spu = spu_get_idle(ctx)
      					    - searches for a SPE in
      					      state SPU_FREE, gets
      					      the context just
      					      freed by thread 1
      					spu_schedule(ctx, spu)
      					  spu->alloc_state = SPU_USED
      spu_schedule(newctx, spu)
        - assumes spu is still free
        - tries to schedule context on
          already-used spu
      
      This change introduces a 'free_spu' flag to spu_unschedule, to indicate
      whether or not the function should free the spu after descheduling the
      context. We only set this flag if we're not going to re-schedule
      another context on this SPU.
      
      Add a comment to document this behaviour.
      
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      b65fe035
    • Jeremy Kerr's avatar
      powerpc/spufs: Fix multiple get_spu_context() · 9f43e391
      Jeremy Kerr authored
      
      
      Commit 8d5636fb introduced a reference
      count on SPU contexts during find_victim, but this may cause a leak in
      the reference count if we later find a better contender for a context to
      unschedule.
      
      Change the reference to after we've found our victim context, so we
      don't do the extra get_spu_context().
      
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      9f43e391
  2. Aug 19, 2008
  3. Aug 14, 2008
  4. Aug 13, 2008
    • Jeremy Kerr's avatar
      powerpc/spufs: fix npc setting for NOSCHED contexts · d9dd421f
      Jeremy Kerr authored
      
      
      Currently, spu_run ignores the npc argument for contexts created with
      SPU_CREATE_NOSCHED. While this is correct for isolated contexts,
      there's no need to enforce the npc restriction on non-isolated NOSCHED
      contexts.
      
      This means that NOSCHED contexts can only ever run with an entry point
      of 0x0.
      
      This change to spu_run_init allows setting of the npc (and, while we're
      at it, the privcntl) for non-isolated NOSCHED contexts. This allows
      us to run NOSCHED contexts from any entry point.
      
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      d9dd421f
  5. Jul 26, 2008
  6. Jul 24, 2008
  7. Jul 22, 2008
  8. Jul 09, 2008
  9. Jun 30, 2008
  10. Jun 16, 2008
  11. May 15, 2008
  12. May 08, 2008
  13. May 05, 2008
  14. May 01, 2008
  15. Apr 30, 2008
Loading