Skip to contentSkip to conversation

Directed yield.

PATCH In review Martin Schwidefsky 1 participant 1 message Sep 15, 2006 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

cover 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.