adaptive mutexes, was Re: btrfs_tree_lock & trylock

Previous thread: [PATCH] kernel/cpu.c: create a CPU_STARTING cpu_chain notifier by Manfred Spraul on Sunday, September 7, 2008 - 7:57 am. (3 messages)

Next thread: [PATCH bz #11425] tpm: release memory on init failure by Randy Dunlap on Monday, September 8, 2008 - 10:45 am. (2 messages)
From: Christoph Hellwig
Date: Monday, September 8, 2008 - 10:16 am

Well, the traditional wisdom in kernel land is that you want a spinlock
if the contention phases are short.  But we grow more an more places
where we might do sleep under the lock.  One optimization would be
to spin, but only if the mutex holder is not sleeping.  Or we make the
spinning a completely different API, mutex_lock_adaptive()

--

Previous thread: [PATCH] kernel/cpu.c: create a CPU_STARTING cpu_chain notifier by Manfred Spraul on Sunday, September 7, 2008 - 7:57 am. (3 messages)

Next thread: [PATCH bz #11425] tpm: release memory on init failure by Randy Dunlap on Monday, September 8, 2008 - 10:45 am. (2 messages)