Re: [PATCH V2 4/7] block: don't check bio in blk_throtl_dispatch_work_fn

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

 



> +/**
> + * submit_bio_noacct - re-submit a bio to the block device layer for I/O
> + * @bio:  The bio describing the location in memory and on the device.
> + *
> + * This is a version of submit_bio() that shall only be used for I/O that is
> + * resubmitted to lower level drivers by stacking block drivers.  All file
> + * systems and other upper level users of the block layer should use
> + * submit_bio() instead.
> + */
> +void submit_bio_noacct(struct bio *bio)
> +{
> +	if (unlikely(!submit_bio_checks(bio)))
> +		return;
> +	__submit_bio_noacct_nocheck(bio);

Given that this is the only caller of submit_bio_checks I'd merge
the two.

Otherwise looks fine:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

> +}
>  EXPORT_SYMBOL(submit_bio_noacct);
>  
> +void submit_bio_noacct_nocheck(struct bio *bio)
> +{
> +	__submit_bio_noacct_nocheck(bio);
> +}
> +
>  /**
>   * submit_bio - submit a bio to the block device layer for I/O
>   * @bio: The &struct bio which describes the I/O
> diff --git a/block/blk-throttle.c b/block/blk-throttle.c
> index 7c462c006b26..6cca1715c31e 100644
> --- a/block/blk-throttle.c
> +++ b/block/blk-throttle.c
> @@ -1219,7 +1219,7 @@ static void blk_throtl_dispatch_work_fn(struct work_struct *work)
>  	if (!bio_list_empty(&bio_list_on_stack)) {
>  		blk_start_plug(&plug);
>  		while ((bio = bio_list_pop(&bio_list_on_stack)))
> -			submit_bio_noacct(bio);
> +			submit_bio_noacct_nocheck(bio);
>  		blk_finish_plug(&plug);
>  	}
>  }
> diff --git a/block/blk.h b/block/blk.h
> index b2516cb4f98e..ebaa59ca46ca 100644
> --- a/block/blk.h
> +++ b/block/blk.h
> @@ -46,6 +46,7 @@ void blk_freeze_queue(struct request_queue *q);
>  void __blk_mq_unfreeze_queue(struct request_queue *q, bool force_atomic);
>  void blk_queue_start_drain(struct request_queue *q);
>  int __bio_queue_enter(struct request_queue *q, struct bio *bio);
> +void submit_bio_noacct_nocheck(struct bio *bio);
>  
>  static inline bool blk_try_enter_queue(struct request_queue *q, bool pm)
>  {
> -- 
> 2.31.1
> 
---end quoted text---



[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