# Re: \[PATCH v4 08/14\] mm/gup: grab head page refcount once for group of subpages

- From: Jason Gunthorpe \<jgg@nvidia.com\>
- Date: 2021-10-14 18:07:01 
- List: linux-doc
- Page: https://ratatoskr.run/linux-doc/2021/10/6511614
- Thread: https://ratatoskr.run/linux-mm/2021/08/6510545/t.md

```text
On Thu, Oct 14, 2021 at 06:56:51PM +0100, Joao Martins wrote:

> > And I would document this relationship in the GUP side "This do/while
> > is required because insert_pfn_pmd/pud() is used with compound pages
> > smaller than the PUD/PMD size" so it isn't so confused with just
> > "devmap"
> 
> Also, it's not that PMDs span compound heads, it's that PMDs/PUDs use
> just base pages. Compound pages/head in devmap are only introduced by
> series and for device-dax only.

I think it all makes sense, I just want to clarify what I mean by
compound_head:

  compound_head(base_page) == base_page

Ie a PMD consisting only of order 0 pages would have N 'compound_heads'
within it even though nothing is a compound page.

Which is relavent because the GUP algorithms act on the compound_head

Jason
```
