From patchwork Wed Jul 15 08:17:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 11664389 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 3DADC722 for ; Wed, 15 Jul 2020 08:18:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 942162067D for ; Wed, 15 Jul 2020 08:18:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 942162067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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-202-s3OGfy-5OXuhuPjxDqatbA-1; Wed, 15 Jul 2020 04:18:15 -0400 X-MC-Unique: s3OGfy-5OXuhuPjxDqatbA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEA951009633; Wed, 15 Jul 2020 08:18:09 +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 C8A222B6F0; Wed, 15 Jul 2020 08:18:08 +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 733BC96226; Wed, 15 Jul 2020 08:18:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06F8I4Ta029858 for ; Wed, 15 Jul 2020 04:18:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id E2D9120A8C46; Wed, 15 Jul 2020 08:18:03 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE3952026D5D for ; Wed, 15 Jul 2020 08:18:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0D0EE833B7E for ; Wed, 15 Jul 2020 08:18:01 +0000 (UTC) Received: from mx2.suse.de (195.135.220.15 [195.135.220.15]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-375-rfoEsqg_P_aW5UqyZxbKCA-1; Wed, 15 Jul 2020 04:17:58 -0400 X-MC-Unique: rfoEsqg_P_aW5UqyZxbKCA-1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2B4CDAEAA; Wed, 15 Jul 2020 08:18:00 +0000 (UTC) From: Hannes Reinecke To: Mike Snitzer Date: Wed, 15 Jul 2020 10:17:52 +0200 Message-Id: <20200715081752.28130-1-hare@suse.de> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: dm-devel@redhat.com Cc: Damien LeMoal , dm-devel@redhat.com Subject: [dm-devel] [PATCH] dm zoned: update atime for new buffer zones 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: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com When a new buffer zone is allocated in dmz_handle_buffered_write() we should update the 'atime' to inform reclaim that this zone has been accessed. Otherwise we end up with the pathological case where the first write allocates a new buffer zone, but the next write will start reclaim before processing the bio. As the atime is not set reclaim declares the system idle and reclaims the zone. Then the write will be processed and re-allocate the very same zone again; this repeats for every consecutive write, making for a _very_ slow mkfs. Signed-off-by: Hannes Reinecke --- drivers/md/dm-zoned-target.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index cf915009c306..b32d37bef14f 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c @@ -297,6 +297,9 @@ static int dmz_handle_buffered_write(struct dmz_target *dmz, if (dmz_is_readonly(bzone)) return -EROFS; + /* Tell reclaim we're doing some work here */ + dmz_reclaim_bio_acc(bzone->dev->reclaim); + /* Submit write */ ret = dmz_submit_bio(dmz, bzone, bio, chunk_block, nr_blocks); if (ret)