From: Christoph Hellwig <hch@lst.de>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@lst.de>,
Chandan Babu R <chandan.babu@oracle.com>,
Matthew Wilcox <willy@infradead.org>,
"Darrick J. Wong" <djwong@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs: convert perag lookup to xarray
Date: Wed, 14 Aug 2024 07:21:11 +0200 [thread overview]
Message-ID: <20240814052111.GA30979@lst.de> (raw)
In-Reply-To: <Zrw5q0qTi9m8AT6+@dread.disaster.area>
On Wed, Aug 14, 2024 at 02:59:23PM +1000, Dave Chinner wrote:
> Can we split the implementation change and the API change into two
> separate patches, please?
I don't think that is entirely possible, but things can be split
a bit more. I've actually done some of that including more API
changes in the meantime, so this might only need small adjustments
anyway.
> So what's the overall plan for avoiding this sort of mess
> everywhere? Can we re-implement the existing iterators more
> efficiently with xarray iterators, or does xarray-based iteration
> require going back to the old way of open coding all iterations?
We can reimplement them, but they won't be more efficient. That
being said using the xas iterator for places that don't need to
unlock works really nicely, and I've added a little syntactic sugar
to make this even nicer as in:
rcu_read_lock();
for_each_perag_marked(mp, pag, XFS_PERAG_RECLAIM_MARK) {
/* do stuff */
}
rcu_read_unlock();
which is about as good as it gets in terms of efficiency and readability.
For the ones that need to sleep I'm now doing:
struct xfs_perag *pag = NULL;
while ((pag = xfs_iwalk_next_ag(mp, pag, XFS_PERAG_BLOCKGC_MARK))) {
/* do stuff */
}
which is also nice, and except for the _MARK stuff due to the sparse
__bitwise annotations can be one in a prep patch.
next prev parent reply other threads:[~2024-08-14 5:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 6:30 conver XFS perag lookup to xarrays Christoph Hellwig
2024-08-12 6:31 ` [PATCH 1/3] xarray: add xa_set Christoph Hellwig
2024-08-12 12:25 ` Matthew Wilcox
2024-08-12 12:28 ` Christoph Hellwig
2024-08-12 6:31 ` [PATCH 2/3] xfs: convert perag lookup to xarray Christoph Hellwig
2024-08-12 14:39 ` Matthew Wilcox
2024-08-12 14:43 ` Christoph Hellwig
2024-08-12 16:39 ` Pankaj Raghav (Samsung)
2024-08-12 19:02 ` Matthew Wilcox
2024-08-13 8:30 ` Pankaj Raghav (Samsung)
2024-08-13 6:37 ` kernel test robot
2024-08-14 4:59 ` Dave Chinner
2024-08-14 5:21 ` Christoph Hellwig [this message]
2024-08-12 6:31 ` [PATCH 3/3] xfs: use kfree_rcu_mightsleep to free the perag structures Christoph Hellwig
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=20240814052111.GA30979@lst.de \
--to=hch@lst.de \
--cc=akpm@linux-foundation.org \
--cc=chandan.babu@oracle.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).