Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp641326pxv; Thu, 15 Jul 2021 12:14:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2J76eAb7rsKSTQZO4LZ7v6VImSsHYWoM1t4FVZQlZbnECP4jjQbq25NjMwytSu/xIPqlu X-Received: by 2002:a05:6402:58:: with SMTP id f24mr9505980edu.234.1626376450375; Thu, 15 Jul 2021 12:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376450; cv=none; d=google.com; s=arc-20160816; b=z+odyo+XIvHng2pOFiUe1PTJsRubuCADfMa1PaNdxvPV/dMPuAtEH/02mI2lfQemTC iXMSY0vgsikx1y89QbFjrE9qFspdqiFmrEtMwzbhu0I1dVeSKIhWjbzK0EwLeZNlLfWl 85gJAcEyiGq5LNwgbtb9TywMfig9Kebfi1+PuyocyNFzWr6ej1NJs0x44Y/nZ4qnjgpW 1YBg/vTC0KJX+RO+5p4nQpfM7B9TKQSafbrXXQL3ymRuMhI1FTMCkAQhYr67pOqfhUXj 07dyNMw/AXtLLg+9tZrHGKOY6UHxvDhu+LnL5O/yi/L+MG/vqM23ivhFgc+fodybbrLT wXbA== 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=9+pGmx9KQFDssM15tULsKGN1PEG6xO2nkI/n9mggt0g=; b=zxLwz2uHtpKjk79WPcOva7YlTJY4oeYYkBL1A3rdPwOgD9J7G0a8aN54ui2HMh6oUO TLmrrt2e+WQqR7QRcdK00eQkbz4EHDjcdLBBODc4iEZmS3xjhgXXD0rpY8emZmHcdWds CRJD8RapbDJLohnEoaxQOAdULzyoc4yd33Ur1UW1GBwGf6FbaUMP4MK1Zy3EKFVODd4F t3RRytnk45AT/Cv2B/30FMAN62S04kcIaQAhvKqdsmiuYuacFHhMU4tiY2BlrN1tOA6l xrdzs8GU8nWRpAqj9UbxHg87U+imWJkLd7XsXoA8fdXFEaWMMIjKSptgCh2ebSI2d3Dp odbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nxuNr3T+; 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 kw23si8543059ejc.414.2021.07.15.12.13.41; Thu, 15 Jul 2021 12:14:10 -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=nxuNr3T+; 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 S242300AbhGOTMM (ORCPT + 99 others); Thu, 15 Jul 2021 15:12:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:37350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243012AbhGOTAJ (ORCPT ); Thu, 15 Jul 2021 15:00:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4910161158; Thu, 15 Jul 2021 18:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375435; bh=7kuPAle+KPL7uygDvyN/+ufX7FKfapEBVkAtmCuLYLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nxuNr3T+oTqKtmQAvjB99+WWCkgp3E2Wqyh4nWY4iPp9EIpIWW4HjagSdIJLh46Z+ v7uShLNgjEZPyKuJxLJSAsHtg3cnouWnRQnJ5X/vd1KqM80JdaU3Vr7TOhkRF+qIF7 JuVtLMfQuDk26OftVA7PwH045IyqcZccfkx5QGbw= 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.12 086/242] dm writecache: commit just one block, not a full page Date: Thu, 15 Jul 2021 20:37:28 +0200 Message-Id: <20210715182608.164155579@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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 7bb4d83e90cc..51b26db56ba9 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