From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs_repair: multithread phase 2
Date: Tue, 4 Jan 2011 05:02:40 -0500 [thread overview]
Message-ID: <20110104100240.GB26885@infradead.org> (raw)
In-Reply-To: <1294121588-17233-1-git-send-email-david@fromorbit.com>
> This patch uses 32-way threading which results in no noticable
> slowdown on single SATA drives with NCQ, but results in ~10x
> reduction in runtime on a 12 disk RAID-0 array.
Shouldn't we have at least an option to allow tuning this value,
similar to the ag_stride? In fact I wonder why phase 3/4 should
use different values for it than phase2.
> @@ -75,8 +80,10 @@ scan_sbtree(
> xfs_agblock_t bno,
> xfs_agnumber_t agno,
> int suspect,
> - int isroot),
> - int isroot)
> + int isroot,
> + struct aghdr_cnts *agcnts),
> + int isroot,
> + struct aghdr_cnts *agcnts)
Please make this a
void *priv
to keep scan_sbtree generic.
> void
> +scanfunc_bno(
> + struct xfs_btree_block *block,
> + int level,
> + xfs_agblock_t bno,
> + xfs_agnumber_t agno,
> + int suspect,
> + int isroot,
> + struct aghdr_cnts *agcnts)
> +{
> + return scanfunc_allocbt(block, level, bno, agno,
> + suspect, isroot, XFS_ABTB_MAGIC, agcnts);
> +}
Now that we have private data bassed to the scanfuncs we could use that
to communicate if we're doing a bno or cnt scan. Maybe writing it
directly into struct aghdr_cnts is too ugly, in that case we can have
a scan_priv structure that contains the magic and the aghdr_cnts.
>
> void
> scan_freelist(
This could become static.
> * Scan an AG for obvious corruption.
> *
> * Note: This code is not reentrant due to the use of global variables.
That's not true any more I think.
> */
> -void
> -scan_ag(
> - xfs_agnumber_t agno)
> +void *
> +scan_ag(void *args)
Can be static.
> +#define SCAN_THREADS 32
> +
> +void
> +scan_ags(
> + struct xfs_mount *mp)
> +{
> + struct aghdr_cnts agcnts[mp->m_sb.sb_agcount];
> + pthread_t thr[SCAN_THREADS];
> + __uint64_t fdblocks = 0;
> + __uint64_t icount = 0;
> + __uint64_t ifreecount = 0;
> + int i, j, err;
> +
> + /*
> + * scan a few AGs in parallel. The scan is IO latency bound,
> + * so running a few at a time will speed it up significantly.
> + */
> + for (i = 0; i < mp->m_sb.sb_agcount; i += SCAN_THREADS) {
I think this should use the workqueues from repair/threads.c. Just
create a workqueue with 32 threads, and then enqueue all the AGs.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2011-01-04 10:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 6:13 [PATCH] xfs_repair: multithread phase 2 Dave Chinner
2011-01-04 10:02 ` Christoph Hellwig [this message]
2011-01-04 12:00 ` Dave Chinner
2011-01-05 23:42 ` Alex Elder
-- strict thread matches above, loose matches on Subject: below --
2011-01-10 0:44 Dave Chinner
2011-01-10 7:57 ` Michael Monnerie
2011-01-10 8:41 ` Dave Chinner
2011-01-10 13:25 ` Michael Monnerie
2011-01-10 19:18 ` Christoph Hellwig
2011-01-10 19:17 ` Christoph Hellwig
2011-01-10 21:53 ` Matthias Schniedermeyer
2011-01-10 18:55 ` Christoph Hellwig
2011-02-01 23:39 ` Alex Elder
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=20110104100240.GB26885@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