public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 3/4] xfs: replace i_pin_wait with a bit waitqueue
Date: Wed, 26 Oct 2011 16:07:33 -0500	[thread overview]
Message-ID: <1319663253.5239.75.camel@doink> (raw)
In-Reply-To: <20111019182421.048260722@bombadil.infradead.org>

On Wed, 2011-10-19 at 14:23 -0400, Christoph Hellwig wrote:
> Replace i_pin_wait, which is only used during synchronous inode flushing
> with a bit waitqueue.  This trades off a much smaller inode against
> slightly slower wakeup performance, and saves 12 (32-bit) or 20 (64-bit)
> bytes in the XFS inode.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

One minor suggestion, plus some discussion from
inside my head below.

Reviewed-by: Alex Elder <aelder@sgi.com>

. . .

> @@ -2163,14 +2163,29 @@ xfs_iunpin_nowait(
>  
>  }
>  
> +static void
> +__xfs_iunpin_wait(
> +	struct xfs_inode	*ip)
> +{
> +	wait_queue_head_t *wq = bit_waitqueue(&ip->i_flags, __XFS_IPINNED_BIT);
> +	DEFINE_WAIT_BIT(q, &ip->i_flags, __XFS_IPINNED_BIT);

In your last patch, you used "wait" as the name
rather than "q".  Minor consistency nit...

> +	xfs_iunpin(ip);
> +

This initially struck me as unsafe or something,
assuming the inode was pinned.  But I was thinking
of it more like an unlock request, which it is not.
It's more like unplugging something so the inode
will eventually get unpinned.  (Just thinking aloud
here, nevermind me...)

> +	do {
> +		prepare_to_wait(wq, &q.wait, TASK_UNINTERRUPTIBLE);
> +		if (xfs_ipincount(ip))
> +			io_schedule();
> +	} while (xfs_ipincount(ip));
> +	finish_wait(wq, &q.wait);
> +}
> +
. . .

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

  reply	other threads:[~2011-10-26 21:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-19 18:23 [PATCH 0/4] inode diet, part1 V2 Christoph Hellwig
2011-10-19 18:23 ` [PATCH 1/4] xfs: make i_flags and unsigned long Christoph Hellwig
2011-10-26 21:07   ` Alex Elder
2011-10-19 18:23 ` [PATCH 2/4] xfs: replace i_flock with a sleeping bitlock Christoph Hellwig
2011-10-26 21:07   ` Alex Elder
2011-10-19 18:23 ` [PATCH 3/4] xfs: replace i_pin_wait with a bit waitqueue Christoph Hellwig
2011-10-26 21:07   ` Alex Elder [this message]
2011-10-27 16:42     ` Christoph Hellwig
2011-10-19 18:23 ` [PATCH 4/4] xfs: remove the unused dm_attrs structure Christoph Hellwig
2011-10-26 21:07   ` Alex Elder
  -- strict thread matches above, loose matches on Subject: below --
2011-10-18 20:13 [PATCH 0/4] inode diet, part1 Christoph Hellwig
2011-10-18 20:13 ` [PATCH 3/4] xfs: replace i_pin_wait with a bit waitqueue Christoph Hellwig
2011-10-19  0:50   ` Dave Chinner

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=1319663253.5239.75.camel@doink \
    --to=aelder@sgi.com \
    --cc=hch@infradead.org \
    --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