From patchwork Tue Jun 2 13:34:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 11583867 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 270A1739 for ; Tue, 2 Jun 2020 13:37:48 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D789520663 for ; Tue, 2 Jun 2020 13:37:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="enM+Zcpc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D789520663 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591105066; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=aalfDCQwPh4HB/XvzVkH6pP61Do9rUB23SGHPhgNUus=; b=enM+Zcpc/e3SkIzgSnbuOYaXFBL9/ioNvGT26G+JWxuxR/sIocJddttTboEn+5b6iUUB2U NWwGla2+0EjhjoSdVgkGNGmxgq12IBvwenGm+VcOEgXW8V8HIMM2TjOuPKaDoIOxAIlCKu /XtJaGbxRIdCfRBoAuD2vgKEYh5xdYc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-221-gMRLTY-wOC-uVqcpj_u2-g-1; Tue, 02 Jun 2020 09:37:44 -0400 X-MC-Unique: gMRLTY-wOC-uVqcpj_u2-g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08AA81800D42; Tue, 2 Jun 2020 13:37:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0D627E7F9; Tue, 2 Jun 2020 13:37:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6259F93515; Tue, 2 Jun 2020 13:37:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 052DZG9x007910 for ; Tue, 2 Jun 2020 09:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 61CFF78F04; Tue, 2 Jun 2020 13:35:16 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from leontynka.twibright.com (unknown [10.40.194.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2389A6C776; Tue, 2 Jun 2020 13:35:16 +0000 (UTC) Received: from debian-a64.vm ([192.168.208.2]) by leontynka.twibright.com with smtp (Exim 4.92) (envelope-from ) id 1jg74T-0003XG-MX; Tue, 02 Jun 2020 15:35:14 +0200 Received: by debian-a64.vm (sSMTP sendmail emulation); Tue, 02 Jun 2020 15:35:13 +0200 Message-Id: <20200602133513.046607000@debian-a64.vm> User-Agent: quilt/0.65 Date: Tue, 02 Jun 2020 15:34:41 +0200 From: Mikulas Patocka To: Mike Snitzer , Heinz Mauelshagen MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Mikulas Patocka Subject: [dm-devel] [PATCH 3/3] dm-ebs: use dm_bufio_forget_buffers X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk 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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline; filename=dm-ebs-forget-buffers.patch Use dm_bufio_forget_buffers instead of block-by-block loop and dm_bufio_forget. dm_bufio_forget_buffers is faster than the loop because it searches for used buffers using rb-tree. Signed-off-by: Mikulas Patocka --- drivers/md/dm-ebs-target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6/drivers/md/dm-ebs-target.c =================================================================== --- linux-2.6.orig/drivers/md/dm-ebs-target.c 2020-06-02 13:27:14.000000000 +0200 +++ linux-2.6/drivers/md/dm-ebs-target.c 2020-06-02 15:11:18.000000000 +0200 @@ -167,8 +167,8 @@ static void __ebs_forget_bio(struct ebs_ sector_t blocks, sector = bio->bi_iter.bi_sector; blocks = __nr_blocks(ec, bio); - for (; blocks--; sector += ec->u_bs) - dm_bufio_forget(ec->bufio, __sector_to_block(ec, sector)); + + dm_bufio_forget_buffers(ec->bufio, __sector_to_block(ec, sector), blocks); } /* Worker funtion to process incoming bios. */