Skip to content

Directed yield.

Martin Schwidefsky linux-arch 1 version In review

Get series with b4
b4 am 20060915113024.GD23134@skybase

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Directed yield: cpu_relax variants for spinlocks and rw-locks.include/asm-alpha/spinlock.h include/asm-arm/spinlock.h include/asm-cris/arch-v32/spinlock.h +13 more+62 -22 replies
2/2Directed yield: direct yield of spinlocks for s390.arch/s390/kernel/head31.S arch/s390/kernel/head64.S arch/s390/lib/spinlock.c +3 more+87 -350 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/2] Directed yield.

Hi folks,
with CONFIG_PREEMPT=y the spin_lock/read_lock/write_lock functions are defined in kernel/spinlock.c with a loop over _raw_##op##_trylock. If the lock could not be taken cpu_relax is called. The architecture can't choose to do something else instead of cpu_relax. To implement a directed yield that gives up the timeslice of a virtual cpu in favour of a specific cpu, the cpu_relax needs to be replaced with something new: _raw_spin_relax, _raw_read_relax or _raw_write_relax.

Patch #01 introduces the new primitives and patch #02 has the s390 implementation for directed yield as example for the use of the primitives.

Signature · 8 lines
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.