From patchwork Tue Nov 6 21:35:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 10671525 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F243109C for ; Tue, 6 Nov 2018 21:55:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ED0428FE3 for ; Tue, 6 Nov 2018 21:55:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5083B29143; Tue, 6 Nov 2018 21:55:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E80D028FE3 for ; Tue, 6 Nov 2018 21:55:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B372C8830A; Tue, 6 Nov 2018 21:55:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 718C860C46; Tue, 6 Nov 2018 21:55:04 +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 C8CFA180B5B7; Tue, 6 Nov 2018 21:55:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wA6Ld6YI004253 for ; Tue, 6 Nov 2018 16:39:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 330B216D26; Tue, 6 Nov 2018 21:39:06 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from leontynka.twibright.com (ovpn-204-55.brq.redhat.com [10.40.204.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FCDE45B8; Tue, 6 Nov 2018 21:39:02 +0000 (UTC) Received: from debian-a64.vm ([192.168.208.2]) by leontynka.twibright.com with smtp (Exim 4.89) (envelope-from ) id 1gK93r-0005NY-Gw; Tue, 06 Nov 2018 22:39:00 +0100 Received: by debian-a64.vm (sSMTP sendmail emulation); Tue, 06 Nov 2018 22:38:54 +0100 Message-Id: <20181106213854.621440000@debian-a64.vm> User-Agent: quilt/0.65 Date: Tue, 06 Nov 2018 22:35:00 +0100 From: Mikulas Patocka To: Mike Snitzer , "Alasdair G. Kergon" MIME-Version: 1.0 Content-Disposition: inline; filename=dm-dont-rewrite-in_flight.patch X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Mikulas Patocka Subject: [dm-devel] [patch 2/5] dm: dont rewrite dm_disk(md)->part0.in_flight 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 06 Nov 2018 21:55:06 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP generic_start_io_acct and generic_end_io_acct already update the variable in_flight using atomic operations, so we don't have to overwrite them again. Signed-off-by: Mikulas Patocka --- drivers/md/dm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6/drivers/md/dm.c =================================================================== --- linux-2.6.orig/drivers/md/dm.c 2018-10-10 22:24:34.090000000 +0200 +++ linux-2.6/drivers/md/dm.c 2018-10-10 23:06:24.420000000 +0200 @@ -612,8 +612,7 @@ static void start_io_acct(struct dm_io * generic_start_io_acct(md->queue, bio_op(bio), bio_sectors(bio), &dm_disk(md)->part0); - atomic_set(&dm_disk(md)->part0.in_flight[rw], - atomic_inc_return(&md->pending[rw])); + atomic_inc(&md->pending[rw]); if (unlikely(dm_stats_used(&md->stats))) dm_stats_account_io(&md->stats, bio_data_dir(bio), @@ -642,7 +641,6 @@ static void end_io_acct(struct dm_io *io * a flush. */ pending = atomic_dec_return(&md->pending[rw]); - atomic_set(&dm_disk(md)->part0.in_flight[rw], pending); pending += atomic_read(&md->pending[rw^0x1]); /* nudge anyone waiting on suspend queue */