Return-Path: Subject: Re: [PATCH 3/4] blk-mq: provide internal in-flight variant To: Bart Van Assche , "linux-block@vger.kernel.org" Cc: "brking@linux.vnet.ibm.com" References: <1501790516-6924-1-git-send-email-axboe@kernel.dk> <1501790516-6924-4-git-send-email-axboe@kernel.dk> <1501795510.2922.25.camel@wdc.com> From: Jens Axboe Message-ID: <631f125d-a165-f5e8-3819-ae29d8808ea0@kernel.dk> Date: Thu, 3 Aug 2017 16:36:37 -0600 MIME-Version: 1.0 In-Reply-To: <1501795510.2922.25.camel@wdc.com> Content-Type: text/plain; charset=utf-8 List-ID: On 08/03/2017 03:25 PM, Bart Van Assche wrote: > On Thu, 2017-08-03 at 14:01 -0600, Jens Axboe wrote: >> +static void blk_mq_check_inflight(struct blk_mq_hw_ctx *hctx, >> + struct request *rq, void *priv, >> + bool reserved) >> +{ >> + struct mq_inflight *mi = priv; >> + >> + if (rq->part == mi->part) >> + mi->inflight++; >> +} >> [ ... ] >> -static inline void part_inc_in_flight(struct request_queue *q, >> - struct hd_struct *part, int rw) >> -{ >> - atomic_inc(&part->in_flight[rw]); >> - if (part->partno) >> - atomic_inc(&part_to_disk(part)->part0.in_flight[rw]); >> -} > > Hello Jens, > > The existing part_inc_in_flight() code includes all requests in the in_flight > statistics for part0 but the new code in blk_mq_check_inflight() not. Is that > on purpose? Should the rq->part == mi->part check perhaps be skipped if > mi->part represents part0? The existing code increments always for the partition in question, and for the root if it's a partition. I'll take a look at that logic, and ensure it's all correct. -- Jens Axboe