Re: [PATCH 2/3] block: use singly linked list for bio cache

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

 



On Wed, Dec 15, 2021 at 09:30:08AM -0700, Jens Axboe wrote:
> Pointless to maintain a head/tail for the list, as we never need to
> access the tail. Entries are always LIFO for cache hotness reasons.
> 
> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
> ---
>  block/bio.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/block/bio.c b/block/bio.c
> index d9d8e1143edc..a76a3134625a 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -26,7 +26,7 @@
>  #include "blk-rq-qos.h"
>  
>  struct bio_alloc_cache {
> -	struct bio_list		free_list;
> +	struct bio		*free_list;
>  	unsigned int		nr;
>  };
>  
> @@ -630,7 +630,9 @@ static void bio_alloc_cache_prune(struct bio_alloc_cache *cache,
>  	unsigned int i = 0;
>  	struct bio *bio;
>  
> -	while ((bio = bio_list_pop(&cache->free_list)) != NULL) {
> +	while (cache->free_list) {
> +		bio = cache->free_list;

Nit:

	while ((bio = cache->free_list) != NULL) {

would mke the iteration a litle more obvious.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux