# Re: \[PATCH\] mm/pmem: Avoid inserting hugepage PTE entry with fsdax if hugepage support is disabled

- From: Dan Williams \<hidden\>
- Date: 2021-02-05 17:47:35 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2021/02/6506060
- Thread: https://ratatoskr.run/linux-mm/2021/02/6506055/t.md

```text
[ add Andrew ]

On Thu, Feb 4, 2021 at 6:40 PM Aneesh Kumar K.V
[ref] wrote:
>
> Differentiate between hardware not supporting hugepages and user disabling THP
> via 'echo never > /sys/kernel/mm/transparent_hugepage/enabled'
>
> For the devdax namespace, the kernel handles the above via the
> supported_alignment attribute and failing to initialize the namespace
> if the namespace align value is not supported on the platform.
>
> For the fsdax namespace, the kernel will continue to initialize
> the namespace. This can result in the kernel creating a huge pte
> entry even though the hardware don't support the same.
>
> We do want hugepage support with pmem even if the end-user disabled THP
> via sysfs file (/sys/kernel/mm/transparent_hugepage/enabled). Hence
> differentiate between hardware/firmware lacking support vs user-controlled
> disable of THP and prevent a huge fault if the hardware lacks hugepage
> support.

Looks good to me.

Reviewed-by: Dan Williams <redacted>

I assume this will go through Andrew.
```
