Linux block layer
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: Tang Yizhou <yizhou.tang@shopee.com>, axboe@kernel.dk, hch@lst.de
Cc: yukuai@fnnas.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Leon Hwang <leon.huangfu@shopee.com>
Subject: Re: [PATCH v3] block: propagate in_flight to whole disk on partition I/O
Date: Fri, 22 May 2026 21:53:00 +0800	[thread overview]
Message-ID: <f1d32a66-3012-47d1-aa0b-44bcf273c29d@linux.dev> (raw)
In-Reply-To: <20260522131409.261259-1-yizhou.tang@shopee.com>

On 2026/5/22 21:14, Tang Yizhou wrote:
> From: Tang Yizhou <yizhou.tang@shopee.com>
> 
[...]
> 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 <linux/bio-integrity.h>
>  #include <linux/blk-crypto.h>
> +#include <linux/part_stat.h>
>  #include <linux/lockdep.h>
>  #include <linux/memblock.h>	/* for max_pfn/max_low_pfn */
>  #include <linux/sched/sysctl.h>
> @@ -11,6 +12,7 @@
>  #include <xen/xen.h>
>  #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
>   */


  parent reply	other threads:[~2026-05-22 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 13:14 [PATCH v3] block: propagate in_flight to whole disk on partition I/O Tang Yizhou
2026-05-22 13:27 ` Christoph Hellwig
2026-05-22 13:53 ` Leon Hwang [this message]
2026-05-22 14:00 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1d32a66-3012-47d1-aa0b-44bcf273c29d@linux.dev \
    --to=leon.hwang@linux.dev \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=leon.huangfu@shopee.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yizhou.tang@shopee.com \
    --cc=yukuai@fnnas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox