Re: [PATCH] drm/ttm: Do not put non-struct page memory into PUD/PMDs

2021-10-19 Thread Thomas Hellström
On 10/19/21 20:52, Jason Gunthorpe wrote: On Tue, Oct 19, 2021 at 08:49:29PM +0200, Thomas Hellström wrote: Hi, On 10/19/21 20:21, Jason Gunthorpe wrote: PUD and PMD entries do not have a special bit. get_user_pages_fast() considers any page that passed pmd_huge() as usable:

Re: [PATCH] drm/ttm: Do not put non-struct page memory into PUD/PMDs

2021-10-19 Thread Jason Gunthorpe
On Tue, Oct 19, 2021 at 08:49:29PM +0200, Thomas Hellström wrote: > Hi, > > On 10/19/21 20:21, Jason Gunthorpe wrote: > > PUD and PMD entries do not have a special bit. > > > > get_user_pages_fast() considers any page that passed pmd_huge() as > > usable: > > > > if (unlikely(pmd_tra

Re: [PATCH] drm/ttm: Do not put non-struct page memory into PUD/PMDs

2021-10-19 Thread Thomas Hellström
Hi, On 10/19/21 20:21, Jason Gunthorpe wrote: PUD and PMD entries do not have a special bit. get_user_pages_fast() considers any page that passed pmd_huge() as usable: if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd) || pmd_devmap(pmd))) { And vmf

[PATCH] drm/ttm: Do not put non-struct page memory into PUD/PMDs

2021-10-19 Thread Jason Gunthorpe
PUD and PMD entries do not have a special bit. get_user_pages_fast() considers any page that passed pmd_huge() as usable: if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd) || pmd_devmap(pmd))) { And vmf_insert_pfn_pmd_prot() unconditionally sets