Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3029665rwb; Mon, 15 Aug 2022 16:28:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4nP1MDj/qw3I7p6t1nIRuYPsxDZLxRk+zkF78JnBzAWeZKiPYkPJkGUGUzHvAzluzthoBb X-Received: by 2002:a17:902:c1c4:b0:171:38ab:e761 with SMTP id c4-20020a170902c1c400b0017138abe761mr19921358plc.65.1660606114649; Mon, 15 Aug 2022 16:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660606114; cv=none; d=google.com; s=arc-20160816; b=djM+yFFqUtIlItHAovtKnrJ3bm28jTQh1+XiwJxx+ACD7yhctRwMOrRBe510WEe7W1 KkVA3E8OiDM4EQuuwdflVkknmcJvcseiV/Cf+IIUrt6cQX4tIxhWqOvxJthYJEN1rjym aeR5I23/Vi/aT73UY3n76xYcsWwoTJYRltPc2Ww63Y3Y5oxzrzFpft3G+Umcf0nJSLz6 v58QfbQX3LHbwV2wjBevrkoLVazT87q6zqpaOgxNO2XG8AQQGTusADhppTEqdsS3LMQb C26A5FaYjADbczDpqoOpys+1ZrB5kCax1R4OQ09dQwY4hyMM14KGV3uUZ9qcFcNWSihV yVPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8heG9GV25aoAWQDvjC25ARzwNZsiTFeN4OqelAjTmFM=; b=RQg6At1++Rs6oo17UPTBBHW8OMVCVjMv6AWuv7yN0DontO0zh4Xq8A5TJ+x0Qw45Tk kWvv2B6KmkHbi8mfYNQajThj2mHbAa1fa+CHHSYTxmXHiDQYXtp4xbXaLu13LDq6LRtK /jNYUjQtyjVnZZmZBEYjgjanuQAUQoie0o3n8HR8SN3JzEyjNU8flrCJc8Q/WTm8M5oO CM82iF6QtuAqNYjcqbsVEpRMsT1qKg+4PVIB6meXerP3pzCBPrKre2ugEdtHua2S+7tu RVzmzLqxo1FDsZE6NeyMIObgDGKI7WyTHPGexQJuLa+NEm+20WN9JDOyaJxVRnVDalnY iZ+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vv1i0sNl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 28-20020a630c5c000000b0041a3744910dsi12349945pgm.48.2022.08.15.16.28.23; Mon, 15 Aug 2022 16:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vv1i0sNl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245461AbiHOXRa (ORCPT + 99 others); Mon, 15 Aug 2022 19:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346380AbiHOXO0 (ORCPT ); Mon, 15 Aug 2022 19:14:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3A3079A72; Mon, 15 Aug 2022 13:01:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AD1BC612B9; Mon, 15 Aug 2022 20:01:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4A48C433D7; Mon, 15 Aug 2022 20:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593690; bh=XSbGAAKBx6WpXWobFza0TGpTgiFN3vMeX8OvdglASHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vv1i0sNl6GyoL2SbyCk+7UjqyN0GWJFeMMT60n/vP2vHnieO4oPxi6FoqgDEdSTou W2J0O5wbSX3MoVRvZNxIp2YR112iqDT25TA1AGpo4LGXGsyCjcOLKaA696RKt0oU0I HFsJriP8FmTsXNrspbCdaJwSk29+RRz5LZcaX9h8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikulas Patocka , Mike Snitzer , Sasha Levin Subject: [PATCH 5.19 0279/1157] dm writecache: count number of blocks discarded, not number of discard bios Date: Mon, 15 Aug 2022 19:53:55 +0200 Message-Id: <20220815180450.772707980@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka [ Upstream commit 2ee73ef60db4d79b9f9b8cd501e8188b5179449f ] Change dm-writecache, so that it counts the number of blocks discarded instead of the number of discard bios. Make it consistent with the read and write statistics counters that were changed to count the number of blocks instead of bios. Fixes: e3a35d03407c ("dm writecache: add event counters") Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- Documentation/admin-guide/device-mapper/writecache.rst | 2 +- drivers/md/dm-writecache.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/device-mapper/writecache.rst b/Documentation/admin-guide/device-mapper/writecache.rst index 6c9a2c74df8a..724e028d1858 100644 --- a/Documentation/admin-guide/device-mapper/writecache.rst +++ b/Documentation/admin-guide/device-mapper/writecache.rst @@ -87,7 +87,7 @@ Status: 11. the number of write blocks that are allocated in the cache 12. the number of write requests that are blocked on the freelist 13. the number of flush requests -14. the number of discard requests +14. the number of discarded blocks Messages: flush diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index d1dca8f44028..b4d5bab8d68b 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -1514,7 +1514,7 @@ static enum wc_map_op writecache_map_flush(struct dm_writecache *wc, struct bio static enum wc_map_op writecache_map_discard(struct dm_writecache *wc, struct bio *bio) { - wc->stats.discards++; + wc->stats.discards += bio->bi_iter.bi_size >> wc->block_size_bits; if (writecache_has_error(wc)) return WC_MAP_ERROR; -- 2.35.1