Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2927783rwb; Mon, 15 Aug 2022 14:13:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR6XxYVfhHHzzNahYZ+qFVKQHfPqnpSCEd5inPTyhfGwL/3tE7LZEg5vqS8WRajxfBlvxal2 X-Received: by 2002:a17:90a:1b65:b0:1f7:4725:aa6e with SMTP id q92-20020a17090a1b6500b001f74725aa6emr19828709pjq.179.1660597995626; Mon, 15 Aug 2022 14:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597995; cv=none; d=google.com; s=arc-20160816; b=DolB8KEkdUh5b3fRArX8ex3ROtR/rYQV7eQluobeEuVJy1QZUgQMRUrE/UxPnI4sPN 2/x7HZEYvdUHhNRl/RjhD/yWAeNak7qezuFwmzq2GlPVGan/pbN5kt/QR7Tf1I4836Pl 2/SehVj9nXlTh9stuXWNtlJHJo0vWghZ2rwpOdomf8aMfihCwgjKJmgQ7vGicu1Oliu4 GAcdQCf2NcseKibzgdTlhyabQKS1fNtxOxmNt+G+sQ1a1oMDyAV5B/r1oiPIN4Wdpyq8 Ck6F63rXm/ZyKtUj+fH/pOKjRN1J0DOxutnKnvde4CU2X/jjSvCc4nv/tlFXK79PXojc Szeg== 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=/0Mwcpip3lc9zdnEt2AMPOTCjQeNjhA9w2EpSps/ydM=; b=bn9uIrU8FzgCGqo6rKAA7p5vwNxMw7WdzE98kXLGkQ6ha6ViCDIQ6vG88KQTn83TqW ypfzJIRYye4xtcs8z2Bh7DB6L8D433uUGffd+L9B4hs3zknhhWLcQeCCYqDt8GinGOrQ MYiDJFuT2C58ICVIkhMUkBev/fs2Zs78TPlGu8x08iH9ueX5UesWs/EqRw8AqdFSLJ2P RfDFlHsy/ZUZ3xBlCNSo5qPMi2PqQkdud9NGSb0+hPqwoxmsMC2oylGUBqsVQFVPIPab YDEShCE1M+hUa4ecX2lrAqthxyYXAV3k1QLUH0bpqCYDbZjDSsAtqu1Qe8cwBBuAKmSG dUfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zkuzDjsf; 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 k9-20020a170902ba8900b0016d572aa821si9629904pls.268.2022.08.15.14.13.04; Mon, 15 Aug 2022 14:13:15 -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=zkuzDjsf; 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 S1346077AbiHOUrV (ORCPT + 99 others); Mon, 15 Aug 2022 16:47:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344933AbiHOUpa (ORCPT ); Mon, 15 Aug 2022 16:45:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75C9BB5E7E; Mon, 15 Aug 2022 12:08:17 -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 ams.source.kernel.org (Postfix) with ESMTPS id CB3BDB81106; Mon, 15 Aug 2022 19:08:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19853C433C1; Mon, 15 Aug 2022 19:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590494; bh=VgMoTdeM27KVRPXO4E7YPhY2Lw8hSEWmBEss6I8f9bw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zkuzDjsflpkzmchny+a8FdG8ff9zXnCAQzepkIsmDl8w16QQPWiD+h5QdTK5h9cjB kByDvqVGOIGvRksUoFCbkcZJdZZL7kMAVd7UKlRihtb4cI7wEohig3ZLNH3y1RbBPP Z+MPBraf3h+HcKfHrVIBizPyFXR7tAk1CUAmc+YY= 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.18 0278/1095] dm writecache: count number of blocks discarded, not number of discard bios Date: Mon, 15 Aug 2022 19:54:37 +0200 Message-Id: <20220815180441.281543770@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 98df6327990a..e5acb393f70b 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -1513,7 +1513,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