From patchwork Wed Oct 3 12:35:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 10624757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50F72174A for ; Wed, 3 Oct 2018 12:35:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4103128AD3 for ; Wed, 3 Oct 2018 12:35:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3512828B1B; Wed, 3 Oct 2018 12:35:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E496728AD3 for ; Wed, 3 Oct 2018 12:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbeJCTYC (ORCPT ); Wed, 3 Oct 2018 15:24:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726547AbeJCTYB (ORCPT ); Wed, 3 Oct 2018 15:24:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 55CF330026A7 for ; Wed, 3 Oct 2018 12:35:49 +0000 (UTC) Received: from odin.usersys.redhat.com (unknown [10.40.205.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 131D45D6A6 for ; Wed, 3 Oct 2018 12:35:47 +0000 (UTC) From: Carlos Maiolino To: linux-xfs@vger.kernel.org Subject: [PATCH 1/2] xfs: Fix xqmstats offsets in /proc/fs/xfs/xqmstat Date: Wed, 3 Oct 2018 14:35:36 +0200 Message-Id: <20181003123537.30965-2-cmaiolino@redhat.com> In-Reply-To: <20181003123537.30965-1-cmaiolino@redhat.com> References: <20181003123537.30965-1-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 03 Oct 2018 12:35:49 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The addition of FIBT, RMAP and REFCOUNT changed the offsets into __xfssats structure. Although this didn't cause any direct issue, xqmstat_proc_show() relied on the old offsets to display the xqm statistics. Fix it. Signed-off-by: Carlos Maiolino Reviewed-by: Eric Sandeen --- fs/xfs/xfs_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_stats.c b/fs/xfs/xfs_stats.c index 4e4423153071..740ac9674848 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_IBT_V2; j < XFSSTAT_END_XQMSTAT; j++) + for (j = XFSSTAT_END_REFCOUNT; j < XFSSTAT_END_XQMSTAT; j++) seq_printf(m, " %u", counter_val(xfsstats.xs_stats, j)); seq_putc(m, '\n'); return 0; From patchwork Wed Oct 3 12:35:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 10624759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64F4114BD for ; Wed, 3 Oct 2018 12:35:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5255028AD3 for ; Wed, 3 Oct 2018 12:35:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 466FA28B1B; Wed, 3 Oct 2018 12:35:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E20F928AD3 for ; Wed, 3 Oct 2018 12:35:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726755AbeJCTYD (ORCPT ); Wed, 3 Oct 2018 15:24:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58830 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726547AbeJCTYC (ORCPT ); Wed, 3 Oct 2018 15:24:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A0DE7F3EC for ; Wed, 3 Oct 2018 12:35:50 +0000 (UTC) Received: from odin.usersys.redhat.com (unknown [10.40.205.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEEF15D786 for ; Wed, 3 Oct 2018 12:35:49 +0000 (UTC) From: Carlos Maiolino To: linux-xfs@vger.kernel.org Subject: [PATCH 2/2] xfs: Add new constant to mark start of xqmstat Date: Wed, 3 Oct 2018 14:35:37 +0200 Message-Id: <20181003123537.30965-3-cmaiolino@redhat.com> In-Reply-To: <20181003123537.30965-1-cmaiolino@redhat.com> References: <20181003123537.30965-1-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 03 Oct 2018 12:35:50 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Carlos Maiolino --- 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;