public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs@oss.sgi.com
Subject: Re: [PATCH 06/11] xfs: replace i_flock with a sleeping bitlock
Date: Sun, 18 Dec 2011 13:11:37 -0500	[thread overview]
Message-ID: <20111218181137.GA17569@infradead.org> (raw)
In-Reply-To: <20111213221917.GD3179@dastard>

On Wed, Dec 14, 2011 at 09:19:17AM +1100, Dave Chinner wrote:
> > +static inline void xfs_ifunlock(struct xfs_inode *ip)
> > +{
> > +	xfs_iflags_clear(ip, XFS_IFLOCK);
> > +	wake_up_bit(&ip->i_flags, __XFS_IFLOCK_BIT);
> > +}
> 
> Should the wakeup be done whilst the ip->i_flags_lock is still held?

There is no reason to do so - __XFS_IFLOCK_BIT is only used as a wakeup key
in wake_up_bit, so it can easily be done after the unlocking.  Doing so
is indeed a lot more efficient as the waiter needs to take the locks as
the first thing after beeing woken.  

> The VFS code does the __I_SYNC wakeup while still holding the
> inode->i_lock so that the clear and wakeup are atomic, similarly the
> __I_NEW bit....

It implements a bit different semantics, and actually needs to hold the
lock for more synchronization than just the wakeup bit.  It does in fact
use the bit wakeup helpers using the atomic test/set bit operations
despite holding a lock for some reason.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-12-18 18:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08 15:57 [PATCH 00/11] inode shrink and misc updates Christoph Hellwig
2011-12-08 15:57 ` [PATCH 01/11] xfs: remove xfs_itruncate_data Christoph Hellwig
2011-12-13 21:23   ` Dave Chinner
2011-12-08 15:57 ` [PATCH 02/11] xfs: cleanup xfs_iomap_eof_align_last_fsb Christoph Hellwig
2011-12-13 21:25   ` Dave Chinner
2011-12-08 15:57 ` [PATCH 03/11] xfs: remove the unused dm_attrs structure Christoph Hellwig
2011-12-08 15:57 ` [PATCH 04/11] xfs: remove the if_ext_max field in struct xfs_ifork Christoph Hellwig
2011-12-13 21:59   ` Dave Chinner
2011-12-08 15:58 ` [PATCH 05/11] xfs: make i_flags an unsigned long Christoph Hellwig
2012-01-13 19:07   ` Ben Myers
2012-01-24 18:03     ` Christoph Hellwig
2011-12-08 15:58 ` [PATCH 06/11] xfs: replace i_flock with a sleeping bitlock Christoph Hellwig
2011-12-13 22:19   ` Dave Chinner
2011-12-18 18:11     ` Christoph Hellwig [this message]
2011-12-08 15:58 ` [PATCH 07/11] xfs: replace i_pin_wait with a bit waitqueue Christoph Hellwig
2011-12-13 22:21   ` Dave Chinner
2011-12-08 15:58 ` [PATCH 08/11] xfs: remove the i_size field in struct xfs_inode Christoph Hellwig
2011-12-13 22:58   ` Dave Chinner
2011-12-08 15:58 ` [PATCH 09/11] xfs: remove the i_new_size " Christoph Hellwig
2011-12-13 23:16   ` Dave Chinner
2011-12-14 13:30     ` Christoph Hellwig
2011-12-08 15:58 ` [PATCH 10/11] xfs: always return with the iolock held from xfs_file_aio_write_checks Christoph Hellwig
2011-12-13 23:20   ` Dave Chinner
2011-12-14 13:27     ` Christoph Hellwig
2011-12-08 15:58 ` [PATCH 11/11] xfs: cleanup xfs_file_aio_write Christoph Hellwig
2011-12-13 23:28   ` Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2011-12-18 20:00 [PATCH 00/11] inode shrink and misc updates V2 Christoph Hellwig
2011-12-18 20:00 ` [PATCH 06/11] xfs: replace i_flock with a sleeping bitlock Christoph Hellwig
2012-01-13 21:49   ` Ben Myers

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=20111218181137.GA17569@infradead.org \
    --to=hch@infradead.org \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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