Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2338877imm; Thu, 9 Aug 2018 11:07:41 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzmdsPJCMqJhqIZGaSfK8yv52ukZQ3Od/EihaUR4uG5Tp1xd7JGPAV6OczdIOSvOMSVev4Z X-Received: by 2002:a17:902:2ac3:: with SMTP id j61-v6mr2941566plb.172.1533838061647; Thu, 09 Aug 2018 11:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533838061; cv=none; d=google.com; s=arc-20160816; b=qbeRNtmp1B6Q/EE/5V87/2jlL5MRGajeerv33qPcT0wjioF1KdoP9Cdakh3BkO9E/F /9EVbFpKtBcsitECV5LIVE47HaPgH0bm7i2uI5+cXn3yZmc3iu1SJ6/SC4TdBPcAPsGu YI1Cbe0VxLHWeumv2MxnDH/WC8xEIlVcH+Pyn/gmG/x9N6YD7EhAgJQ8D/mYU3NDx9e6 O/aNRWFEBvzDoC0zquNSf2IGy0Npw7Z0xwb9eS4ZRoOQUhDss56m44EBC7g3G9bZY2V/ GDNkpuB+dx1hEgVjVjujDbRslxYMrbL56fc9mAnLtpRjQfw5VAhZlVth9o76hGL2upaP No8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/GURDllLYMHk2phIf3qJDu1l3AZY/16TJzzt0itEyGw=; b=WnCVLgZtbzxU/EA0c+lxMv/gX+gjLVSJU+GbeTziYjoqls4+BSeaR91AsyEQ0MF4Md ZylkZrzBLd2l2ynZ/tZMZYmJUqq0DH6Cdrjl6gXkMdxOm9L2acMsrqHElDVq2xdaXik+ R2Y90GuOGahXMbWIpum9gj6pWw6HU03wZjL+uaP/ibF87x5lDdh3vTRznYVViN/uS+F7 a8ydmWhS6xzpPgp2JNGQMqvLzPi1uUf8FNf1Kx969dmc+CY6C43nMNMChWyV99D+K5s1 ynBUOkHxSLfGkLYKeqmB71odT5grmdOQLiu6walyD7jOUuViCiLekLm7tEivZaYTLUFp 3BlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=cYnnVZaZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8-v6si6061812plb.83.2018.08.09.11.07.26; Thu, 09 Aug 2018 11:07:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=cYnnVZaZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727517AbeHIUcU (ORCPT + 99 others); Thu, 9 Aug 2018 16:32:20 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:42520 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727407AbeHIUcT (ORCPT ); Thu, 9 Aug 2018 16:32:19 -0400 Received: by mail-pl0-f67.google.com with SMTP id g6-v6so2869211plq.9; Thu, 09 Aug 2018 11:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/GURDllLYMHk2phIf3qJDu1l3AZY/16TJzzt0itEyGw=; b=cYnnVZaZzaefZs1xpQS72jbPduwS0XGILb6IFqCORgd7G3VXzqFjbDcfZtdCobEwdg wEv339LjyDL82Sy8qWRZrCP2BQBm/6HKh5dnZh7ItC9Zg9ziKc0vdCoqaaapclOC9Yl0 SGeP79vRax8ZlpZgPraimNptBIH+4vC+bEo1K2faJcmmYozmYnX62+cR6mKmgmu5go6/ JhhJNGYHaErjXU8KGiT+4FKCNeFT3UeHkEDjrIPNPU/GnLTa3S+XjuRF440ZWzYG5+5+ tGpsqHD3lOpsCjSXjwyMGV0DvsjA7t7Cw426olFrXO52gDyzYL9DuVwG+3pVcY8KsdK8 YY2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=/GURDllLYMHk2phIf3qJDu1l3AZY/16TJzzt0itEyGw=; b=h7p/tZkvshG1ZfJ1htN28ahOL1PgdJ/atpRkdgIAeu2mXG4lJnhIbn5Gme81XvidWV gfAPYCi+3RnqA0PQ1zDMFdtHF5/12BxGUWYQ7A2oUab5ewjugGwL/s9xCWOFVN5Te4Wx aafdvqdmip/SI86hnccKP8WkUgZedqHslw2NshaGogu5LeHzXjrCESAzcFF/MlNkFIL9 ijjuwzV31l1NitO6xUhxQPMZLcqowrVhCU4QSFkyvKOY/5ugYHOp3flL0otWju0ETrs1 2EPUV4cY7o+iFEyDzhRvs2eGrKmK3Axx6G2+mWXw+A5BHybMA8UKpkCK9RJfvbDjRob+ d01w== X-Gm-Message-State: AOUpUlEOY4DPX9azK7c3b6LdanGoy86hmcTYQ2Gv4/59Pq0mSxx5p+PP Z0xufkrZBr+GAV1D9tEcD+k= X-Received: by 2002:a17:902:1703:: with SMTP id i3-v6mr2913894pli.263.1533837980310; Thu, 09 Aug 2018 11:06:20 -0700 (PDT) Received: from localhost (h101-111-148-072.catv02.itscom.jp. [101.111.148.72]) by smtp.gmail.com with ESMTPSA id c66-v6sm17034649pfc.138.2018.08.09.11.06.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 11:06:19 -0700 (PDT) From: Naohiro Aota To: David Sterba , linux-btrfs@vger.kernel.org Cc: Chris Mason , Josef Bacik , linux-kernel@vger.kernel.org, Hannes Reinecke , Damien Le Moal , Bart Van Assche , Matias Bjorling , Naohiro Aota Subject: [RFC PATCH 13/17] btrfs: avoid sync IO prioritization on checksum in HMZONED mode Date: Fri, 10 Aug 2018 03:04:46 +0900 Message-Id: <20180809180450.5091-14-naota@elisp.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180809180450.5091-1-naota@elisp.net> References: <20180809180450.5091-1-naota@elisp.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By prioritizing sync I/Os, btrfs calls btrfs_map_block() for blocks allocated later before calling the function allocated earlier. By the disorder of calling btrfs_map_block(), syncing on I/Os on larger LBAs sometime wait for I/Os on smaller LBAs. Since active checksum worker is limited to some specified number, it is possible to wait for non-starting checksum on smaller LBAs. In such situation, transactions are stucked waiting for I/Os on smaller LBAs to finish, which is never finished. This situation can be reproduced by e.g. fstests btrfs/073. To avoid such disordering, disable sync IO prioritization for now. In the future, it will be reworked to finish checksumming of I/Os on smaller I/Os on committing a transaction. Signed-off-by: Naohiro Aota --- fs/btrfs/disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 00fa6aca9bb5..f79abd5e6b3a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -807,7 +807,7 @@ blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio, async->status = 0; - if (op_is_sync(bio->bi_opf)) + if (op_is_sync(bio->bi_opf) && !btrfs_fs_incompat(fs_info, HMZONED)) btrfs_set_work_high_priority(&async->work); btrfs_queue_work(fs_info->workers, &async->work); -- 2.18.0