Re: [RFC PATCH 11/39] blktrace: update blk_add_trace_rq_requeue()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021/02/25 16:04, Chaitanya Kulkarni wrote:
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
> ---
>  kernel/trace/blktrace.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
> index e1646d74ac9a..8a7fedfac6b3 100644
> --- a/kernel/trace/blktrace.c
> +++ b/kernel/trace/blktrace.c
> @@ -1188,7 +1188,25 @@ static void blk_add_trace_rq_merge(void *ignore, struct request *rq)
>  
>  static void blk_add_trace_rq_requeue(void *ignore, struct request *rq)
>  {
> -	blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_REQUEUE,
> +	u64 ta;
> +	struct blk_trace *bt;
> +	struct blk_trace_ext *bte;
> +
> +	rcu_read_lock();
> +	bt = rcu_dereference(rq->q->blk_trace);
> +	bte = rcu_dereference(rq->q->blk_trace_ext);
> +	if (likely(!bt) && likely(!bte)) {
> +		rcu_read_unlock();
> +		return;
> +	}
> +
> +	if (bt) {
> +		ta = BLK_TA_REQUEUE;
> +	} else if (bte) {
> +		ta = BLK_TA_REQUEUE_EXT;
> +	}
> +	rcu_read_unlock();
> +	blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), ta,
>  			 blk_trace_request_get_cgid(rq));
>  }
>  
> 

Same comments as for patch 9.

-- 
Damien Le Moal
Western Digital Research




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux