linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Todd Kneisel <todd.kneisel@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: david singleton <dsingleton@mvista.com>,
	drepper@gmail.com, mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [robust-futex-4] futex: robust futex support
Date: Mon, 23 Jan 2006 11:20:52 -0700	[thread overview]
Message-ID: <1c190f10601231020v7bacc3e8t31e0378093be8596@mail.gmail.com> (raw)
In-Reply-To: <20060118212256.1553b0ec.akpm@osdl.org>

On 1/18/06, Andrew Morton <akpm@osdl.org> wrote:
> > +/**
> > + * futex_free_robust_list - release the list of registered futexes.
> > + * @inode: inode that may be a memory mapped file
> > + *
> > + * Called from dput() when a dentry reference count reaches zero.
> > + * If the dentry is associated with a memory mapped file, then
> > + * release the list of registered robust futexes that are contained
> > + * in that mapping.
> > + */
> > +void futex_free_robust_list(struct inode *inode)
> > +{
> > +     struct address_space *mapping;
> > +     struct list_head *head;
> > +     struct futex_robust *this, *next;
> > +     struct futex_head *futex_head = NULL;
> > +
> > +     if (inode == NULL)
> > +             return;
>
> Is this test needed?
>
> This function is called when a dentry's refcount falls to zero.  But there
> could be other refs to this inode which might get upset at having their
> robust futexes thrown away.  Shouldn't this be based on inode destruction
> rather than dentry?
>

In an early version, it was based on inode destruction. But inodes are
not destroyed
at process termination. If I understand the code, they're cached so that another
process that opens the same file will not have to build the inode from scratch.

So I based it on the dentry's refcount falling to zero, which occurs at process
termination. I did consider the problem of other references to the
inode. The only
scenario I could come up with was mapping the file using hard links. Then there
would be multiple dentrys referencing the same inode. This could be fixed by
adding a refcount to the futex_robust structure, but I never got around to doing
this.

Todd.

      parent reply	other threads:[~2006-01-23 18:20 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               ` [robust-futex-4] " Ingo Oeser
2006-01-20 22:18                 ` Andrew Morton
2006-01-21  2:30                   ` david singleton
2006-01-23 18:20               ` Todd Kneisel [this message]

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=1c190f10601231020v7bacc3e8t31e0378093be8596@mail.gmail.com \
    --to=todd.kneisel@gmail.com \
    --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).