Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp655044pxv; Thu, 15 Jul 2021 12:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjW7yHOk9aCG+VedyEVVE5H2ysKiAfmS7+A9IasVVgqVWxGn10/aNll+15mPi/ghF4cYDO X-Received: by 2002:a17:906:8313:: with SMTP id j19mr7398553ejx.548.1626377775047; Thu, 15 Jul 2021 12:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377775; cv=none; d=google.com; s=arc-20160816; b=zcaJVzgdDpirH0igi9UwzAn3J0KpiazekMmrSCrPEfAi+Euk+L4x7QLnkROlnWUHfi CykYkdf13Aei6PqndyM1mmq9i1sgKpBbt5lYCNoaO9fxCsiWjC5OusWzQ3uLhD1utykM 0OT9oaTt06Nvl5YbBMl9ftfyxmRcEFT//ePrsMjm3Y5fhkAVzZ0DsIAE4XxgHR3zIJra 2qzos69fZ81rtnnnlH6BtkrPQAeQ/rr9riGuqejjvzhJgp6NGJuHvPnmdb4tXV2h7Jon VVAKZRRWGyj8VdTltmmMHmIwX0+jcqThWCpcT7tdHtXdR7mu/e0QoM1BWWdEmZo0Ccuz MvZQ== 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=4Pl/t8MVZA0I4zlSAL6bDTDlKXdCFFTA5aGLwL3YTGs=; b=aw89NfnDX3PoI/sPVvD4ha2UfqCgnhtQZLR8B5Shp8xe6QEOA508Oh1w+9qzGhrCiJ Z9vVMxEzH2Nh7Lpdh5Xmr6c4rfLbh5/MNWf3VnIId5BCiQVFZV23AZ8WD5QOrzvvWP7b iru5EBBW53KEu2xIELlyaRf6NVNPuYtpwthplPDtfM0Gq0MyWQBVTg7LRrb7k7dAgDyA rl5GgCj9P3snk2VuWBZGHKrliwujcZ0chv1vfDS/EtjS2AiKVqjmlWmBJce0jIZZi/Gk agTgfLABrCoNxvktEgsTC0kaWV1SoP5OAwvsi9/LrDGWia05MaJ1qjCzjKKo/TRz8ex6 hklg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aX9zF+Wh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si8929232edv.125.2021.07.15.12.35.50; Thu, 15 Jul 2021 12:36:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aX9zF+Wh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S243828AbhGOTcb (ORCPT + 99 others); Thu, 15 Jul 2021 15:32:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:46196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243958AbhGOTK0 (ORCPT ); Thu, 15 Jul 2021 15:10:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 27176601FE; Thu, 15 Jul 2021 19:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376040; bh=cbkPRo7+rmemS45wzv8CpoNtvxdeDeakDfFzCFdruQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aX9zF+WhLzDTsGZGbwat+TDdjtbRmiQoAxMX5HQ1RTWQ04E910mKJf0QTV9Dal9+4 ljozfpiSKNKdLxW4hHgI23OeusNoWu2ZBqkoqz0JbJxq4DVoIK2NJRCOMRigX6euYa odOSygQAE4GaO2R/SWvxnWENU6gmZ2asS2Wci9w4= 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.13 100/266] dm writecache: commit just one block, not a full page Date: Thu, 15 Jul 2021 20:37:35 +0200 Message-Id: <20210715182631.681005995@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka [ Upstream commit 991bd8d7bc78966b4dc427b53a144f276bffcd52 ] Some architectures have pages larger than 4k and committing a full page causes needless overhead. Fix this by writing a single block when committing the superblock. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-writecache.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index a44007297e63..0e3a6c4bd5e3 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -532,11 +532,7 @@ static void ssd_commit_superblock(struct dm_writecache *wc) region.bdev = wc->ssd_dev->bdev; region.sector = 0; - region.count = PAGE_SIZE >> SECTOR_SHIFT; - - if (unlikely(region.sector + region.count > wc->metadata_sectors)) - region.count = wc->metadata_sectors - region.sector; - + region.count = wc->block_size >> SECTOR_SHIFT; region.sector += wc->start_sector; req.bi_op = REQ_OP_WRITE; -- 2.30.2