From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: reduce free inode accounting overhead
Date: Tue, 19 May 2020 23:56:04 -0700 [thread overview]
Message-ID: <20200520065604.GB25811@infradead.org> (raw)
In-Reply-To: <20200519214840.2570159-3-david@fromorbit.com>
On Wed, May 20, 2020 at 07:48:40AM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> Shaokun Zhang reported that XFs was using substantial CPU time in
s/XFs/XFS/
> if (idelta) {
> - error = xfs_mod_icount(mp, idelta);
> - ASSERT(!error);
> + percpu_counter_add_batch(&mp->m_icount, idelta,
> + XFS_ICOUNT_BATCH);
> + if (idelta < 0)
> + ASSERT(__percpu_counter_compare(&mp->m_icount, 0,
> + XFS_ICOUNT_BATCH) >= 0);
> }
>
> if (ifreedelta) {
> - error = xfs_mod_ifree(mp, ifreedelta);
> - ASSERT(!error);
> + percpu_counter_add(&mp->m_ifree, ifreedelta);
> + if (ifreedelta < 0)
> + ASSERT(percpu_counter_compare(&mp->m_ifree, 0) >= 0);
I'd be tempted to just remove the ASSERTS entirely, as they are still
pretty heavy handed for debug kernels.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2020-05-20 6:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 21:48 [PATCH 0/2] xfs: fix unecessary percpu counter overhead Dave Chinner
2020-05-19 21:48 ` [PATCH 1/2] xfs: gut error handling in xfs_trans_unreserve_and_mod_sb() Dave Chinner
2020-05-20 6:53 ` Christoph Hellwig
2020-05-20 7:03 ` Dave Chinner
2020-05-20 7:33 ` [PATCH 1/2 V2] " Dave Chinner
2020-05-20 7:48 ` Christoph Hellwig
2020-05-20 20:27 ` Darrick J. Wong
2020-05-20 21:55 ` Dave Chinner
2020-05-20 22:28 ` Darrick J. Wong
2020-05-20 22:37 ` Dave Chinner
2020-05-19 21:48 ` [PATCH 2/2] xfs: reduce free inode accounting overhead Dave Chinner
2020-05-20 6:56 ` Christoph Hellwig [this message]
2020-05-20 20:43 ` 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=20200520065604.GB25811@infradead.org \
--to=hch@infradead.org \
--cc=david@fromorbit.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