Can we remove the checking of CONFIG_ARCH_HAS_PTE_SPECIAL in __vm_insert_mixed?

From: Hao Lee
Date: Mon Sep 28 2020 - 10:37:34 EST


Sorry, the previous email is corrupted. This is a resending.

In the current code, if the architecture supports PTE_SPECIAL,
__vm_insert_mixed() becomes a simple encapsulation of insert_pfn()
because it always calls insert_pfn() and never calls insert_page(). This
behavior is inconsistent with the function's name. As described in commit
423bad600443 ("mm: add vm_insert_mixed"), this function is designed to
supports _both_ raw pfns and pfns with struct page, but in architecture
with PTE_SPECIAL, it treats the latter as the former. So, I think we'd
better remove the checking of CONFIG_ARCH_HAS_PTE_SPECIAL to make the
behavior consistent for all architectures. If my understanding is right,
I can submit a patch to fix this. Thanks.

Regards,
Hao Lee