public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: Re: [PATCH 0/2] xfs: CRCs for log buffers
Date: Thu, 8 Nov 2012 11:21:26 +1100	[thread overview]
Message-ID: <20121108002125.GJ6434@dastard> (raw)
In-Reply-To: <1352295452-4726-1-git-send-email-david@fromorbit.com>

On Thu, Nov 08, 2012 at 12:37:30AM +1100, Dave Chinner wrote:
> These patches introduce the first little piece of the CRC picture.
> The first patch introduces the calculation and checking functions,
> as well as the superblock feature bit for CRCs. The superblock bit
> is not set anywhere, not is it really needed for 3.8. There's no
> real harm in introducing it now, and doing so means that the log
> code can demonstrate how it will differentiate between advisory
> warnings and fatal errors on CRC mistmatches during recovery.
> 
> The second patch converts the log checksum code to use the CRCs and
> enables it for *all* filesystems. This can be done because the log
> header already has a CRC field in it, and for production kernels it
> is guaranteed to be zeroed. Hence for production kernels, only
> issuing a CRC mistmatch warning when the log header CRC field is non
> zero means that people can upgrade to a kernel with this
> functionality and not see any CRC mismatch warnings.
> 
> Warnings look like:
> 
> XFS (vda): log record CRC mismatch: found 0xa05866c2, expected 0xd9290110.
> 
> ffffc90001088000: 00 00 00 14 00 00 00 00 69 01 00 00 6e 14 a5 3d  ........i...n..=
> ffffc90001088010: 00 00 00 10 69 00 00 00 4e 41 52 54 2a 00 00 00  ....i...NART*...
> 
> 
> The only issue with this is that filesystems that were not cleanly
> shut down on debug kernels will throw CRC mismatch warnings the
> first time the are recovered after mount. After the first mount on
> upgrade, the warnings won't happen again unless you downgrade to an
> older debug kernel. I don't see this as a major problem - debug
> kernels are not used in production, and anyone using a debug kernel
> should be following this mailing list. ;)
> 
> Anyway, the overhead is negliable - I don't see any measurable
> impact on metadata heavy operations (cpu verhead or performance),
> and the benefits of even advisory warnings on production kernels are
> of significant benefit. e.g. the recent log buffer wrap recovery
> problem would have triggered a CRC mismatch warning long before
> the bad client id error was detected....

FWIW, perf indicates that the CPU overhead of the CRC overhead when
unlinking files at around 60,000/s - a log write rate of about
15MB/s - is:

0.25%  [kernel]  [k] __crc32c_le

When creating files at around 90,000/s, the log write rate is
~40-50MB/s, and the CPU overhead is:

0.74%  [kernel]  [k] __crc32c_le

So roughly linear scaling of about 0.15% of 8p per 10MB/s. On a
single CPU, that would be 1% CPU overhead per 10MB/s of log
throughput.

This was measured inside a VM running on a 2.5 year old 2.26GHz
Xeon. The VM does not assert the sse4_2 cpu feature, so can not use
the special CPU instruction to calculate the CRC as efficiently as
the hardware allows....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  parent reply	other threads:[~2012-11-08  0:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 13:37 [PATCH 0/2] xfs: CRCs for log buffers Dave Chinner
2012-11-07 13:37 ` [PATCH 1/2] xfs: add CRC infrastructure Dave Chinner
2012-11-07 16:21   ` Andi Kleen
2012-11-07 20:31     ` Dave Chinner
2012-11-07 21:39       ` Andi Kleen
2012-11-07 22:28         ` Dave Chinner
2012-11-08 14:42   ` Mark Tinguely
2012-11-08 21:22     ` Dave Chinner
2012-11-09 22:09   ` Mark Tinguely
2012-11-11  1:26     ` Dave Chinner
2012-11-11 19:54       ` Mark Tinguely
2012-11-11 22:51         ` Dave Chinner
2012-11-07 13:37 ` [PATCH 2/2] xfs: add CRC checks to the log Dave Chinner
2012-11-11 19:57   ` Mark Tinguely
2012-11-08  0:21 ` Dave Chinner [this message]
2012-11-09  0:05 ` [PATCH 0/2] xfs: CRCs for log buffers 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=20121108002125.GJ6434@dastard \
    --to=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