public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Gao Xiang <hsiangkao@redhat.com>
Cc: linux-xfs@vger.kernel.org, Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH] xfs: drop the obsolete comment on filestream locking
Date: Tue, 22 Sep 2020 09:40:14 -0700	[thread overview]
Message-ID: <20200922164014.GK7955@magnolia> (raw)
In-Reply-To: <20200922162328.GA1077@xiangao.remote.csb>

On Wed, Sep 23, 2020 at 12:23:28AM +0800, Gao Xiang wrote:
> Hi Darrick,
> 
> On Tue, Sep 22, 2020 at 09:03:28AM -0700, Darrick J. Wong wrote:
> > On Tue, Sep 22, 2020 at 12:44:28PM +0800, Gao Xiang wrote:
> > > On Tue, Sep 22, 2020 at 11:42:49AM +0800, Gao Xiang wrote:
> > > > From: Gao Xiang <hsiangkao@redhat.com>
> > > > 
> > > > Since commit 1c1c6ebcf52 ("xfs: Replace per-ag array with a radix
> > > > tree"), there is no m_peraglock anymore, so it's hard to understand
> > > > the described situation since per-ag is no longer an array and no
> > > > need to reallocate, call xfs_filestream_flush() in growfs.
> > > > 
> > > > In addition, the race condition for shrink feature is quite confusing
> > > > to me currently as well. Get rid of it instead.
> > > > 
> > > 
> > > (Add some words) I think I understand what the race condition could mean
> > > after shrink fs is landed then, but the main point for now is inconsistent
> > > between code and comment, and there is no infrastructure on shrinkfs so
> > > when shrink fs is landed, the locking rule on filestream should be refined
> > > or redesigned and xfs_filestream_flush() for shrinkfs which was once
> > > deleted by 1c1c6ebcf52 might be restored to drain out in-flight
> > > xfs_fstrm_item for these shrink AGs then.
> > > 
> > > From the current code logic, the comment has no use and has been outdated
> > > for years. Keep up with the code would be better IMO to save time.
> > 
> > Not being familiar with the filestream code at all, I wonder, what
> > replaced all that stuff?  Does that need a comment?  I can't really tell
> > at a quick glance what coordinates growfs with filestreams.
> 
> (try to cc Dave...)
> 
> I'm not quite familiar with filestream as well. After several days random
> glance about the constraint of shrink feature in XFS, I found such comment
> and try to understand such constraint.
> 
> Finally, I think it was useful only when perag was once an array and need
> to be reallocated (before 1c1c6ebcf52). So need to close the race by the
> m_peraglock (which is now deleted) and drain out in-flight AG filestream
> by xfs_filestream_flush() in growfs code (I think due to pag array
> reallocation). 
> 
> For now, m_peraglock and xfs_filestream_flush() in xfs_growfs_data_private()
> no longer exist... and we don't need to reallocate perag array but rather
> to use radix tree instead.

Yeah.  I guess you could shrink the comment to warn that any code
wanting to /remove/ an AG would need to be careful of the racy sequence
outlined in the three bullet points.  OTOH others have argued against
leaving comments that describe features we don't support.

But maybe it's better just to kill the whole comment like you proposed?

> but IMO, shrink an AG might need to restore to drain in-flight filestream,
> I couldn't tell much more of it... Overall, the current comment is quite
> confusing. I'd suggest it'd be better with some more reasonable comment
> about this at least...

Yes, you have to drain /all/ the incore state that pertains to an AG if
you're going to remove the AG.

--D

> 
> Thanks,
> Gao Xiang
> 
> > 
> > --D
> > 
> 

  reply	other threads:[~2020-09-22 16:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200922034249.20549-1-hsiangkao.ref@aol.com>
2020-09-22  3:42 ` [PATCH] xfs: drop the obsolete comment on filestream locking Gao Xiang
2020-09-22  4:44   ` Gao Xiang
2020-09-22 16:03     ` Darrick J. Wong
2020-09-22 16:23       ` Gao Xiang
2020-09-22 16:40         ` Darrick J. Wong [this message]
2020-09-22 21:26       ` Dave Chinner
2020-09-23  0:21         ` Gao Xiang
2020-09-23  7:05   ` Christoph Hellwig
2020-09-23 16:27   ` Darrick J. Wong

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=20200922164014.GK7955@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=hsiangkao@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /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