From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E17E23D45EA for ; Fri, 22 May 2026 13:53:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779458031; cv=none; b=rOWfKUxBna+3o12DkjOnNEAlNCUSMJh0KDBInqKAkkuRE093gCYHe3koMHJyRplBlFE30/Dr2JGaTTJ3pw023kVykTsGZ7TAGFVVFN87F4CuzsU2SaDNP63z7LSUjHe7QHxk08lGC9t2WFD/9pu5ThZIXwJpCaivnEkMtDHGr28= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779458031; c=relaxed/simple; bh=RmNo5dh/QTmEkdwcuurXUdGvUNVGGNZJdYIVdA1smZg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sbsDuDczs8SMI15lsH2apBEFYFt9ClaBPdpwrli71wPogpJl4M/wqA4jKFe5G8+lcvJyjO88DKmnFiurMHzIFCFuYuXSLscTuYXO6HnUfoMchxWwnIi7hNrFFhr+LH1ThtajUyBAEtsqO+yNRVkKIkXsXjjXGy8x5Vt+qTH8OZ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Wf5vJSsi; arc=none smtp.client-ip=95.215.58.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Wf5vJSsi" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779458026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RxSnp7co5OeY1WYH1TTbRUWf58UGt2Y3upyhixDx34k=; b=Wf5vJSsi2bmlwLkMqh3Ji1jvPdWoG3NAlr7fKNHG7IYNNtPlO9LuAX7jDQW1akAzaO5bG6 wLPIB/DTipvvGm3ma2Wm+uaNm9gY/d2w9s/BVeXS2PSXg4+25kRNAVFnv6HUCHQzaXc1MA ShNSJqYGWDI+fx0Dqyrab4muCPxrA1s= Date: Fri, 22 May 2026 21:53:00 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v3] block: propagate in_flight to whole disk on partition I/O To: Tang Yizhou , axboe@kernel.dk, hch@lst.de Cc: yukuai@fnnas.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Leon Hwang References: <20260522131409.261259-1-yizhou.tang@shopee.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: <20260522131409.261259-1-yizhou.tang@shopee.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/5/22 21:14, Tang Yizhou wrote: > From: Tang Yizhou > [...] > diff --git a/block/blk.h b/block/blk.h > index b998a7761faf..05099aab6863 100644 > --- a/block/blk.h > +++ b/block/blk.h > @@ -4,6 +4,7 @@ > > #include > #include > +#include > #include > #include /* for max_pfn/max_low_pfn */ > #include > @@ -11,6 +12,7 @@ > #include > #include "blk-crypto-internal.h" > > + NIT: I think this new line is added unintentionally. Should be dropped. Thanks, Leon > struct elv_change_ctx; > > /* > @@ -485,6 +487,26 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req) > q->last_merge = NULL; > } > > +static inline void bdev_inc_in_flight(struct block_device *bdev, > + enum req_op op) > +{ > + bool rw = op_is_write(op); > + > + part_stat_local_inc(bdev, in_flight[rw]); > + if (bdev_is_partition(bdev)) > + part_stat_local_inc(bdev_whole(bdev), in_flight[rw]); > +} > + > +static inline void bdev_dec_in_flight(struct block_device *bdev, > + enum req_op op) > +{ > + bool rw = op_is_write(op); > + > + part_stat_local_dec(bdev, in_flight[rw]); > + if (bdev_is_partition(bdev)) > + part_stat_local_dec(bdev_whole(bdev), in_flight[rw]); > +} > + > /* > * Internal io_context interface > */