Received: by 10.223.164.202 with SMTP id h10csp620418wrb; Mon, 13 Nov 2017 11:56:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMaicyKTGdcfbhLT/1kS4eQKv8fgljPaYiYmOe4cGcDo4b2IFbACYmtabHP01tNA12s3o9Aw X-Received: by 10.99.122.73 with SMTP id j9mr9676355pgn.154.1510602978108; Mon, 13 Nov 2017 11:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510602978; cv=none; d=google.com; s=arc-20160816; b=AbU9lLFXjhjOQaCjzxdeGJ+0sPOuGvMXtEXadaVFUwlcY1vWVZzjrgKgv8wHjGJfXN C+FP/KgsiH8sxVQ4XVoKlicDVKCi3U3QayP+Vx8WDE+j1Atjqllqxc9OoPjJXA1EhoTD 74cDsiNKPhzpOwFoT1UxnxFzs9px+YNH2Cn4otl6JFmzI1MzFtP5/kEXbn/5D4aeE/H6 5pVM5/a6P2Py7vuZB1ng+fy2lyn1pKdD57rwWULrKB6E5i4OFf2xcrdtblse4rILcNNK 0AE9MVtLAYNcDGNLP0b2IhgCQ3zMBIdxaqu5PzRz8uLc4E11eVlaYBgUMMI78l0g1OLr GoMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=kJvJ66mo4vjDCpw3gtZEFWc4pN67e7KrRMPUlzLt9c8=; b=G2ssBjeQ+rQ0TxoK9GSa37FeZfWPq9igO0XuFQbVVU5wYj1Hga9bz12CVC2MmTU7Mh x8yN5n3L/KXyCjU1oUtWSIqWX/kzuQW8wG9d5MleAFuei2+p4/keN1kPAJc+Q+6wHeQb nXqTS6ipE6LNqNDoLoDbLfehVc4xsPvJ6o0DrjPPhlyB0/jVR8VYQCvXmO3NxqUkXhfT latKP775bhZWVo+l3+Q7YCnvYj8b1OEe/2f8wsfzNimOjrDWcRSgHpdmK4Yw6FBNEnqr O2dP+rdgZxnyLObJPKQLv3VHuaOi4C/or/xT4NdJREZpTFa2NomPEJC4GO5KLlScaLqR SzdQ== ARC-Authentication-Results: i=1; mx.google.com; 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 d18si3063739pls.617.2017.11.13.11.56.05; Mon, 13 Nov 2017 11:56:18 -0800 (PST) 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; 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 S1755231AbdKMTyT (ORCPT + 87 others); Mon, 13 Nov 2017 14:54:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:38014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755133AbdKMTyQ (ORCPT ); Mon, 13 Nov 2017 14:54:16 -0500 Received: from kernel.org (unknown [199.201.64.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 96B5321879; Mon, 13 Nov 2017 19:54:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96B5321879 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=shli@kernel.org Date: Mon, 13 Nov 2017 11:54:13 -0800 From: Shaohua Li To: Tejun Heo Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, kernel-team@fb.com, lizefan@huawei.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, guro@fb.com Subject: Re: [PATCH 7/7] blk-throtl: don't throttle the same IO multiple times Message-ID: <20171113195413.b5lzqem2pt2bg4oe@kernel.org> References: <20171112222613.3613362-1-tj@kernel.org> <20171112222613.3613362-8-tj@kernel.org> <20171113040716.kaheegc4qub42n6z@kernel.org> <20171113111348.GF983427@devbig577.frc2.facebook.com> <20171113155745.GI983427@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171113155745.GI983427@devbig577.frc2.facebook.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 13, 2017 at 07:57:45AM -0800, Tejun Heo wrote: > Hello, > > On Mon, Nov 13, 2017 at 03:13:48AM -0800, Tejun Heo wrote: > > You're right. If we wanna take this approach, we need to keep the > > throttled flag while cloning. The clearing part is still correct tho. > > Without that, I get 1/4 bw limit enforced. Hmm... I'm not quite sure > > where that 1/4 is coming from tho. Will investigate more. > > Okay, this is because when we spiit, the split bio is the first part > which gets issued and then the orignal bio is wound forward and > requeued. So, for the splits, the original bio is the one which gets > trimmed in the front and requeued, so not clearing BIO_THROTTLED is > enough. I think we should still copy BIO_THROTTLED on clones so that > we don't get suprises w/ other bio drivers. I'm not sure how you are going to make this correct. The mechanism is very fragile. So for example, 'q->make_request_fn(q, bio)' could just queue the bio somewhere and handle in other context (both dm and md do this). The bio will be called again with generic_make_request. In this case, the second time shouldn't throttle the bio. The bio could be called again with generic_make_request but with bdev changed. In this case, the second time should throttle the bio (against the new bdev). There are a lot of different usages of bio. I'd rather not depend on generic_make_request dispatches new bio immediately. That's why I add a bdev in my patch. Thanks, Shaohua From 1583967084958906158@xxx Mon Nov 13 15:58:46 +0000 2017 X-GM-THRID: 1583901042028495922 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread