# Re: \[PATCH v3 02/15\] mm: introduce is\_huge\_pmd() helper

- From: Qi Zheng \<hidden\>
- Date: 2021-11-10 12:58:44 
- List: linux-doc
- Page: https://ratatoskr.run/linux-doc/2021/11/1568284
- Thread: https://ratatoskr.run/linux-doc/2021/11/1567934/t.md

```text

On 11/10/21 8:29 PM, Jason Gunthorpe wrote:
> On Wed, Nov 10, 2021 at 04:40:44PM +0800, Qi Zheng wrote:
>> Currently we have some times the following judgments repeated in the
>> code:
>>
>> 	is_swap_pmd(*pmd) || pmd_trans_huge(*pmd) || pmd_devmap(*pmd)
>>
>> which is to determine whether the *pmd is a huge pmd, so introduce
>> is_huge_pmd() helper to deduplicate them.
>
> Isn't this pmd_leaf() ?

Currently, the implementation of pmd_leaf() does not include
pmd_devmap() checks. But considering the semantics of pmd_leaf(),
the "devmap" pmd should also belong to "leaf" pmd. Maybe we should
modify pmd_leaf() to make it more semantically consistent?

By the way, something went wrong when sending this patchset, and
I have re-sent the complete patchset, please comment over there.

Thanks,
Qi

>
> Jason
>
```
