[QUESTION] Plain dereference and READ_ONCE() in fault handler
From: Dev Jain
Date: Wed Mar 05 2025 - 05:23:35 EST
In __handle_mm_fault(),
1. Why is there a barrier() for the PUD logic?
2. For the PMD logic, in the if block, we use *vmf.pmd, and in the else block
we use pmdp_get_lockless(); what if someone changes the pmd just when we
have begun processing the conditions in the if block, fail in the if block
and then the else block operates on a different pmd value. Shouldn't we cache
the value of the pmd and operate on a single consistent value until we take the
lock and then finally check using pxd_same() and friends?
Thanks,
Dev