Re: [robust-futex-4] futex: robust futex support

From: david singleton
Date: Fri Jan 20 2006 - 21:28:43 EST



On Jan 20, 2006, at 2:18 PM, Andrew Morton wrote:

Ingo Oeser <ioe-lkml@xxxxxxxxxx> wrote:

+ list_for_each_entry_safe(this, next, head, list) {
+ list_del(&this->list);
+ kmem_cache_free(robust_futex_cachep, this);
+ }

If we're throwing away the entire contents of the list, there's no need to
detach items as we go.

Couldn't even detach the list elements first by

list_splice_init(&mapping->robust_head->robust_list, head);

and free the list from "head" after releasing the mutex?
This would reduce lock contention, no?

Yes, it would reduce lock contention nicely.


Incorporated changes suggested by Andrew Morton and Ingo Oeser.

fs/inode.c | 2
include/linux/fs.h | 4
include/linux/futex.h | 33 ++++
init/Kconfig | 9 +
kernel/exit.c | 2
kernel/futex.c | 399 ++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 449 insertions(+)



David



Attachment: robust-futex-6
Description: Binary data