From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755224AbdKMT67 (ORCPT ); Mon, 13 Nov 2017 14:58:59 -0500 Received: from mail-qt0-f178.google.com ([209.85.216.178]:47193 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755180AbdKMT65 (ORCPT ); Mon, 13 Nov 2017 14:58:57 -0500 X-Google-Smtp-Source: AGs4zMbR3EJBR/B6mKZ8LODmb8c5A/wvzZs2XW214LpKm80UuZ4XV+ac/JUVP5i3lhds8FkaxZOWnQ== Date: Mon, 13 Nov 2017 11:58:54 -0800 From: Tejun Heo To: Shaohua Li 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: <20171113195854.GJ983427@devbig577.frc2.facebook.com> 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> <20171113195413.b5lzqem2pt2bg4oe@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171113195413.b5lzqem2pt2bg4oe@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Nov 13, 2017 at 11:54:13AM -0800, Shaohua Li wrote: > 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. I see. Yeah, that makes sense. The cloned bios may get queued to a different request_queue asynchronously and without remembering the last queue, you can't tell whether it's a new queue or not. I'll drop this one and test with your patch. Thanks. -- tejun