linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Oeser <ioe-lkml@rameria.de>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@osdl.org>,
	david singleton <dsingleton@mvista.com>,
	drepper@gmail.com, mingo@elte.hu
Subject: Re: [robust-futex-4] futex: robust futex support
Date: Fri, 20 Jan 2006 18:41:18 +0100	[thread overview]
Message-ID: <200601201841.24565.ioe-lkml@rameria.de> (raw)
In-Reply-To: <20060118212256.1553b0ec.akpm@osdl.org>

[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]

On Thursday 19 January 2006 06:22, Andrew Morton wrote:
> david singleton <dsingleton@mvista.com> wrote:
> > +	if (mapping->robust_head == NULL)
> > +		return;
> > +
> > +	if (list_empty(&mapping->robust_head->robust_list))
> > +		return;
> > +
> > +	mutex_lock(&mapping->robust_head->robust_mutex);
> > +
> > +	head = &mapping->robust_head->robust_list;
> > +	futex_head = mapping->robust_head;
> > +
> > +	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?

> > +#ifdef CONFIG_ROBUST_FUTEX
> > +	robust_futex_cachep = kmem_cache_create("robust_futex", sizeof(struct futex_robust), 0, 0, NULL, NULL);
> > +	file_futex_cachep = kmem_cache_create("file_futex", sizeof(struct futex_head), 0, 0, NULL, NULL);
> > +#endif
> 
> A bit of 80-column wrapping needed there please.
> 
> Are futex_heads likely to be allocated in sufficient volume to justify
> their own slab cache, rather than using kmalloc()?  The speed is the same -
> if anything, kmalloc() will be faster because its text and data are more
> likely to be in CPU cache.
 
The goal here was to do cheap futex accounting, as described in the 
documentation to this patch.


Regards

Ingo Oeser


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2006-01-20 20:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-14  1:00 [robust-futex-1] futex: robust futex support David Singleton
2006-01-15  0:02 ` Ulrich Drepper
2006-01-15  0:04   ` david singleton
2006-01-15  5:18     ` Ulrich Drepper
2006-01-15 20:00       ` David Singleton
2006-01-17  2:27       ` [robust-futex-3] " david singleton
2006-01-17 17:32         ` Ulrich Drepper
2006-01-17 17:50         ` Ulrich Drepper
2006-01-19  2:26           ` [robust-futex-4] " david singleton
2006-01-19  5:22             ` Andrew Morton
2006-01-20  0:47               ` [robust-futex-5] " david singleton
2006-01-20 17:41               ` Ingo Oeser [this message]
2006-01-20 22:18                 ` [robust-futex-4] " Andrew Morton
2006-01-21  2:30                   ` david singleton
2006-01-23 18:20               ` Todd Kneisel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200601201841.24565.ioe-lkml@rameria.de \
    --to=ioe-lkml@rameria.de \
    --cc=akpm@osdl.org \
    --cc=drepper@gmail.com \
    --cc=dsingleton@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).