Re: [PATCH v8 5/5] block: unpin user pages belonging to a folio at once

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

 



On Thu, Jul 11, 2024 at 10:50 AM Kundan Kumar <kundan.kumar@xxxxxxxxxxx> wrote:
>
> @@ -1215,12 +1214,9 @@ void __bio_release_pages(struct bio *bio, bool mark_dirty)
>                         folio_mark_dirty(fi.folio);
>                         folio_unlock(fi.folio);
>                 }
> -               page = folio_page(fi.folio, fi.offset / PAGE_SIZE);
>                 nr_pages = (fi.offset + fi.length - 1) / PAGE_SIZE -
>                            fi.offset / PAGE_SIZE + 1;
> -               do {
> -                       bio_release_page(bio, page++);
> -               } while (--nr_pages != 0);
> +               bio_release_folio(bio, fi.folio, nr_pages);
Wouldn't it be better to use unpin_user_folio (introduced in the previous
patch) here, rather than using bio_release_folio.

>         }
>  }
>  EXPORT_SYMBOL_GPL(__bio_release_pages);
> diff --git a/block/blk.h b/block/blk.h
> index 777e1486f0de..8e266f0ace2b 100644
> --- a/block/blk.h
> +++ b/block/blk.h
> @@ -558,6 +558,12 @@ static inline void bio_release_page(struct bio *bio, struct page *page)
>                 unpin_user_page(page);
>  }
>
> +static inline void bio_release_folio(struct bio *bio, struct folio *folio,
> +                                    unsigned long npages)
> +{
> +       unpin_user_folio(folio, npages);
> +}
> +
This function takes bio as a parameter but doesn't really use it. Also if
we use unpin_user_folio at the previous place, we wouldn't really need to
introduce this function.
.
>  struct request_queue *blk_alloc_queue(struct queue_limits *lim, int node_id);
>
>  int disk_scan_partitions(struct gendisk *disk, blk_mode_t mode);
> --
> 2.25.1
>
>
Could you give this series a respin against the latest for-next, some patches
don't apply cleanly now.
--
Anuj Gupta





[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