From patchwork Thu May 9 20:44:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 2545681 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork2.kernel.org (Postfix) with ESMTP id C2CD3DF24C for ; Thu, 9 May 2013 20:47:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r49KiihH017965; Thu, 9 May 2013 16:44:45 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r49KihV7029895 for ; Thu, 9 May 2013 16:44:43 -0400 Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.16]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r49Kih5K009205; Thu, 9 May 2013 16:44:43 -0400 Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r49KigWs030604; Thu, 9 May 2013 16:44:42 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r49Kie33008577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 May 2013 20:44:41 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r49Kid9T023936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 9 May 2013 20:44:40 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r49KidWr004697; Thu, 9 May 2013 20:44:39 GMT Received: from localhost (/10.145.179.107) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 May 2013 13:44:39 -0700 Date: Thu, 9 May 2013 13:44:38 -0700 From: "Darrick J. Wong" To: Mike Snitzer Message-ID: <20130509204437.GA5712@blackbox.djwong.org> References: <20130508214845.GA7729@blackbox.djwong.org> <20130508220526.GA24132@redhat.com> <20130509203616.GA5713@blackbox.djwong.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130509203616.GA5713@blackbox.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-RedHat-Spam-Score: -105.458 (BAYES_00, DCC_REPUT_13_19, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_IN_WHITELIST) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.16 X-loop: dm-devel@redhat.com Cc: device-mapper development , Joe Thornber , linux-kernel@vger.kernel.org Subject: [dm-devel] [PATCH 1/2] dmcache: flush superblock stats when retrieving status info X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com When userspace queries dmcache for stats info, we should ensure that all the metadata gets flushed out of memory to disk. The current code neglects to update the disk copy of the hit/miss counters. Signed-off-by: Darrick J. Wong --- drivers/md/dm-cache-target.c | 1 + 1 file changed, 1 insertion(+) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 1074409..4fb7b4c 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -2451,6 +2451,7 @@ static void cache_status(struct dm_target *ti, status_type_t type, case STATUSTYPE_INFO: /* Commit to ensure statistics aren't out-of-date */ if (!(status_flags & DM_STATUS_NOFLUSH_FLAG) && !dm_suspended(ti)) { + save_stats(cache); r = dm_cache_commit(cache->cmd, false); if (r) DMERR("could not commit metadata for accurate status");