From: Eric Sandeen <sandeen@sandeen.net>
To: Carlos Maiolino <cmaiolino@redhat.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: Add new constant to mark start of xqmstat
Date: Wed, 3 Oct 2018 07:51:43 -0500 [thread overview]
Message-ID: <eacf197c-98d7-4507-a40f-cf32d49bb5eb@sandeen.net> (raw)
In-Reply-To: <20181003123537.30965-3-cmaiolino@redhat.com>
On 10/3/18 7:35 AM, Carlos Maiolino wrote:
> xqmstat information under __xfsstats is used directly by the
> /proc/fs/xfs/xqmstat show method, which makes use of struct offsets to
> print out the values.
>
> Currently, the function is setup to start printing values from the offset of
> the last marker before xqmstat, so, an update to __xfsstats structure
> may also require an update of xqmstat_proc_show() function.
>
> By adding a new constant, we concentrate any updates do __xfsstats
> structure fields locally to the file xfs_stats.h, reducing the
> likelyhood of future bugs if an update to xqmstat_proc_show is
> forgotten as have happened before.
did
BUILD_BUG_ON(offsetof(struct __xfsstats, xs_qm_dqreclaims)/sizeof(uint32_t)) != XFSSTAT_START_XQMSTAT);
and/or
#define XFSSTAT_START_XQMSTAT (offsetof(struct __xfsstats, xs_qm_dqreclaims)/sizeof(uint32_t))
not work out?
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> fs/xfs/xfs_stats.c | 2 +-
> fs/xfs/xfs_stats.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_stats.c b/fs/xfs/xfs_stats.c
> index 740ac9674848..09121c36a062 100644
> --- a/fs/xfs/xfs_stats.c
> +++ b/fs/xfs/xfs_stats.c
> @@ -119,7 +119,7 @@ static int xqmstat_proc_show(struct seq_file *m, void *v)
> int j;
>
> seq_printf(m, "qm");
> - for (j = XFSSTAT_END_REFCOUNT; j < XFSSTAT_END_XQMSTAT; j++)
> + for (j = XFSSTAT_START_XQMSTAT; j < XFSSTAT_END_XQMSTAT; j++)
> seq_printf(m, " %u", counter_val(xfsstats.xs_stats, j));
> seq_putc(m, '\n');
> return 0;
> diff --git a/fs/xfs/xfs_stats.h b/fs/xfs/xfs_stats.h
> index 130db070e4d8..102e794addac 100644
> --- a/fs/xfs/xfs_stats.h
> +++ b/fs/xfs/xfs_stats.h
> @@ -147,6 +147,7 @@ struct __xfsstats {
> uint32_t xs_rmap_2[__XBTS_MAX];
> #define XFSSTAT_END_REFCOUNT (XFSSTAT_END_RMAP_V2 + __XBTS_MAX)
> uint32_t xs_refcbt_2[__XBTS_MAX];
> +#define XFSSTAT_START_XQMSTAT XFSSTAT_END_REFCOUNT
> #define XFSSTAT_END_XQMSTAT (XFSSTAT_END_REFCOUNT + 6)
> uint32_t xs_qm_dqreclaims;
> uint32_t xs_qm_dqreclaim_misses;
>
next prev parent reply other threads:[~2018-10-03 19:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-03 12:35 [PATCH 0/2] xfs stats fixes Carlos Maiolino
2018-10-03 12:35 ` [PATCH 1/2] xfs: Fix xqmstats offsets in /proc/fs/xfs/xqmstat Carlos Maiolino
2018-10-03 12:47 ` Eric Sandeen
2018-10-03 13:39 ` Carlos Maiolino
2018-10-03 13:59 ` Eric Sandeen
2018-10-04 8:01 ` Carlos Maiolino
2018-10-03 15:18 ` Darrick J. Wong
2018-10-03 15:20 ` Darrick J. Wong
2018-10-03 12:35 ` [PATCH 2/2] xfs: Add new constant to mark start of xqmstat Carlos Maiolino
2018-10-03 12:51 ` Eric Sandeen [this message]
2018-10-03 14:00 ` Carlos Maiolino
2018-10-03 14:04 ` Eric Sandeen
2018-10-03 23:09 ` Dave Chinner
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=eacf197c-98d7-4507-a40f-cf32d49bb5eb@sandeen.net \
--to=sandeen@sandeen.net \
--cc=cmaiolino@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;
as well as URLs for NNTP newsgroup(s).